Location: PHPKode > projects > Nukequiz > html/modules/Nukequiz/public/NQPShowScoreboard.php
<?php
/*****************************************************************/
/* Nukequiz (tm)    v 3.1.0                                		 */
/* By: Kissoftware (hide@address.com)      		     */
/* http://www.kissoftware.org.uk                           		 */
/* http://www.kissoftware.co.uk                       		     */
/* Copyright © 2003-2008 by Kissoftware         				 */
/* See Docs For Information & Credits                 			 */
/* For More information Visit Forums Or The Online Help Manual	 */
/*****************************************************************/
$details = $db->sql_query("SELECT title FROM ".$prefix."_nquiz_quiz WHERE qid='$qid'");
list($title) = $db->sql_fetchrow($details);
$Theme_Sel = get_theme();
echo "<html><link rel='StyleSheet' href='$nukeurl/themes/$Theme_Sel/style/style.css' TYPE='text/css'>";
echo "<head>";
include_once("themes/$Theme_Sel/theme.php");
echo "<title>"._NQ_RESULTS4."&nbsp;:&nbsp;$title</title>";
echo "</head>";
$blkh = $nq_config['blocklist'];
OpenTable();
$totalpages = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nquiz_scoreboard WHERE qid='$qid'"));
if (!isset($min)) { $min = 0; }
if (!isset($max)) { $max = $min + $pagenum; } 
$statistics = $db->sql_query("SELECT * FROM ".$prefix."_nquiz_scoreboard WHERE qid='$qid' ORDER BY perc DESC LIMIT 0,$blkh");
echo "<br><center><font class='title'>"._NQ_TOP."&nbsp;$blkh&nbsp;"._NQ_LISTSCORE."</font><br><br>";
echo"<table width='100%' border='0' cellpadding='2' cellspacing='2'><tr>";
echo"<th width='5%'>#</th><th class='row1' width='20%'>"._NQ_NAME."</th><th class='row1' width='15%'>"._NQ_PERCENT."</th><th width='25%'>"._NQ_TTAKEN."</th><th width='40%'>"._NQ_DATE."</th></tr>";
if ($db->sql_numrows($statistics)== ""){
echo "<tr><td align='center' class='row1' colspan='5'><b>"._NQ_NORESULTS."</b></td></tr>";
}
else {
$rowcount = $min+1;
while($astatistics = mysql_fetch_array($statistics)){
$setid = $db->sql_query("SELECT * FROM ".$prefix."_nquiz_quiz WHERE qid='$qid'");
$setid = mysql_fetch_array($setid);
$user = $astatistics['username'];
$name_len = $nq_config['cutoff'];
if (strlen($user) > $name_len){$user = substr($user, 0, ($name_len-2))."...";}
$perc = $astatistics['perc'];
$date = $astatistics['date'];
$dateformat = $nq_config['dateformat'];
$date = date($dateformat, $date);
$ttime = $astatistics['ttime'];
echo "<tr><td class='row1' align='center'>$rowcount</td><td class='row1'>$user</td><td align='center' class='row1'>$perc%<td align='center' class='row1'>$ttime</td><td class='row1'>$date</td></tr>";
$rowcount++;
}
}
echo "</table><br><br>[&nbsp;<a href=\"javascript:void(0)\" onClick=javascript:self.close()>"._NQ_CLOSEWIN."</a>&nbsp;]<br><br></center>";
CloseTable();
echo "</body></html>";
?>
Return current item: Nukequiz