[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: give_exam.php
<?php include("header.php"); ?> <!-- // Header include --> <script src="js/jquery-1.11.1.min.js"></script> <link rel="stylesheet" href="admin@/compiled/flipclock.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="admin@/compiled/flipclock.js"></script> <!-- Banner Slider --> <div class="banner-inner" style="height: auto;"> <img src="images/profilebg.png" class="profile-inner" alt=" inner-banner" /> <div class="dec"> <div class="container"> <ul> <li><a href="index.php">Home</a></li> <li><a href="give_exam.php" class="active"> Give Exam</a></li> </ul> <h1>Give Online Exam</h1> </div> </div> </div> <!-- // Banner Slider --> <script type="text/javascript"> window.addEventListener("beforeunload", function (e) { $.ajax({ url: 'logout_closed.php', type: 'POST', async: false, timeout: 4000 }); }) </script> <?php function hoursToSecods($hours) { // $hour must be a string type: "HH:mm:ss" // echo $hours; $parse = array(); if (!preg_match ('#^(?<hours>[\d]{2}):(?<mins>[\d]{2}):(?<secs>[\d]{2})$#',$hours,$parse)) { // Throw error, exception, etc throw new RuntimeException ("Hour Format not valid"); } return (int) $parse['hours'] * 3600 + (int) $parse['mins'] * 60 + (int) $parse['secs']; } $hours="00:10:00"; $duration = hoursToSecods($hours); //echo $duration; ?> <input type="hidden" id="time" value="<?=$duration?>"> <?php $stmt1=$show->readwithdata('paper_details','paper_id','PAPER119'); while($row1=$stmt1->fetch(PDO::FETCH_ASSOC)){ $time=$row1['exam_timing']; $paper_name=$row1['paper_name']; } ?> <div class="giveexam" style=""> <div class="home-title" style=""> <h2> Exam [ <span> LIVE </span> ]</h2> <h6><?=$paper_name?></h6> </div> <div class="container"> <div class="giveexam-box" style=""> <h5>Exam Time : <b>20 minutes </b></h5> <h3 title="paper_name">Banking General Awareness </h3> <h4>Please dont refresh the page the exam will be over</h4> <div class="clock" style="margin:2em;"></div> <div class="message"></div> <script type="text/javascript"> var clock; $(document).ready(function() { var time=$('#time').val(); // alert(time); clock = $('.clock').FlipClock(time, { clockFace: 'HourlyCounter', countdown: true, callbacks: { stop: function() { //$('.message').html('The clock has stopped!'); alert('Yor time is up'); window.location.href='thank.php'; } } }); }); </script> <div class="giveexam-paper" style=""> <form method="post" > <?php $count=1; $stmt=$show->readwithdata('papers','paper_id','PAPER119'); $num=$stmt->rowCount(); if($num>0){ while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ ?> <span class="question"><b><?=$count?>.</b> <?=htmlspecialchars_decode($row['question'])?></span> <p class="ans"> <label><input type="radio" name="option<?=$count?>[]" value="<?=$row['option1']?>"><?=$row['option1']?></label> <label><input type="radio" name="option<?=$count?>[]" value="<?=$row['option2']?>"><?=$row['option2']?></label> <label><input type="radio" name="option<?=$count?>[]" value="<?=$row['option3']?>"><?=$row['option3']?></label> <label><input type="radio" name="option<?=$count?>[]" value="<?=$row['option4']?>"><?=$row['option4']?></label> <input type="hidden" name="question<?=$count?>[]" value="<?=$row['question']?>"> <input type="hidden" name="answer<?=$count?>[]" value="<?=$row['answer']?>"> <input type="hidden" name="qid<?=$count?>[]" value="<?=$row['qid']?>"> </p> <?php ++$count; } }?> <input type="hidden" name="user_id" value="USR104"> <input type="hidden" name="paper_id" value="PAPER119"> <input type="hidden" name="no_of_question" value="5"> <input type="hidden" name="total" value="5"> <input type="hidden" name="name" value="P Das"> <input type="hidden" name="email" value="p@gmail.com"> <input type="hidden" name="phone" value="9874615676"> <input type="submit" name="sub" value="End Exam" class="ans-submit"> </form> <?php if(isset($_POST['sub'])){ /// echo '111111'; $count=1;$total=0; $eid=$show->getid('ids','EXM'); $stmt=$show->readwithdata('papers','paper_id','PAPER119'); while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ $option="option".$count; //echo $option; foreach($_POST[$option] as $key=>$value){ if($value==$_POST['answer'.$count][$key]){ $marks=1; $total +=$marks; }else $marks=0; $data=array( 'paper_id'=>$_POST['paper_id'], 'user_id'=>htmlspecialchars($_POST['user_id']), 'question_id'=>htmlspecialchars($_POST['qid'.$count][$key]), 'given'=>htmlspecialchars($value), 'answer'=>htmlspecialchars($_POST['answer'.$count][$key]), 'exam_id'=>$eid, 'marks'=>$marks, ); // print_r($data); $r1=$show->insert('exam_score',$data); } echo $total; /* if($r1){ echo '<script> setTimeout(function() { swal({ title: "Thank You!", text: "paper has been added", type: "success" }, function() { window.location = "all_papers_new.php"; }); }, 1000); </script>'; } */ ++$count;} $data1=array( 'paper_id'=>$_POST['paper_id'], 'user_id'=>$_POST['user_id'], 'name'=>$_POST['name'], 'email'=>$_POST['email'], 'phone'=>$_POST['phone'], 'exam_id'=>$eid, 'total'=>$_POST['total'], 'answered'=>$total, ); $r11=$show->insert('result',$data1); } ?> </div> </div> </div> </div> <!-- Header include --> <?php include("footer.php"); ?> <!-- // Header include -->
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.72 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619