Repository navigation
Expand file tree
/
Copy pathlayout.php
More file actions
98 lines (97 loc) · 2.54 KB
/
Copy pathlayout.php
File metadata and controls
98 lines (97 loc) · 2.54 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.oc {
margin:0;
padding:0;
background-image:url('images/seatoccupied.png');
width:33px;
height:26px;
border:none;
text-align:center;
line-height:26px;
font-family:Helvetica;
font-size:16px;
font-weight:bold;
}
.oc a, a:link, a:hover {
color: black;
text-decoration: none;
}
.emp {
margin:0;
padding:1px;
background-image:url('http://demo.techbrij.com/780/images/available_seat_img.gif');
width:33px;
height:26px;
border:none;
line-height:26px;
font-family:Helvetica;
font-size:16px;
font-weight:bold;
color: black;
text-decoration: none;
}
.emp a, a:link, a:hover{
color: black;
text-decoration: none;
}
.non {
margin:0;
padding:0;
width:33px;
height:26px;
border:none;
text-align:center;
color: white;
text-decoration: none;
}
</style>
</head>
<body>
<?php
/*//Query for booked seats
$k = array();
$sql ="SELECT seatnumber FROM bookedseat where busnumber = :busnumber";
$query = $PDO->prepare($sql);
$query->bindParam(":busnumber", $b_id);
$query->execute();
while($row = $query->fetch(PDO::FETCH_ASSOC)){
$k[] = $row['seatnumber'];
}*/
?>
<?php
$ais = array("A","B","E","C","D");
$aisle = array("E1","E2","E3","E4","E5","E6","E7","E8","E9");
$seatnumbers = array(
"A1" => "1","A2" => "5","A3" => "9","A4" => "13","A5" => "17","A6" => "21","A7" => "25","A8" => "29","A9" => "33","A10" => "37",
"B1" => "2","B2" => "6","B3" => "10","B4" => "14","B5" => "18","B6" => "22","B7" => "26","B8" => "30","B9" => "34","B10" => "38",
"E1" => " ","E2" => " ","E3" => " ","E4" => " ","E5" => " ","E6" => " ","E7" => " ","E8" => " ","E9" => " ","E10" => "39",
"C1" => "3","C2" => "7","C3" => "11","C4" => "15","C5" => "19","C6" => "23","C7" => "27","C8" => "31","C9" => "35","C10" => "40",
"D1" => "4","D2" => "8","D3" => "12","D4" => "16","D5" => "20","D6" => "24","D7" => "28","D8" => "32","D9" => "36","D10" => "41");
echo "<table border=0 cellpadding=0 cellspacing=0>";
foreach($ais as $i){
echo "<tr>";
for($r=1;$r<=10;$r++){
$seat = $i.$r;
$setnum = $seatnumbers[$seat];
if(in_array($seat,$k)){
$bg = " class='oc'";
}elseif(!in_array($seat,$aisle)){
$bg = " class='emp'";
}else{
$bg = " class='non'";
}
if(is_numeric($setnum)){
echo "<td" . $bg . "><a href=?seatnum=" . $setnum . ">" . $setnum . "</a></td>";
}else{
echo "<td" . $bg . ">" . $setnum . "</td>";
}
}
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>