forked from sushil11-art/Exam-Hall-Seating-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewSeatPlan.php
81 lines (68 loc) · 2.68 KB
/
viewSeatPlan.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
<?php
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "dbphp";
$con = mysqli_connect($host,$dbusername,$dbpassword,$dbname);
if (!$con) {
# code...
die("connection fail....".mysqli_connect_error());
}
$MAXid="SELECT MAX( id ) as 'maxid' FROM `room`";
$resultMAXid= mysqli_query($con,$MAXid);
$rowMAXid=mysqli_fetch_array($resultMAXid);
$idMAX=$rowMAXid['maxid'];
$sql="SELECT * FROM `seatplan`";
$result= mysqli_query($con,$sql);
$row=mysqli_num_rows($result);
if ($row>0) {
?>
<table border="1">
<tr><b>
<th class="th">Block</th>
<th class="th">Room</th>
<th class="th">Semester</th>
<th class="th">Subject</th>
<th class="th">Dep1</th>
<th class="th">StartRoll</th>
<th class="th">EndRoll</th>
<th class="th">Dep2</th>
<th class="th">StartRoll</th>
<th class="th">EndRoll</th>
</b>
</tr>
<?php
while($row = mysqli_fetch_array($result)){
$i=$row['id'];
$block=$row['block'];
$room=$row['roomno'];
$sem=$row['sem'];
$dep1=$row['dep1'];
$start1=$row['start1'];
$end1=$row['end1'];
$dep2=$row['dep2'];
$start2=$row['start2'];
$end2=$row['end2'];
$sub=$row['sub'];
// ---------------------------------------------------------------------
?>
<tr>
<td><?php echo $block; ?></td>
<td onclick="viewRoom(<?php echo $room; ?>)" > <?php echo $room; ?> </td>
<td><?php echo $sem; ?></td>
<td><?php echo $sub; ?></td>
<td><?php echo $dep1; ?></td>
<td><?php echo $start1; ?></td>
<td><?php echo $end1; ?></td>
<td><?php echo $dep2; ?></td>
<td><?php echo $start2; ?></td>
<td><?php echo $end2; ?></td>
</tr>
<?php
// ---------------------------------------------------------------------
}
?>
</table>
<?php
}
?>