-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistOfOrder.php
95 lines (82 loc) · 2.78 KB
/
listOfOrder.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
88
89
<!DOCTYPE HTML>
<html dir=RTL>
<head>
<meta charset="UTF-8">
<title>מערכת לניהול אירועים</title>
<link rel="stylesheet" type="text/css" href="include/cssstyle.css">
<script language="JavaScript" src="include/javascript.js"></script>
</head>
<body onLoad=mark()>
<script>document.write(header)</script>
<div id="wrapper">
<main>
<h2>רשימת הזמנות שבוצעו</h2>
<button class="buttonSquare" onclick=location.href="changeSizeOfEvent.php">שינויים בגודל האירוע</button>
<section id="tableContainer">
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "reservvationmanager";
$conn = mysqli_connect($servername, $username, $password, $dbname); // Create connection
if (!$conn) // Check connection
{
die("Connection failed: " . mysqli_connect_error());
}
$sql = "SELECT
reservation.Reservation_Code,
reservation.Reservation_Date,
reservation.Invoice_code,
reservation.Size_of_the_event,
custemer.Id,
custemer.full_name,
custemer.phone,
custemer.address,
event.Event_Code,
event.type_event_code,
events_hall.hall_code,
events_hall.name_hall,
events_hall.People_capacity,
event_type.type_event,
event_type.type_event_code
FROM reservation
join custemer ON reservation.Reservation_Code = custemer.Reservation_Code
join event ON reservation.Reservation_Code = event.Reservation_Code
join events_hall ON event.hall_code = events_hall.hall_code
join event_type ON event.type_event_code = event_type.type_event_code
ORDER BY reservation.Size_of_the_event DESC" ;
$result = $conn->query($sql);
if ($result->num_rows > 0)
{
echo "<table><tr><th>Invoice code</th><th>Res. Code</th><th>Id</th><th>Full Name</th><th>Res. Date</th><th>Event size</th>
<th>Phone</th><th>Address</th><th>hall name</th><th>Event type</th></tr>";
// output data of each row
while($row = $result->fetch_assoc())
{
echo "<tr><td>".
$row["Invoice_code"]."</td><td>".
$row["Reservation_Code"]."</td><td>".
$row["Id"]."<td>".
$row["full_name"]."</td><td>".
$row["Reservation_Date"]."</td><td>".
$row["Size_of_the_event"]."</td><td>".
$row["phone"]."</td><td>".
$row["address"]."</td><td>".
$row["name_hall"]."</td><td>".
$row["type_event"]."</td></tr>";
}
echo "</table>";
}
else
{
echo "0 results";
}
mysqli_close($conn);
?>
</section>
</main>
<script>document.write(sideNav)</script>
<script>document.write(footer)</script>
</div>
</body>
</html>