$result = $db->query_database($query); if (is_null($result)) { // query failed echo "query failed"; } else { redirect_to("question_list.php?test_name=" . get_test_name()); } } else { echo "empty fields"; } } else { echo "Someting was not set"; } } else { $db = new DB_CONNECT(); $query = "SELECT * FROM test WHERE test_name='" . get_test_name() . "' AND username='******' "; $details = $db->query_database($query); if ($db->number_of_rows($details) > 0) { $i = 1; $row = $db->fetch_array($details); $table_data = array(); $table_data["test_name"] = $row["test_name"]; $table_data["start_time"] = $row["start_time"]; $table_data["end_time"] = $row["end_time"]; $table_data["event_date"] = $row["event_date"]; $table_data["duration"] = $row["duration"]; } } ?> <!DOCTYPE html>
<div> <span class="hours"></span> <div class="smalltext">Hours</div> </div> <div> <span class="minutes"></span> <div class="smalltext">Minutes</div> </div> <div> <span class="seconds"></span> <div class="smalltext">Seconds</div> </div> </div> </div> <span class="pull-right spaceButton "><input id="submit_test" type="submit" name="btnSubmit" onclick="return confirm('Are you sure? You want to submit Test :) ')" value="Submit" class="btn btn-success"></span> </div> </div> </div> </form> <script type="text/javascript" src="js/countdown.js"></script> <script type="text/javascript"> var test_name_header=document.getElementById('test_name_header'); test_name_header.innerHTML="<?php echo get_test_name(); ?> "; </script> </body> </html>
require_once '../includes/config.php'; require_once '../includes/functions.php'; require_once '../includes/session.php'; if (!isset($_SESSION['test_name'])) { set_error_message(TEST_NAME_NOT_FOUND); redirect_to("../tests/error.php"); } if (isset($_POST["register"])) { if (check_empty($_POST)) { $first_name = $db->mysql_prep(trim($_POST['first_name'])); $last_name = $db->mysql_prep(trim($_POST['last_name'])); $email = $db->mysql_prep(trim($_POST['email'])); // email check is not made yet // also check the email id doesnot exit there... :P $phone_number = $db->mysql_prep(trim($_POST['phone_number'])); $user_test_table = get_test_name() . "_users"; $query = "Insert into " . $user_test_table . " (first_name, last_name, email, phone_number) " . " values('{$first_name}', '{$last_name}', '{$email}', '{$phone_number}')"; $result = $db->query_database($query); if (!is_null($result)) { set_test_username($email); redirect_to("rules_regulations.php"); } else { redirect_to("user_registration.php?message=true"); } } else { //echo "empty fields"; } } ?> <!DOCTYPE html>