Location: PHPKode > projects > Nukequiz > html/modules/Nukequiz/admin/NQAModifyQuiz.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_ADMINMODIFYQUIZ;
include ("header.php");
nqmenuheader();
$result = $db->sql_query("SELECT * FROM ".$prefix."_nquiz_quiz WHERE qid='$qid'");
while(list($qid, $sid, $active, $iscq, $prize, $sponsor, $dir, $title, $emailadmin, $random, $emailuser, $limit, $viewans, $expire, $count, $quesnum, $points, $rate, $votes, $adminemail) = $db->sql_fetchrow($result)){
$active = intval($active);
$emailadmin = intval($emailadmin);
$emailuser = intval($emailuser);
$view = intval($view);
$viewans = intval($viewans);
$limit = intval($limit);
$iscq = intval($iscq);
if ($active==1) { $active = "checked"; }
if ($emailadmin==1) { $emailadmin = "checked"; }
if ($emailuser==1) { $emailuser = "checked"; }
if ($limit==1) { $limit = "checked"; }
if ($viewans==1) { $view = "checked"; }
if ($iscq==1) { $iscq = "checked"; }
OpenTable();
echo "<form method='post' action='".$admin_file.".php'>";
echo "<input type='hidden' name='op' value='nqsavequizchanges'>";
echo "<input type='hidden' name='file' value='admin'>";
echo "<input type='hidden' name='qid' value='$qid'>";
echo "<br><center><table width='100%' border='0' cellpadding='3' cellspacing='3'>";
echo "<tr><td colspan='3' align='center'><font class='title'>"._NQ_EDITSETTINGS."</font></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPQTITLE)."</td>";
echo "<td align='left'>"._NQ_TITLE."</td><td align='left'><input type='text' name='title' value='$title' size='40'></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPISCQUIZ)."</td>";
echo "<td align='left'>"._NQ_ISCQ."</td><td align='left'><input type='checkbox'  name='iscq' $iscq></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPPRIZEDESC)."</td>";
echo "<td align='left'>"._NQ_PRIZEDESC."</td><td align='left'><input type='text' name='prize' value='$prize' size='55'></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPQSPON)."</td>";
echo "<td align='left'>"._NQ_SPONSORNAME."</td><td align='left'><input type='text' name='sponsor' value='$sponsor' size='55'></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPCAT)."</td>";
echo "<td align='left'>"._NQ_CATEGORY."</td><td align='left'><select name='sid'>";
$result = $db->sql_query("SELECT sid, secname FROM ".$prefix."_nquiz_sections");
while(list($secid, $secname) = $db->sql_fetchrow($result))
{
if ($secid==$sid) { $sel = "selected "; }
echo "<option $sel value='$secid'>$secname</option>";
$sel = "";
}
echo "</select></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPRANDOM)."</td>";
echo "<td align='left'>"._NQ_RANDOMISE."</td><td align='left'>";
$sel1 = $sel2 = $sel3 = "";
if ($random == '0') { $sel1 = " selected"; } elseif ($random == '1') { $sel2 = " selected"; } elseif ($random == '2') { $sel3 = " selected"; }
echo "<select name='randomise'>";
echo "<option value='0'$sel1>"._NQ_ORDER."</option>";
echo "<option value='1'$sel2>"._NQ_REVERSE."</option>";
echo "<option value='2'$sel3>"._NQ_RANDOM."</option>";
echo "</select></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPACTIVE)."</td>";
echo "<td align='left'>"._NQ_ACTIVATE."</td><td align='left'><input type='checkbox' name='active' $active></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPANSWER)."</td>";
echo "<td align='left'>"._NQ_SHOWANSWER."</td><td align='left'><input type='checkbox' name='view' $view></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPEMAILUSER)."</td>";
echo "<td align='left'>"._NQ_EMAILUSER."</td><td align='left'><input type='checkbox'name='emailuser' $emailuser></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPLIMIT)."</td>";
echo "<td align='left'>"._NQ_LIMIT."</td><td align='left'><input type='checkbox' name='limit' $limit></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPEMAILADMIN)."</td>";
echo "<td align='left'>"._NQ_SENDADMINEMAIL."</b></td><td align='left'><input type='checkbox' name='emailadmin' $emailadmin></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPADEMAIL)."</td>";
echo "<td align='left'>"._NQ_ADEMAIL."</td><td align='left'><input type='text'name='adminemail' value='$adminemail' size='40'></td></tr>";
if ($expire == "0"){
echo "<tr><td colspan='3' align='center'><b>"._NQ_NOEXPIRESET."</b</td></tr>";
}
else
{
$formatdate = $nq_config['dateformat'];
$date = date($formatdate,$expire);
echo "<tr><td colspan='3' align='center'><b>"._NQ_EXPIRATION."&nbsp;&nbsp;(&nbsp;$date&nbsp;)</b</td></tr>";
}
echo "<tr><td>".quizhelp_img(_NQ_HELPEXPIRES)."</td>";
echo "<td align='left'>"._NQ_EXPIRATION."</td><td align='left'>";
$xday = 1;
echo " "._NQ_DAY.": <select class='textbox' name='newday'>";
echo "<option name='day' selected>00</option>"; 
while ($xday <= 31) 
{
echo "<option name='day'>$xday</option>";
$xday++;
}
echo "</select>";
$xmonth = 1;
echo " "._NQ_MONTH.": <select class='textbox' name='newmonth'>";
echo "<option name='month' selected>00</option>"; 
while ($xmonth <= 12) 
{
echo "<option name='month'>$xmonth</option>";
$xmonth++;
}
echo "</select>";
$start_year = date ('Y');
echo " "._NQ_YEAR.": <select class='textbox' name='newyear'>";
echo "<option name='year' selected>0000</option>"; 
for ($y = $start_year; $y <=($start_year + 15); $y++)
{
echo "<option name='year'>$y</option>";
$year++;
}
echo "</select>";
echo " "._NQ_HOUR.": <select class='textbox' name='newhour'>";
$xhour = 0;
$cero = "0";
echo "<option name='hour' selected>00</option>"; 
while ($xhour <= 23) 
{
$dummy = $xhour;
if ($xhour < 10) { $xhour = "$cero$xhour"; }
echo "<option name='hour'>$xhour</option>";
$xhour = $dummy;
$xhour++;
}
echo "</select>";
echo " "._NQ_MINS.": <select class='textbox' name='newmin'>";
$xmin = 0;
echo "<option name='min' selected>00</option>";
while ($xmin <= 59) 
{
if (($xmin == 0) OR ($xmin == 5)) { $xmin = "0$xmin"; }
echo "<option name='min'>$xmin</option>";
$xmin = $xmin + 5;
}
echo "</select>";
$now = time();
$formatdate = $nq_config['dateformat'];
$now = date($formatdate,$now);
echo "</select></td></tr>";
echo "<tr><td colspan='3'><center><b>"._NQ_TNOW."</b>&nbsp;$now</center></td></tr>";
echo "</table></center>";
echo "<br><center><input type='submit' class='optionlite' value='"._NQ_SAVE."'>";
echo "</form><br><br><b><blink>&raquo;&nbsp;</blink>"._NQ_SAVECHANGESNOTE."<blink>&nbsp;&laquo;</blink></b><br><br>"._GOBACK."<br><br></center>";
CloseTable();
OpenTable();
echo "<center><table width='100%' border='0' cellpadding='2' cellspacing='2'>";
echo "<tr><th width='2%'>#</th><th width='70%'>"._NQ_QUESTION."</th><th width='5%'>"._NQ_PTS."</th><th width='14%'>"._NQ_SELFILE."</th><th width='10%'>"._NQ_OPTIONS."</th></tr>";
$qn=0;
$result = $db->sql_query("SELECT quesid, question, points, file FROM ".$prefix."_nquiz_questions WHERE qid='$qid'");
$imagesdir = $nq_config['images_directory'];
while(list($quesid, $question, $points, $quesfile) = $db->sql_fetchrow($result))
{
$qn++;
$quesfile="<img src='modules/$module_name/$imagesdir/$dir/thumbs/th_$quesfile' title='$quesfile' onMouseOver=\"self.status='$quesfile';return true\" onmouseout=\"self.status='';return true\" alt=\"$quesfile\">";
echo "<tr><td align='center' class='row1'>[$qn]</td>";
echo "<td align='left' class='row1'>$question</td><td align='center' class='row1'>$points</td>";
if ($quesfile == ""._NQ_NONE.""){echo "<td class='row1' align='center'>$quesfile</td>";}
else{
echo "<td class='row1' align='center'>$quesfile</td>";
}
echo "<td class='row1' align='center'><form method='post' action='".$admin_file.".php'>";
echo "<input type='hidden' name='file' value='admin'>";
echo "<input type='hidden' name='op' value='viewquestions'>";
echo "<input type='hidden' name='qid' value='$qid'>";
echo "<input type='hidden' name='title' value='$title'>";
echo "<input type='hidden' name='quesid' value='$quesid'>";
echo "<input type='hidden' name='quizdir' value='$dir'>";
echo "<select name='op'>";
echo "<option value='nqmodifyquestion'>"._NQ_MODIFY."</option>";
echo "<option value='nqdeletequestion'>"._NQ_DELETE."</option></select>";
echo "<br><br><input type='submit' value='"._NQ_GO."'></td>";
echo "</form>";
}
echo "</table></center><br>";
}
CloseTable();
include ('footer.php');
?>
Return current item: Nukequiz