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: bla
*******************************/
if( eregi(basename(__FILE__),$_SERVER['PHP_SELF']) )
{
die("You can't access this file directly!");
}
?>
<?php print border('sgray','start','Tournament'); ?>
<div style="border:1px solid #212121; width:145px;">
<ul id="tab_menu">
<li><a href="http://fc-guild.org/joomla/apps/roster/addon.php?roster_addon_name=tournament&show_all_entries=1" target="_self">All Entries</a></li>
<li><a href="http://fc-guild.org/joomla/apps/roster/addon.php?roster_addon_name=tournament&show_ranks=1" target="_self">Ranking List</a></li>
<li><a href="http://fc-guild.org/joomla/apps/roster/addon.php?roster_addon_name=tournament&add_tickets=1" target="_self">Add Tickets</a></li>
</ul>
</div>
<?php print border('sgray','end'); ?>
<br>
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
<!--
.float { float:left; }
-->
</style>
<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_once('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'];
$add_tickets = $_REQUEST['add_tickets'];
if($display_entries){
$result = mysql_query("SELECT * FROM tournament order by tickets desc")
or die(mysql_error());
echo border('syellow','start','Entries');
echo '<table class="float" 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>";
$link = mysql_connect($DBhost, $DBuser, $DBpass);
if (!$link) {
die('Not connected : ' . mysql_error());
}
// make foo the current db
$db_selected = mysql_select_db($DBName, $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
$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 class="float" 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');
}
if($add_tickets){
include('input.php');
}
?>