-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.php
95 lines (76 loc) · 3.97 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
session_start();
if($_SESSION["customer-login"] != "true"){
}
?>
<!DOCTYPE html>
<html lang="en">
<?php
$message = "";
require_once("connect-db.php");
$sql = "select * from menu";
$statement = $db->prepare($sql);
if($statement->execute()){
$menu = $statement->fetchAll();
$statement->closeCursor();
$message = "<h3>Menu was successfully retrieved.</h3>";
}else{
$message = "<h3>Error retrieving menu.</h3>";
}
?>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rel="icon" href="taco_truck.jpg" type="image/x-icon">
<title>Ted's Taco Truck</title>
</head>
<body>
<div class="container">
<?php include("header.html");?>
<?php include("nav.html");?>
<article>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<h2 class="center">Click <strong>Add to Cart</strong> to add an item to your cart for checkout.</h2>
<h4 id="under">Please make an account before making an order.</h4><br><br>
<table class="table-responsive table-striped order">
<thead>
<tr>
<th class="text-center" scope="col"></th>
<th class="text-center" scope="col">Menu Item</th>
<th class="text-center" scope="col">Price</th>
</tr>
</thead>
<?php
foreach($menu as $m){
?>
<tr id="order_description">
<td class="text-center"><img class="food" src="<?php echo $m["image"];?>"></td>
<td class="text-center"><?php echo $m["menu_item"];?></td>
<td class="text-center"><?php echo "$"; echo $m["price"];?></td>
</tr>
<tr id="order_description">
<td class="text-center" colspan="8"><?php echo $m["info"];?></td>
</tr>
<tr>
<td class="text-center"><form action="add-cart.php" method="GET">
<input type="hidden" name="menu_id" value="<?php echo $m["menu_id"];?>">
<input type="hidden" name="customer_id" value="<?php echo $_SESSION["customer_id"];?>">
<button type="submit" class="btn btn-danger">Add to Cart</button>
</form></td>
<?php
}
?>
</table>
</div>
<div class="col-md-2"></div>
</div>
</article>
<?php include("footer.html");?>
</div>
</body>
</html>