Guest User

Untitled

a guest
Oct 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.52 KB | None | 0 0
  1. <?php
  2. include "./includes/timerhead.php";
  3. include "./includes/conn.php";
  4. include "./includes/includes.php";
  5. include "./includes/nocache.php";
  6. include "./includes/validation.php";
  7.  
  8. session_start();
  9. if ($_SESSION['loggedInTest']=="1") {
  10.     redirect_to("userArea.php");
  11.     exit;
  12. }
  13.  
  14.  
  15.  
  16.  
  17.  
  18. ?>
  19. <html><!-- InstanceBegin template="/Templates/Test%20Layout.dwt.php" codeOutsideHTMLIsLocked="false" -->
  20.  
  21. <head>
  22. <link href="includes/wtstyle.css" rel="stylesheet"  type="text/css">
  23. <?
  24. // Copyright (C) 2003 - 2007 Eppler Software.  All rights reserved.
  25. // Any redistribution or reproduction of any materials herein is strictly prohibited.
  26. ?>
  27. <!-- InstanceBeginEditable name="doctitle" -->
  28. <title><?php echo (TITLE);?></title>
  29. <!-- InstanceEndEditable -->
  30. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  31. <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
  32. <style type="text/css">
  33. input.next
  34. {
  35.   margin-top       : 1.6em;
  36.   float            : right;
  37. }
  38. .t {background: url(images/dot.gif) 0 0 repeat-x; width: 20em}
  39. .b {background: url(images/dot.gif) 0 100% repeat-x}
  40. .l {background: url(images/dot.gif) 0 0 repeat-y}
  41. .r {background: url(images/dot.gif) 100% 0 repeat-y}
  42. .bl {background: url(images/bl.gif) 0 100% no-repeat}
  43. .br {background: url(images/br.gif) 100% 100% no-repeat}
  44. .tl {background: url(images/tl.gif) 0 0 no-repeat}
  45. .tr {background: url(images/tr.gif) 100% 0 no-repeat; padding:10px}
  46. p {font-family: sans-serif; text-align:left}
  47. <?php
  48. if (DISABLE_PRINT) {  ?>
  49. @media print {
  50. body {display:none}
  51. <?php
  52. }
  53. ?>
  54. }
  55.  
  56. </style>
  57. </head>
  58. <?php
  59.       if (IPSESSIONS) {
  60.         $strSQL="SELECT * FROM Sessions WHERE IP='" . $ip . "'";
  61.       } else {
  62.         $strSQL="SELECT * FROM Sessions WHERE ID='" . $sessID . "'";
  63.       }
  64.       // $strSQL="SELECT * From Sessions WHERE IP='" . $ip . "'";
  65.       $result=mysql_query($strSQL, $conn)
  66.         or $myVar=true;
  67.      
  68.       if (!isset($myVar)) {
  69.           $num_records=mysql_num_rows($result);
  70.           $row=mysql_fetch_array($result);
  71.           if ($num_records == 0) {
  72.             $myVar = true;
  73.           } else {
  74.             $myVar = false;
  75.           }
  76.       }
  77.  
  78. ?>
  79. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="<?=BGCOLOR?>">
  80. <?php
  81. include "./includes/top.php";
  82. ?>
  83. <div align="center">
  84.   <table width="100%" border="0" cellpadding="2" cellspacing="0">
  85.     <tr>
  86.       <td height="47" align="left" valign="middle"><img src="images/webtestertop.gif" width="<?=LOGOW?>" height="<?=LOGOH?>">
  87.         <br>        
  88.       </td>
  89.       <td align="center" valign="middle">
  90.                 <?php if (!$myVar) { ?>
  91.          
  92.         <div class="t"><div class="b"><div class="l"><div class="r"><div class="bl"><div class="br"><div class="tl">
  93.           <div class="tr"><font face="Arial, Helvetica, sans-serif"><?php echo($row['FirstName'] . $myVar . " " . $row['LastName']) ?><br>
  94.             <?php } ?>
  95.         <?php
  96.  if ($myVar != 1) {
  97.     if ($row['TestName'] != "") {
  98.  ?>
  99.         <?=$row['TestName']?><br>
  100.         <div id="countdowncontainer"></div>
  101.         <?
  102.         if ($row['AllowQuit']) {
  103.             if (!$row['review'] and !$quit) {
  104.         ?>
  105.         <div id="quit"><a href="./quitTest.php">Quit</a></div>
  106.         <?      }
  107.             }?>
  108.         </font>
  109.         </div></div></div></div></div></div></div></div>
  110.         <?php
  111.  }
  112. }
  113. ?>
  114. </td>
  115.     </tr>
  116.     <tr>
  117.       <td colspan="2" align="left" valign="top"> <div class="hr">
  118.         <hr />
  119.       </div>      
  120.         <!-- InstanceBeginEditable name="Content Area" -->
  121.       <?php
  122.       $prefSQL="SELECT * FROM Preferences";
  123.       $prefResult=mysql_query($prefSQL, $conn);
  124.       $prefs=mysql_fetch_assoc($prefResult);
  125.       if ($prefs['AllowBrowse']) {
  126.         if (!isset($_REQUEST['subject'])) {
  127.             $strSQL="SELECT * FROM Tests WHERE Enabled=1 AND Browseable=1 ORDER by TestName";
  128.         } else {
  129.             $strSQL="SELECT * FROM Tests WHERE Enabled=1 AND Subject='" . $_REQUEST['subject'] . "'";
  130.         }
  131.       $result=mysql_query($strSQL, $conn);
  132.       $num_rows=mysql_num_rows($result);
  133.       ?>
  134.       <script language="javascript" type="text/javascript" src="includes/tableH.js"></script>
  135.         <?=$prefs['WelcomeMessage']?>
  136.         <!-- <table width="100%"  border="0" cellspacing="2" cellpadding="0">
  137.           <tr bgcolor="#EBEBEB">
  138.             <td class="style1 style5"><?=$num_rows?> Tests/Quizzes</td>
  139.           </tr>
  140.         </table>
  141.         -->
  142.         <table class="style1 style5" width="100%"  border="0" cellspacing="2" cellpadding="0" onMouseOut="javascript:highlightTableRowVersionA(0);">
  143.   <tr bgcolor="#C8D8FF">
  144.     <td>Name</td>
  145.     <td width="240">Subject</td>
  146.   </tr>
  147.   <?php
  148.             if ($num_rows != 0) {
  149.                 while($row = mysql_fetch_assoc($result)) {
  150.                 $i++;
  151.             ?>
  152.               <tr class="d<?=$i & 1?>" onMouseOver="javascript:highlightTableRowVersionA(this, '#FFFF99');">
  153.               <td class="pointer" onClick="document.location.href='go.php?testID=<?=$row['ID']?>';"><a class="pointer" href="go.php?testID=<?=$row['ID']?>"><?=$row['TestName']?></a></td>
  154.               <?php
  155.               $subjectSQL="SELECT Name FROM Subjects WHERE ID=" . $row['Subject'];
  156.               $subjectResult=mysql_query($subjectSQL, $conn);
  157.               $subject=mysql_fetch_assoc($subjectResult);
  158.               ?>
  159.               <td><?=$subject['Name']?></td></tr>
  160.              <?php
  161.              }
  162.             }
  163.             ?>
  164. </table>
  165. <?php
  166. } else {
  167. ?>
  168. <span class="style1">Browsing is not enabled.</span><?php
  169. }
  170. ?>
  171.         <!-- InstanceEndEditable -->      </td>
  172.     </tr>
  173.     <tr>
  174.       <td colspan="2" align="center" valign="top">
  175.         <div align="center">
  176.         <div class="hr"><hr /></div>
  177.           <?php include "./includes/copyright.php" ?></div></td>
  178.     </tr>
  179.   </table>
  180. </div>
  181. </body>
  182. <!-- InstanceEnd --></html>
Add Comment
Please, Sign In to add comment