<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>SiteMasters WhatPulse</title>
<style type="text/css">
body {
background-image:url('background_small.jpg');
background-repeat:no-repeat;
background-position:center center;
background-color:#394618;
text-align: center;
font-family: "Verdana";
font-size:11px;
}
a {
color: white;
text-decoration: underline;
}
h1 {
font-family: "Verdana";
font-size: 16px;
font-weight:bold;
font-style: italic;
text-align: left;
margin-top: 5px;
margin-left: 30px;
padding-bottom: 10px;
}
#container {
width: 1000px;
margin: 0 auto;
color: white;
height: 900px;
}
#top {
background: url('background_trans.png') repeat;
font-weight: bold;
font-size: 13px;
height: 55px;
}
#list {
margin-top: 50px;
background: url('background_trans.png') repeat;
text-align: left;
padding-top: 25px;
padding-bottom: 25px;
}
.back {
margin-left: 100px;
}
#details {
margin-top: 50px;
background: url('background_trans.png') repeat;
text-align: left;
padding-top: 25px;
padding-bottom: 25px;
}
#list span {
margin-left: 100px;
font-weight: bold;
padding-bottom: 5px;
}
table {
margin-left: 100px;
font-family: "Verdana";
font-size: 11px;
}
th {
font-weight: bolder;
background-color: white;
color: black;
text-align: left;
}
th.headerSortUp {
background-image: url(asc.gif);
}
th.headerSortDown {
background-image: url(desc.gif);
}
th.header {
cursor: pointer;
font-weight: bold;
background-repeat: no-repeat;
background-position: center left;
padding-left: 20px;
border-right: 1px solid #dad9c7;
margin-left: -1px;
}
td {
color: white;
width: 150px;
}
</style>
<script type="text/javascript" src="jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="jquery.metadata.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//Call the tablesorter method which is provided by the jquery.tablesorter file
$("table").tablesorter({
sortList:[[1,1],[2,1],[3,1]]
});
$("#details").hide()
$(".userdetails").attr("href", "javascript:;")
$(".userdetails").click(function(){
$.ajax({
type: "GET",
url: "user.php?id=" + $(this).attr("title"),
dataType: "text",
success: function(msg){
$("#details").empty();
$("#details").append(msg);
$("#list").fadeOut(500, function(){
$("#details").fadeIn(500);
//A ugly fix to solve the double background problem in firefox
if($.browser.mozilla){
$("body").css("background-image", "url('background_small.jpg')");
}
});
}
});
});
});
</script>
</head>
<body>
<?php
//Load the WhatPulse XML file.
$xml = simplexml_load_file("http://whatpulse.org/api/team.php?TeamID=11016");
$statistics = $xml->TeamStats->Statistics;
$members = $xml->TeamStats->Members;
?>
<div id="container">
<div id="top">
<h1>Sitemasters WhatPulse Ranking</h1>
<span>
Totaal Afstand:
<?=number_format(round(($statistics->TeamMiles * 1.609344),2),2)?> KM
</span>
</div>
<div id="list">
<span>Gebruik SHIFT voor multi sorteren.</span>
<table cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th>Username</th>
<th class="{sorter: 'currency'}">Toetsen</th>
<th class="{sorter: 'currency'}">Kliks</th>
<th class="{sorter: 'currency'}">Afstand in KM</th>
<th class="{sorter: 'percentage'}">Bijdrage</th>
</tr>
</thead>
<tbody>
<?php foreach($members->Member as $member) :
$percentage1 = round(($member->MemberKeys / $statistics->TeamKeys) * 100,2); $percentage2 = round(($member->MemberClicks / $statistics->TeamClicks) * 100,2);
$bijdrage = round($percentage1 + $percentage2 / 2,2); ?>
<tr>
<td><a class="userdetails" href="user.php?id=<?=$member->MemberUserID?>" title="<?=$member->MemberUserID?>"><?=$member->MemberName?></a></td>
<td><?=$bijdrage?>%</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div id="details">
<!--The container for the user details -->
</div>
</div>
</body>
</html>