-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimetable.php
68 lines (67 loc) · 1.52 KB
/
timetable.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
<?php
ob_start();
require("config.php");
include("sidebar.php");
?>
<!-- right side content -->
<div class="container">
<div class="row mb-1 mx-0">
<div class="col-sm-3 col-md-4">
<h2>Timetable:-</h2>
</div>
</div>
<div class="table-responsive">
<table class="display table" id="datatable">
<thead>
<tr>
<th>#</th>
<th>Batch</th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<tbody>
<?php
$string = "SELECT * FROM `timetable` WHERE D_flag=0";
$temp = $sql->query($string);
$i=1;
while ($demo = $temp->fetch_row()) {
?>
<tr>
<td><?php echo "$i"; ?></td>
<td><?php
$str = "SELECT B_name FROM batch WHERE B_ID=$demo[1] AND D_flag=0";
$tmp = $sql->query($str);
if($dem = $tmp->fetch_row()){
echo "$dem[0]";
} ?></td>
<td><?php echo "$demo[2] - $demo[3]"; ?></td>
<td><?php echo "$demo[4] - $demo[5]"; ?></td>
<td><?php echo "$demo[6] - $demo[7]"; ?></td>
<td><?php echo "$demo[8] - $demo[9]"; ?></td>
<td><?php echo "$demo[10] - $demo[11]"; ?></td>
<td><?php echo "$demo[12] - $demo[13]"; ?></td>
<td><?php echo "$demo[14] - $demo[15]"; ?></td>
</tr>
<?php
$i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(e){
$('#timetable , #dbatch').toggleClass('active');
$('#datatable').DataTable();
});
</script>
</body>
</html>