-
Notifications
You must be signed in to change notification settings - Fork 1
/
examlist.php
100 lines (91 loc) · 3.77 KB
/
examlist.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include_once "header.php";
?>
<section id="examlist">
<div class="container obls_margin obls_border">
<div class="row">
<div class="col-md-6 examlistpad">
<span style="font-size:24px;">Exams</span>
</div>
<?php
if(!Session::get("checkusertype")){
?>
<div class="col-md-6 text-right examlistpad">
<div class="">
<a href="createexam.php" class="btn btn-primary">Create new Exam</a>
</div>
</div>
<?php } ?>
</div>
<div class="row" id="postdetails">
<div class="col-md-12" style="padding:20px;">
<?php
//delete exam
// if (isset($_GET['delex'])){
// $delid = $_GET['delex'] ;
// $delete = $ex->daleteExam($delid);
// if ($delete) {
// echo "<p class='success'>Exam successfully deleted !</p>";
// }else{
// echo "<p class='error'>Not deleted !</p>";
// }
// }
?>
<table class="table table-hover exlisttable" style="background:#fff">
<thead>
<tr>
<th>SL</th>
<th><i class="fa fa-arrows-v" aria-hidden="true"></i> Date Created</th>
<th>Exam title</th>
<th>Subject</th>
<th>Total Questions</th>
<th>Created by</th>
<th><i class="fa fa-bars" aria-hidden="true"></i> Action</th>
</tr>
</thead>
<tbody>
<?php
$i=0;
$getex= $ex->getAllExam();
if ($getex) {
while ($row = $getex->fetch_assoc()) {
$i++;
$gettotal = $ex->getQuestionByExam($row['id']);
?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $fm->formatDate($row['edate']);?></td>
<td><strong><a href="#"><?php echo $row['name'];?></a></strong></td>
<td><?php echo $row['subject'];?></td>
<td><?php echo $gettotal; ?></td>
<td><?php echo $row['author'];?></td>
<td>
<div class="left_pad">
<?php
if(Session::get("checkusertype")){
?>
<a href="starttest.php?exid=<?php echo $row['id'];?>" class="btn btn-danger">Start Test</a>
<?php
}else{
?>
<!-- <a href="?delex=<?php //echo $row['id'];?>" class="btn btn-danger">Delete</a> -->
<a href="questionlist.php?viewex=<?php echo $row['id'];?>" class="btn btn-info">View</a>
<?php } ?>
</div>
</td>
</tr>
<?php
}
}else{
echo '<tr><td class="error" colspan="5">nothing found !</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</section>
<?php
include_once "footer.php";
?>