-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewexamlist.php
75 lines (69 loc) · 2.22 KB
/
viewexamlist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
include("header.php");
if(isset($_GET[subjectcode]))
{
//subjectcode datetime
$sqldel ="DELETE FROM exam where subjectcode=$_GET[subjectcode] AND datetime=$_GET[datetime]";
$seldelresult = mysqli_query($con,$sqldel);
if(mysqli_affected_rows($con) == 1)
{
$delresult = "<font color=green><strong>Record deleted successfully..</strong></font>";
echo "<script>window.location=viewexamlist.php;</script>";
}
}
$selexam = "SELECT exam.*, subjects.*, course.* FROM course INNER JOIN subjects ON course.courseid = subjects.courseid RIGHT OUTER JOIN exam ON subjects.subjectcode = exam.subjectcode WHERE exam.datetime >= $dttim GROUP BY exam.subjectcode,exam.datetime";
$selresult = mysqli_query($con,$selexam);
?>
<div class="slider_top2">
<h2>View exam</h2>
</div>
<div class="clr"></div>
<div class="body_resize">
<div class="body">
<div class="full">
<p>
<?php
echo $delresult;
?>
<table class="tftable" width=612 border=1>
<tr>
<th width="105" scope=col> Course</th>
<th width="105" scope=col> Subject code</th>
<th width="105" scope=col> Subject</th>
<th width="170" scope=col> Datetime</th>
<th width="83" scope=col> Action</th>
<th width="83" scope=col> View Students</th>
</tr>
<?php
while($rs = mysqli_fetch_array($selresult))
{
$sqlstudentprofile = "SELECT * FROM students where regno=$rs[regno]";
$querystudentprofile = mysqli_query($con,$sqlstudentprofile);
$rsstudentprofile = mysqli_fetch_array($querystudentprofile);
echo "
<tr>
<td> $rs[coursename]</td>
<td> $rs[subjectcode]</td>
<td> $rs[subjectname]</td>
<td> " . date("d-M-Y h:i A",strtotime($rs[datetime])) ."</td>
<td> <a href=viewexamlist.php?subjectcode=$rs[subjectcode]&datetime=$rs[datetime]>Delete</a></td>
<td> <a href=viewexam.php?subjectcode=$rs[subjectcode]&datetime=$rs[datetime]>View students</a></td>
</tr>
";
}
?>
</table>
<p> </p>
<p> </p>
</div>
<div class="right">
<?php
include("usersidebar.php");
?>
</div>
<div class="clr"></div>
</div>
</div>
<?php
include("footer.php");
?>