-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_tt_lecturer.php
87 lines (86 loc) · 2.99 KB
/
print_tt_lecturer.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
<?php
session_start();
if(isset($_SESSION['semester'])){
$semester=$_SESSION['semester'];
include'db_conn.php'; }
?>
<style>
table{
width: 100%;
}
table,tr,td,th{
border: 2px black solid;
border-collapse: collapse;
font-weight: bold;
font-size: 100%;
}
td,th{
padding: 10px;
}
</style>
<div id="forTable" class="dt-responsive table-responsive">
<table>
<thead>
<th>#</th>
<th>Surname</th>
<th>Days</th>
<th>Time</th>
<th>Venue</th>
<th>Level</th>
<th>Class</th>
</thead>
<tbody >
<?php
$sn =0;
include'db_conn.php';
$query= mysqli_query($db, "select * from vw_lecture_schedule_full where lecturer_id ='".$_GET['lecturerId']."'");
while($lecture = $query -> fetch_assoc()){
$lects= explode(',', $lecture['combined_list']);
$sn++;
?>
<tr>
<td><?php echo $sn; ?></td>
<td><?php echo $lecture['surname']; ?></td>
<td><?php
if($lecture['day']==1){
echo "Saturday";
}elseif ($lecture['day']==2) {
echo "Friday";
}else{
echo "Thursday";
}
?>
</td>
<td><?php echo $lecture['start_time']." - ".$lecture['end_time']; ?></td>
<td><?php echo $lecture['venue_name']; ?></td>
<td><?php echo $lecture['level_name']; ?></td>
<td>
<?php
$view= " ";
foreach($lects as $val){
$course=mysqli_fetch_assoc(mysqli_query($db, "select * from vw_full_course where course_id=(select course_id from lecture where lecture_id=".$val.")"));
$dept=mysqli_fetch_assoc(mysqli_query($db, "select * from vw_full_course where department_id=".$course['department_id']));
$level=mysqli_fetch_assoc(mysqli_query($db, "select * from vw_full_course where level_id=".$course['level_id']));
$view.=$course['course_code'].'('.$dept['dept_code'].'), ';
}
echo substr($view, 0, -2);
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div>
<button onclick="goBack()" style="color: white; background: blue; padding: 10px 20px; margin-top: 10px; border:none; border-radius: 5px;">Go to Previous Page</button>
</div>
</div>
<?php include'footer_view.php'; ?>
<script>
function goBack(){
history.back();
}
$(function(e){
print();
//window.location.replace("view_lecturer_timetable.php");
})
</script>