print "</table>"; } } else { //code for the game goes in here $db2 = new SMR_HISTORY_DB(); $db2->query("SELECT DATE_FORMAT(start_date, '%c/%e/%Y') as start_date, type, " . "DATE_FORMAT(end_date, '%c/%e/%Y') as end_date, game_name, speed, game_id " . "FROM game WHERE game_id = '{$game_id}'"); print_table(); $db2->next_record(); $start = $db2->f("start_date"); $end = $db2->f("end_date"); $type = $db2->f("type"); $speed = $db2->f("speed"); print "<tr><td align=center>General Info</td><td align=center>Other Info</td></tr>\n\t<tr>\n\t<td valign=top align=center>\n\t<table>\n\t<tr><td align=right>Name</td> <td> </td><td align=left>{$game_name}</td></tr>\n\t<tr><td align=right>Start Date</td> <td> </td><td align=left>{$start}</td></tr>\n\t<tr><td align=right>End Date</td> <td> </td><td align=left>{$end}</td></tr>\n\t<tr><td align=right>Game Type</td> <td> </td><td align=left>{$type}</td></tr>\n\t<tr><td align=right>Game Speed</td> <td> </td><td align=left>{$speed}</td></tr>\n\t</table>\n\t</td>"; $db2->query("SELECT * FROM player WHERE game_id = {$game_id} ORDER BY experience DESC"); if ($db2->next_record()) { $players = $db2->nf(); $max_exp = $db2->f("experience"); } $db2->query("SELECT * FROM player WHERE game_id = {$game_id} ORDER BY alignment DESC"); if ($db2->next_record()) { $align = $db2->f("alignment"); } $db2->query("SELECT * FROM player WHERE game_id = {$game_id} ORDER BY alignment ASC"); if ($db2->next_record()) { $align_low = $db2->f("alignment"); } $db2->query("SELECT * FROM player WHERE game_id = {$game_id} ORDER BY kills DESC"); if ($db2->next_record()) { $kills = $db2->f("kills"); } $db2->query("SELECT * FROM alliance WHERE game_id = {$game_id}");
if (isset($past)) { $db = new SMR_HISTORY_DB(); } if ($cat == "<b>Money Donated to SMR</b>") { $db->query("SELECT account_id, sum(amount) as amount FROM account_donated " . "WHERE account_id = " . SmrSession::$old_account_id . " GROUP BY account_id"); } else { $db->query("SELECT account_id, {$row} as amount FROM {$table} " . "{$row} > 0 AND account_id = " . SmrSession::$old_account_id . " ORDER BY amount DESC"); } if ($db->next_record()) { $my_stat = $db->f("amount"); if ($cat == "<b>Money Donated to SMR</b>") { $db->query("SELECT account_id, sum(amount) as amount FROM account_donated " . "WHERE amount > {$my_stat} GROUP BY account_id ORDER BY amount DESC"); } else { $db->query("SELECT account_id, {$row} as amount FROM {$table} " . "{$row} > {$my_stat} ORDER BY amount DESC"); } $better = $db->nf(); } else { $my_stat = 0; if ($cat == "<b>Money Donated to SMR</b>") { $db->query("SELECT account_id, sum(amount) as amount FROM account_donated " . "GROUP BY account_id ORDER BY amount DESC"); } else { $db->query("SELECT account_id, {$row} as amount FROM {$table} {$row} > 0 ORDER BY amount DESC"); } $better = $db->nf(); } if ($better >= 25) { if (isset($past)) { $sql = "game_id = {$game_id} "; } else { $sql = ""; }