rendered paste body<?php
/******************************
* WoWRoster.net Roster
* Copyright 2002-2006
* Licensed under the Creative Commons
* "Attribution-NonCommercial-ShareAlike 2.5" license
*
* Short summary
* http://creativecommons.org/licenses/by-nc-sa/2.5/
*
* Full license information
* http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
* -----------------------------
*
* $Id: latestloot.php,v 1.1 2006/07/13 17:11 Thumann $
*
* Introduction:
*******************************/
if( eregi(basename(__FILE__),$_SERVER['PHP_SELF']) )
{
die("You can't access this file directly!");
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<script type="text/javascript" src="addons/tournament/itemstats/overlib/overlib.js"><!-- overLIB © Erik Bosrup --></script>
</body>
</html>
<?php
include_once('itemstats/eqdkp_itemstats.php');
include('conf.php');
$server_name_escape = $wowdb->escape($roster_conf['server_name']);
$guild_name_escape = $wowdb->escape($roster_conf['guild_name']);
$display_entries = $_REQUEST['show_all_entries'];
$display_ranks = $_REQUEST['show_ranks'];
if($display_entries){
$result = mysql_query("SELECT * FROM tournament order by tickets desc")
or die(mysql_error());
echo border('syellow','start','Entries');
echo '<table cellpadding="0" cellspacing="0"> ';
echo '<tr>';
while ($row = mysql_fetch_array($result)) {
$name = $row[name];
$item = $row[item];
$quantity = $row[quantity];
$tickets = $row[tickets];
$myhtml = "$row[name] - [item]".$item."[/item] ".'<span>x</span>'." $quantity = $tickets";
echo itemstats_parse('<tr><td class="membersHeader">'.$myhtml.'</td></tr>');
}
echo '</table>';
echo border('syellow','end');
echo "<br>";
mysql_free_result($result);
$query = "SELECT item, SUM(quantity) FROM tournament GROUP BY item";
$result = mysql_query($query) or die(mysql_error());
echo border('syellow','start','Totals');
echo '<table cellpadding="0" cellspacing="0"> ';
echo '<tr>';
while ($row = mysql_fetch_array($result)) {
$item = $row[item];
$quantity = $row['SUM(quantity)'];
$myhtml = "[item]".$item."[/item] ".'<span>x</span>'." $quantity";
echo itemstats_parse('<tr><td class="membersHeader">'.$myhtml.'</td></tr>');
}
echo '</tr>';
echo '</table>';
echo border('syellow','end');
}
if($display_ranks){
$query = "SELECT name, SUM(tickets) AS Sum_Tickets FROM $table GROUP BY name order by Sum_Tickets DESC";
$result = mysql_query($query) or die(mysql_error());
echo border('syellow','start', 'Ranking');
echo '<table cellpadding="1w" cellspacing="0"> ';
// Print out result
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['name'];
echo "</td><td>";
echo $row['Sum_Tickets'];
echo "</td></tr>";
}
echo "</table>";
echo border('syellow','end');
}
?>