-
Notifications
You must be signed in to change notification settings - Fork 2
/
exam-schedules-view.php
85 lines (79 loc) · 4.38 KB
/
exam-schedules-view.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
<?php include "files.php";
$exam_code=$_GET['role']; ##getting exam id
if(isset($_GET['examin_code']) & isset($_GET['examin_name'])){
$e_code=$_GET['examin_code'];
$e_name=$_GET['examin_name'];
}else{
$e_code=0;
$e_name=0;
}
?> <!--file that contains all external code -->
<div class="container-fluid vh-100 student-main-wrap">
<?php include "top-header.php"; ?> <!--top-header code file -->
<div class="row">
<?php include "sidebar.php"; ?> <!--sidebar code file -->
<!-- main section -->
<div class="col-md-10 student-home-section">
<section class="schedule-wrap">
<div class="schedule-heading">
<div class="row">
<div class="col-md-12">
<h1>Exam Schedules</h1>
</div>
</div>
</div>
<div class="schedule-details">
<table class="table table-bordered table-striped">
<tr class="bg-grad-1">
<th><i class="far fa-calendar-alt"></i> Examination</th>
<th><i class="far fa-calendar-alt"></i> Date</th>
<th><i class="far fa-calendar-alt"></i> Day</th>
<th><i class="fas fa-hourglass-start"></i> Time</th>
<th><i class="fas fa-book"></i> Exam Name</th>
<th>Action</th>
</tr>
<?php
if($_SESSION['role']=='teacher'){
$select_schedule1="SELECT * FROM exam_schedule WHERE reg_id='{$_SESSION['reg_id']}'";
$select_schedule_result1=mysqli_query($con,$select_schedule1);
if(mysqli_num_rows($select_schedule_result1)>0){
while($schedule_data=mysqli_fetch_assoc($select_schedule_result1)){
echo"
<tr>
<td>".$schedule_data['examination_name']."</td>
<td>".$schedule_data['date']."</td>
<td>".$schedule_data['day']."</td>
<td>".$schedule_data['time_from']." - ".$schedule_data['time_to']."</td>
<td>".$schedule_data['exam_name']."</td>
<td><i class='fas fa-edit'></i> | <i class='fas fa-trash-alt'></i></td>
</tr>
";
}
}
}elseif($_SESSION['role']=='student'){
$select_schedule1="SELECT * FROM exam_schedule";
$select_schedule_result1=mysqli_query($con,$select_schedule1);
if(mysqli_num_rows($select_schedule_result1)>0){
while($schedule_data=mysqli_fetch_assoc($select_schedule_result1)){
echo"
<tr>
<td>".$schedule_data['examination_name']."</td>
<td>".$schedule_data['date']."</td>
<td>".$schedule_data['day']."</td>
<td>".$schedule_data['time_from']." - ".$schedule_data['time_to']."</td>
<td>".$schedule_data['exam_name']."</td>
<td><i class='fas fa-edit'></i> | <i class='fas fa-trash-alt'></i></td>
</tr>
";
}
}
}
?>
</table>
</div>
</section>
</div>
</div>
</div>
</body>
</html>