Viewing file: onedayexam.php (9.24 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); ?> <?php include('session.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Student Login Panel </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type='text/javascript'> $(document).ready(function(){ $("img.a").hover( function() { $(this).stop().animate({"opacity": "0"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); });
}); </script> <?php // Set the time zone to your desired location date_default_timezone_set('Your/Timezone'); // Get the current time $current_time = date('H:i'); // Set the target time $target_time = $exam_start_time; // Compare the current time with the target time if ($current_time === $target_time) { echo "Welcome your time is start now"; } else { } ?> <style type="text/css"> table { border: 0px solid green; border-collapse: collapse; width:100%; }
table td { border: 0px solid green; }
table td.shrink { white-space:nowrap } table td.expand { width: 99% } </style> <title>Online Exam</title> <style> #timer { color: red; } </style> <style> /* Style for the fixed position timer */ #timer { position: fixed; top: 0; left: 0; width: 100%; background-color: #f0f0f0; padding: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); z-index: 1000; /* Ensure the timer stays on top of other elements */ }
/* Style for the content below the timer */ body { margin-top: 50px; /* Add margin to the top of the body to avoid overlap with the fixed timer */ padding: 20px; font-family: Arial, sans-serif; } </style> </head> <body class="w3-container"> <table > <tr> <td colspan="2"> <table width="945" border="0"> <tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('menubar/menubar.php'); ?></td> </tr> <tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('sessionbar.php'); ?></td> </tr> </table> </td> </tr> <tr> <td colspan="2" align="center">
<script> // Set the countdown duration in seconds (45 minutes = 45 * 60 seconds) let countdownDuration = 60 * 60;
// Function to update the timer display function updateTimer() { const timerElement = document.getElementById('timer'); const minutes = Math.floor(countdownDuration / 60); const seconds = countdownDuration % 60; timerElement.textContent = `Time Remaining: ${minutes.toString().padStart(2, '0')}m ${seconds.toString().padStart(2, '0')}s`;
// Check if the countdown has reached zero if (countdownDuration === 0) { clearInterval(timerInterval); // Stop the timer document.getElementById('submitBtn').click(); // Auto-submit the form } else { countdownDuration--; // Decrement the countdown duration } }
// Update the timer display every second const timerInterval = setInterval(updateTimer, 1000); </script> <?php $keywords = $user;
/* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php'; // Attempt select query execution $sql = "SELECT * FROM admission where enrollment='$user'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)){ $roll_no= $row['enrollment']; $name= $row['name']; $batch_name= $row['batchNo']; } // Free result set mysqli_free_result($result); } else{ echo "No records matching your query were found."; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link);
?> <div id="timer"></div> <form id="form1" name="form1" action="calcultor.php" method="post" enctype="multipart/form-datas"> <b><h3>ITCE Exam Center </h3><b>
<table width="100%" border="0"> <tr> <td align="left" bgcolor="#66CCFF">Student Name: </td> <td colspan="5" align="left" bgcolor="#66CCFF"> <input name="stdname" type="text" id="stdname" tabindex="1" size="20" maxlength="20" required="required" value='<?php echo $name ?>' /> </td> </tr> <tr> <td align="left" bgcolor="#66CCFF">Batch Name</td> <td colspan="5" align="left" bgcolor="#66CCFF"><input name="classes" type="text" id="classes" size="10" maxlength="80" required="required" value='<?php echo $batch_name ?>' readonly /> </td> </tr>
<tr> <td align="left" bgcolor="#66CCFF">Roll No</td> <td colspan="5" align="left" bgcolor="#66CCFF"><input name="rollno" type="text" id="rollno" size="40" maxlength="80" required="required" value='<?php echo $roll_no ?>' /> </td> </tr> </table> <script> <!--
/* Count down then redirect script By JavaScript Kit (http://javascriptkit.com) Over 400+ free scripts here! */
//change below target URL to your own var targetURL="http://amitprabha.in/calcultor.php" //change the second to start counting down from var countdownfrom=3600
var currentsecond=document.redirect.redirect2.value=countdownfrom+1 function countredirect(){ if (currentsecond!=1){ currentsecond-=1 document.redirect.redirect2.value=currentsecond } else{ window.location=targetURL return } setTimeout("countredirect()",1000) }
countredirect() //--> </script> <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php';
$var = $coursename ; $trimmed = trim($var); // Attempt select query execution $sql = "select * from PERMISSION_EXAM "; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_array($result)){ $PAPER_CODE=$row['PAPER_CODE']; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "Sorry, Not Available any Question"; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?>
<?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'root' with no password) */ include 'connect.php';
$var = $coursename ; $trimmed = trim($var); // Attempt select query execution $sql = "select * from question_set_paper WHERE paper_set='$PAPER_CODE' order by RAND () LIMIT 100 "; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_array($result)){ $answer=$row['correctanswer']; $srno=$srno+1;
echo "<table cellpadding=\"2\" style=\"width: 100%\">\n"; echo " <tr>\n"; echo " <td style=\"width: 350px\">$srno-$row[question]</td>\n"; echo " <td>\n"; echo " <table style=\"width: 100%\">\n"; echo " <tr>\n"; echo " <td style=\"width: 28px\"><input type=\"radio\" name='radiocount[$srno]' id=\"radiocount[$srno]\" value='a' /> </td>\n"; echo " <td>$row[wronganswer1] </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td style=\"width: 28px\"><input type=\"radio\" name='radiocount[$srno]' id=\"radiocount[$srno]\" value='b' /></td>\n"; echo " <td> $row[wronganswer2]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td style=\"width: 28px\"><input type=\"radio\" name=\"radiocount[$srno]\" id=\"radiocount[$srno]\" value='c' /> </td>\n"; echo " <td>$row[wronganswer3]</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td style=\"width: 28px\"> <input type=\"radio\" name=\"radiocount[$srno]\" id=\"radiocount[$srno]\" value='d' /></td>\n"; echo " <td>$row[wronganswer4]</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo "</table>\n"; echo " <span style=\"font-size:12pt; font-family:Arial, Helvetica, sans-serif; color:#000000; \">
<input type=\"hidden\" name='cans[$srno]' id=\"cans[$srno]\" value=\"$row[correctanswer]\" /> <input type=\"hidden\" name='countss' id=\"countss\" value='$srno' /> <input type=\"hidden\" name='rollnos' id=\"countss\" value='$rollnoss' /> </span>\n";
echo "<hr></hr>"; echo "<br>"; } echo "</table>"; // Free result set mysqli_free_result($result); } else{ echo "SORRY,NOT ALLOW ANY PAPER "; } } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connection mysqli_close($link); ?> <br><br><br> <center> <input name="submit" type="submit" id="submitBtn"> </center> </form> </td> </tr> </table>
<br><br><br> <tr> <td colspan="2" bgcolor="#CCCCCC"><?php include('footer/footer.php'); ?></td> </tr>
</table>
</body></center> </html>
|