-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.php
More file actions
72 lines (68 loc) · 1.48 KB
/
index.php
File metadata and controls
72 lines (68 loc) · 1.48 KB
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
<?php
include_once "common/connection.php";
$pageTitle = "HOME";
include_once "common/header.php";
?>
<div id="main">
<div>
<?php
if(isset($_SESSION['LoggedIn']) && isset($_SESSION['UserID'])):
?>
<form method="GET" action="createQP.php" id="create-qp-form">
<p class="actions">
<input type="submit" id="create-qp" value="Create New" class="button" />
<i class="fa fa-plus fa-lg"></i>
</p>
</form>
<?php
include_once "inc/class.questPapers.inc.php";
$questPaper = new QuestionPapers($db);
if(($result = $questPaper->getQuestionPapers()) != FALSE):
?>
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Semester</th>
<th>Exam Name</th>
<th>Subject code</th>
<th>Subject</th>
<th>Total Marks</th>
</tr>
</thead>
<tbody>
<?php
$semesters = array(
"1" => "I",
"2" => "II",
"3" => "III",
"4" => "IV",
"5" => "V",
"6" => "VI",
"7" => "VII",
"8" => "VIII"
);
foreach($result as $row)
{
echo "<tr>";
echo "<td><a href='viewPaper.php?qp_no=".$row['questPaperNo']."'>".date("d-m-Y", strtotime($row['date']))."</a></td>";
echo "<td>".$semesters[$row['semester']]."</td>";
echo "<td>".$row['examName']."</td>";
echo "<td>".$row['subjectcode']."</td>";
echo "<td>".$row['subject']."</td>";
echo "<td>".$row['totalmarks']."</td>";
echo "<tr/>";
}
?>
</tbody>
</table>
<?php
else:
echo "<p>You have not added any question papers yet.</p>";
endif;
echo "</div>";
else:
header("Location: login.php");
exit;
endif;
?>