Location: PHPKode > projects > Nukequiz > html/modules/Nukequiz/admin/NQAViewQuizList.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	 */
/*****************************************************************/
$pagetitle = _NQ_ADMINQLIST;
include ("header.php");
nqmenuheader();
$pagenum = $nq_config['pagenum'];
$backupdir = $nq_config['backup_directory'];
$totalpages = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nquiz_quiz"));
if (!isset($min)) { $min = 0; }
if (!isset($max)) { $max = $min + $pagenum; } 
OpenTable();
echo "<br><center><font class='title'>"._NQ_MAINQUIZLIST."</font></center><br>";
$checktable = $db->sql_fetchrow($db->sql_query("SHOW TABLES LIKE '".$prefix."_nquiz_temp'"));
if ($checktable > '0') {
echo "<br><center><font class='title'>"._NQ_WARNINGRANDQUESTIONS."</font></center><br>";
}
echo "<center><table width='100%' border='0' cellpadding='1' cellspacing='1'><tr><th>#</th><th>"._NQ_QUIZINFO."</th><th>"._NQ_QUIZADMINDETAIL."</th><th>"._NQ_OPTIONS."</th></tr><tr>";
$result = $db->sql_query("SELECT
".$prefix."_nquiz_quiz.qid,".$prefix."_nquiz_quiz.active,".$prefix."_nquiz_quiz.iscq,".$prefix."_nquiz_quiz.dir,".$prefix."_nquiz_quiz.title,".$prefix."_nquiz_quiz.limit_attempts,".$prefix."_nquiz_quiz.expire,
".$prefix."_nquiz_quiz.hit_count,".$prefix."_nquiz_quiz.maxqnum,".$prefix."_nquiz_quiz.points_total,".$prefix."_nquiz_sections.secname
FROM ".$prefix."_nquiz_quiz, ".$prefix."_nquiz_sections WHERE ".$prefix."_nquiz_quiz.sid = ".$prefix."_nquiz_sections.sid ORDER BY qid ASC LIMIT $min,$pagenum");
if (!$db->sql_numrows($result)){
echo "<td align='center' colspan='5'><font class='title'><br>"._NQ_NORESULTS."</font><br><br>"._NQ_CREATEQUIZFIRST."<br><br></td></tr></table><br>";
}
else {
while(list($qid,$active,$iscq,$quizdir,$title,$limit,$expire,$hitcount,$maxqnum,$pointstot,$section) = $db->sql_fetchrow($result))
{
$formatdate = $nq_config['dateformat'];
$imagesdir = $nq_config['images_directory'];
$folderpath="modules/$module_name/$imagesdir/$quizdir";
$filecount=dirlist($folderpath);
if($filecount==''){$filecount='0';}
if(!$maxqnum) { $maxqnum = 'No';}
$none = ""._NQ_NONE."";
$icount = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nquiz_questions WHERE file!='$none' AND qid='$qid'"));
if ($expire == '0'){$date= ""._NQ_NOCLOSEDATESET."";}else{
$date = date($formatdate,$expire);}
if ($limit == '1'){$limit= ""._NQ_LIMITEDONLY."";}else{$limit = '';}
if($icount == $filecount){$missingfiles = '';} else {
$missingfiles = "<b>"._NQ_QUESTIONFILESFOUND."&nbsp;<blink>$filecount&nbsp;/&nbsp;$icount</blink>&nbsp;"._NQ_REQUIRED."</b>";
}
if($iscq=='1'){
echo "<tr><td width='4%' align='center' class='row1'><b>[$qid]</b></td>";
}
else{
echo "<tr><td width='4%' align='center' class='row1'>[$qid]</td>";
}
if ($active>'0')
{
echo "<td class='row1' align='center'><a href='modules.php?name=$module_name&amp;file=index&amp;op=startquiz&amp;qid=$qid'>$title</a>";
echo "<br>(&nbsp;$section&nbsp;)<br>$date<br>$limit</td><td class='row1' align='center'>"._NQ_DIRNAME.":<b>$quizdir</b><br>";
echo "<b>$maxqnum</b>&nbsp;"._NQ_QUES."&nbsp;(&nbsp;$pointstot&nbsp;"._NQ_PTS."&nbsp;)<br>"._NQ_ATTEMPTS."&nbsp;:&nbsp;";
echo "<b>$hitcount</b><br>$missingfiles</b></td>";
}
else
{
echo "<td class='row1' align='center'>$title<br>(&nbsp;$section&nbsp;)<br>$date</td><td class='row1' align='center'>";
echo ""._NQ_DIRNAME.":<b>$quizdir</b><br><b>$maxqnum</b>&nbsp;"._NQ_QUES."&nbsp;(&nbsp;$pointstot&nbsp;"._NQ_PTS."&nbsp;)<br>";
echo ""._NQ_ATTEMPTS."&nbsp;:&nbsp;<b>$hitcount</b><br>$missingfiles</b></td>";
}
nqdisplayimagewin();
echo "<td width='35%' class='row1' align='center'><form method='post' action='".$admin_file.".php'>";
echo "<table cellpadding='2' cellspacing='2' border='0'><tr>";
echo "<td>".quizhelp_img(_NQ_HELPADMINVIEWQLSTOPTIONS)."</td>";
echo "<td><a href='".$admin_file.".php?op=nqviewentries&amp;qid=$qid'><img src='modules/$module_name/images/report.png' title='"._NQ_SHOWSCORE."' onMouseOver=\"self.status='"._NQ_SHOWSCORE." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_SHOWSCORE."\"></a></td>";
echo "<td><a href='".$admin_file.".php?op=nqdisplayquestionfiles&amp;quizdir=$quizdir&amp;title=$title' Onclick=\"displayimage(this.href,'','550','500','yes');return false;\"><img src=\"modules/$module_name/images/images.png\" title=\""._NQ_VIEWFILES."\" onMouseOver=\"self.status='"._NQ_VIEWFILES." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_VIEWFILES."\"alt=\""._NQ_VIEWFILES."\"></a></td>";
echo "<td><a href=\"".$admin_file.".php?op=nquploadquestionimagefiles&amp;quizdir=$quizdir\"><img src=\"modules/$module_name/images/upload_image.png\" title=\""._NQ_UPQUIZIMAGEFILES."\" onMouseOver=\"self.status='"._NQ_UPQUIZIMAGEFILES." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_UPQUIZIMAGEFILES."\"></a></td>";
echo "<td><a href=\"".$admin_file.".php?op=nquploadquestionsoundfiles&amp;quizdir=$quizdir\"><img src=\"modules/$module_name/images/upload_sound_.png\" title=\""._NQ_UPQUIZSOUNDFILES."\" onMouseOver=\"self.status='"._NQ_UPQUIZSOUNDFILES." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_UPQUIZSOUNDFILES."\"></a></td>";
echo "<td><a href=\"".$admin_file.".php?op=nqresetquiz&amp;qid=$qid\"><img src=\"modules/$module_name/images/reset.png\" title=\""._NQ_RESET."\" onMouseOver=\"self.status='"._NQ_RESET." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_RESET."\"alt=\""._NQ_RESET."\"></a></td>";
$ftitle = str_replace(" ", "_", $title); 
if(file_exists("modules/$module_name/$backupdir/$ftitle.zip")){
echo "<td><a href='modules/$module_name/$backupdir/$ftitle.zip'><img src=\"modules/$module_name/images/redflag.png\" title=\""._NQ_EXPORTFILECREATED."\" onMouseOver=\"self.status='"._NQ_EXPORTFILECREATED." ';return true\" onmouseout=\"self.status='';return true\"alt=\""._NQ_EXPORTFILECREATED."\"></a></td>";
}
else {
echo "<td width='16'></td>";
}
echo "</td></tr></table></center>";
echo "<input type='hidden' name='file' value='admin'>";
echo "<input type='hidden' name='op' value='viewquizlist'>";
echo "<input type='hidden' name='sid' value='$sid'>";
echo "<input type='hidden' name='qid' value='$qid'>";
echo "<input type='hidden' name='title' value='$title'>";
echo "<input type='hidden' name='quizdir' value='$quizdir'>";
echo "<select name='op'>";
if ($active =='1') {
echo "<option value='nqdeactivatequiz' selected>"._NQ_DEACTIVATE."</a>";
} else {
echo "<option value='nqactivatequiz' selected>"._NQ_ACTIVATE."</a>";
}
echo "<option value='nqmodifyquiz'>"._NQ_MODIFYQUIZ."</option>";
echo "<option value='nqaddquestion'>"._NQ_ADDQUESTION."</option>";
if ($checktable > '0') {
echo "<option value='nqimporttempquestions'>"._NQ_IMPORTRANDOM."</option>";
}
echo "<option value='nqimportquestions'>"._NQ_IMPORT."</option>";
echo "<option value='nqexportquestions'>"._NQ_EXPORT."</option>";
if(file_exists("modules/$module_name/$imagesdir/$quizdir/watermark.txt")){
echo "<option value='nqaddwatermark'>"._NQ_ADDWATERMARK."</option>";
}
echo "<option value='nqdeletequiz'>"._NQ_DELETE."</option></select>&nbsp;&nbsp;";
echo "<input type='submit' value='"._NQ_GO."'></form>";
}
echo "</tr></table></center>";
}
CloseTable();
pagequiz($pagenum, $totalpages, $max, $min);	
include ("footer.php");
?>
Return current item: Nukequiz