1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
<?PHP
htmlHeader(
array('stats'), 'Members',
'Members for Pathery.com',
array('scores', 'dateformat')
);
?>
<body>
<?php
topbar($Links);
include_once ('./includes/sqlEmbedded.php');
include_once ('./includes/datas.php');
?>
<script>
javascript:membersShowPage(1);
</script>
<?
//Order by:
//$order = "ORDER BY $c $o";
//$data = getMembers(1, 10);
$json = json_encode($data);
//onchange="savePref("speed", this.value)"
//style='border:1px solid red;width: 500px; position:absolute;'
?>
<div class='wrapper'>
<!--
<form class='memberListForm'>
<select id="membersPerPage">
<option value="10" selected="selected">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
-->
<div id='members'>
</div>
</div>
<br />
<br />
<?
//echo $json;
//print_r($data);
htmlfooter();
exit;
$sql = "SELECT
users.ID,
users.displayName,
users.totalMoves,
(SELECT SUM(moves) FROM solutions
WHERE solutions.userID = users.ID AND
solutions.dateModified BETWEEN DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) AND CURRENT_DATE) AS totalMovesThisWeek,
users.totalMazes,
users.totalWins,
users.totalTies,
IfNull(userData.wallColor, '#666666') as wallColor,
IfNull(userData.displayColor, '#cccccc'),
userData.wallEmblem,
users.datejoined as dateJoined,
users.dateLogin as dateLogin
FROM `users`
LEFT JOIN `userData` ON users.ID = userData.userID
GROUP BY users.ID
$order
";
$result = mysql_query($sql);
$cat['Rank'] = '';
$cat['Badge'] = '';
$cat['Name'] = '';
$cat['Mazes']['c'] = 'totalMazes';
$cat['Mazes']['title'] = 'Total Mazes Played';
$cat['Moves']['c'] = 'totalMoves';
$cat['Moves']['title'] = 'Total Moves Mazed';
$cat['Past Week']['c'] = 'totalMovesThisWeek';
$cat['Past Week']['title'] = 'Total Moves In Past 7 Days (Excluding Today)';
$cat['Wins']['c'] = 'totalWins';
$cat['Wins']['title'] = 'Total Wins (Champion)';
$cat['Ties']['c'] = 'totalTies';
$cat['Ties']['title'] = 'Total Ties';
$cat['Joined']['c'] = 'dateJoined';
$cat['Joined']['title'] = 'Pathery life begins';
$cat['Last Login']['c'] = 'dateLogin';
$cat['Last Login']['title'] = 'Last Pathery fix on';
echo "
<div class='wrapper'>
<h2>Members wall</h2>
<table class='score'>
<tr>";
//Echo Table Headers
foreach ($cat as $name => $item) {
$co = 'desc';
if (isset($item['c'])) {
if ($item['c'] == $c) {
$name = "<i>$name</i>";
if ($o == 'DESC') {
$co = 'asc';
}
}
echo "<th title='$item[title]'><a href='?c=$item[c]&o=$co'>$name</a></th>";
} else {
echo "<th>$name</th>";
}
}
//Echo Table Data
$i = 0;
while (list($userID, $display, $moveCount, $moveCountWeek, $mazeCount, $winCount, $tieCount, $wallColor, $nameColor, $wallEmblem, $joined, $lastLogon) = mysql_fetch_row($result)) {
//Prepare data
$i++;
$joined = Date("Y-m-d", strtotime($joined));
$lastLogon = Date("Y-m-d", strtotime($lastLogon));
if (!$moveCount)
$moveCount = 0;
if (!$moveCountWeek)
$moveCountWeek = 0;
if ($lastLogon == 0)
$lastLogon = "Never";
//Prepare background for this line
$background = '#262631';
if ($i % 2 == 1)
$background = '#20202a';
if ($_SESSION['userID'] == $userID)
$background = '#343c57';
echo "
<tr style='background-color: $background; color:$nameColor;' >
<td>$i</td>
<td>
<div class='grid_td' style='width:35px; height:35px; background:$wallColor url(images/marks/$wallEmblem);'>
<div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>
</div>
</div>
</td>
<td><span title='UserID: $userID'><a href='achievements?id=$userID' style='color:$nameColor'>$display</a></span></td>
<td>$mazeCount</td>
<td>$moveCount</td>
<td>$moveCountWeek</td>
<td>$winCount</td>
<td>$tieCount</td>
<td>$joined</td>
<td>$lastLogon</td>
</tr>";
}
echo "
</table>
<br />
<br />
</td>
</tr>
</table>
</div>
<div id='copy' style='width:100%;clear: both'>
Copyright © 2011-2012 pathery.com
</div>
";
htmlFooter();
?>
|