-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
79 lines (67 loc) · 2.36 KB
/
menu.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
<!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="updateMenuForm.php">שינוי במחיר המנה</button>
<button class="buttonSquare" onclick=location.href="dishDecForm.php">שינוי בתיאור המנה</button>
<button class="buttonSquare" onclick=location.href="insetNewMenuForm.php">הוספה של תפריט</button>
<button class="buttonSquare" onclick=location.href="insertDishForm.php">הוספה של מנה</button>
<button class="buttonSquare" onclick=location.href="deleteForm.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 menu.Menu_code,
menu.Name,
menu.Price_per_People,
dish.Id_dish,
dish.Name_dish,
dish.Des_dish
FROM menu
join dish ON menu.Menu_code = dish.Menu_code
ORDER BY menu.Menu_code";
$result = $conn->query($sql);
if ($result->num_rows > 0)
{
echo "<table><tr><th>Menu code</th><th>Menu.Name</th><th>Id_dish</th><th>Name_dish</th><th>Des_dish</th><th>Price per one people</th></tr>";
// output data of each row
while($row = $result->fetch_assoc())
{
echo "<tr><td>".$row["Menu_code"]."</td>
<td>".$row["Name"]."</td>
<td>".$row["Id_dish"]."</td>
<td>".$row["Name_dish"]."</td>
<td>".$row["Des_dish"]."</td>
<td>".$row["Price_per_People"]."</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>