-
Notifications
You must be signed in to change notification settings - Fork 1
/
Reservation per location.php
42 lines (36 loc) · 1.32 KB
/
Reservation per location.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
<html>
<head>
<title>Reservation Report </title>
</head>
<body>
<?php
include ('connection.php');
$query = "SELECT Reservation_has_room.Location, COUNT(*) AS Num FROM Reservation_has_room NATURAL JOIN Reservation WHERE month(Reservation.End_date) = '12' GROUP BY Reservation_has_room.Location";
$result = mysql_query($query);
echo "<table border = '5'>";
echo "<tr> <th COLSPAN='3'> Reservation Report</th> </tr>";
echo "<tr><th> Month</th><th>Location</th><th>Num</th></tr>";
echo "<th ROWSPAN='5'>Agust</th>";
while($row = mysql_fetch_assoc(($result))) {
echo "<tr>";
echo "<td>". $row['Location'] . "</tb>";
echo "<td>". $row['Num'] . "</tb>";
echo "</tr>";
}
//echo "</table>";
$query = "SELECT Reservation_has_room.Location, COUNT(*) AS Num FROM Reservation_has_room NATURAL JOIN Reservation WHERE month(Reservation.End_date) = '12' GROUP BY Reservation_has_room.Location";
$result = mysql_query($query);
//echo "December";
//echo "<table border = '5'><tr><th>Location</th><th>Num</th></tr>";
echo "<tr><th ROWSPAN='5'>Septemper</th>";
while($row = mysql_fetch_assoc($result)) {
echo "<tr>";
echo "<td>". $row['Location'] . "</tb>";
echo "<td>". $row['Num'] . "</tb>";
echo "</tr>";
}
echo "</table>";
mysql_close($db_server);
?>
</body>
</html>