-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu3.php
201 lines (156 loc) · 6.34 KB
/
menu3.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?php
session_start();
include("connection.php");
include("addtoDB.php");
$loggedUsername = $_SESSION['username'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MENU</title>
<link rel="stylesheet" href="css/menu-css.css" type="text/css">
</head>
<body>
<div class="row">
<div class="column side-bar">
<h1 class="side-head">Food Finder</h1>
<p class="side-tag">delivering the best food at your doorstep :)</p>
</br></br>
<h1>
<span class="text_1">Code: AB2316Z</span>
<span class="text_2">For 20% discount </span>
</h1>
</br></br>
<!--<a href="home.php" class="button button-accent button-small"><strong>Order Now</strong></a>
</br></br>
<a href="" class="button button-accent button-small"><strong>Rate & Review</strong></a> </br>
-->
<p class="side-tag">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</br></br>
<h1>
<span class="text_3">Hungry?</span>
<span class="text_2">Order food now! </span>
</h1>
</br></br>
<p class="side-tag">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>
<div class="column main-page">
<header>
<nav>
<ul>
<li><a href="logout.php" class="nav-li">LOGOUT</a></li>
<?php
$query = "SELECT item FROM orders WHERE id = 1";
$result = mysqli_query($con, $query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
if(isset($row['item'])){
?>
<li><a href="cart.php" class="nav-li">CART</a></li>
<?php
}
else{
?>
<li><a href="empty_cart.php" class="nav-li">CART</a></li>
<?php } ?>
<li><a href="profile.php" class="nav-li">PROFILE</a></li>
<li><a href="home.php" class="nav-li">HOME</a></li>
</ul>
</nav>
</header>
<h1 class="top">MENU</h1>
<?php
$q = ("SELECT resturant,item,price,food_type FROM menu WHERE resturant = 'Resturant 3' ");
$result = mysqli_query($con,$q);
$num = mysqli_num_rows($result);
for($i = 1; $i <= $num; $i++)
{
$row = mysqli_fetch_array($result);
?>
<!-- CARD 1 -->
<?php if($i == 1) { ?>
<div class="row">
<div class="card1">
<div class="column image">
<img src="https://images.unsplash.com/photo-1578922794704-7bdd46f70ce0?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=350&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400" alt="image">
</div>
<div class="column content">
<form action="addtoDB.php" method="POST"><strong><input type="submit" name="add3a" class="button button-accent button-small" value="+"></strong></form>
<h1 class="card-head"> <strong><?php echo $row['item'];?></strong> </h1>
<p class="card-data"><strong>Resturant: </strong><?php echo $row['resturant']; ?></p></br>
<p class="card-data"><strong>Price: </strong><?php echo $row['price'];?></p></br>
<p class="card-data"><strong>Type: </strong><?php echo $row['food_type']; ?></p>
</br>
</div>
</div>
</div>
<?php } ?>
<!-------------------------------->
<!-- CARD 2-->
<?php if($i == 2){ ?>
<div class="row">
<div class="card1">
<div class="column image">
<img src="https://images.unsplash.com/photo-1559620192-032c4bc4674e?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=350&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400" alt="image">
</div>
<div class="column content">
<form action="addtoDB.php" method="POST"><strong><input type="submit" name="add3b" class="button button-accent button-small" value="+"></strong></form>
<h1 class="card-head"><strong> <?php echo $row['item'];?></strong> </h1>
<p class="card-data" ><strong>Resturant: </strong><?php echo $row['resturant']; ?></p></br>
<p class="card-data" ><strong>Price: </strong><?php echo $row['price'];?></p></br>
<p class="card-data" ><strong>Type: </strong><?php echo $row['food_type']; ?></p>
</br>
</div>
</div>
</div>
<?php } ?>
<!-------------------------------->
<!-- CARD 3-->
<?php if($i == 3){ ?>
<div class="row">
<div class="card1">
<div class="column image">
<img src="https://images.unsplash.com/photo-1464093515883-ec948246accb?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=350&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400" alt="image">
</div>
<div class="column content">
<form action="addtoDB.php" method="POST"><strong><input type="submit" name="add3c" class="button button-accent button-small" value="+"></strong></form>
<h1 class="card-head"> <strong><?php echo $row['item'];?></strong> </h1>
<p class="card-data" ><strong>Resturant: </strong><?php echo $row['resturant']; ?></p></br>
<p class="card-data" ><strong>Price: </strong><?php echo $row['price'];?></p></br>
<p class="card-data" ><strong>Type:</strong> <?php echo $row['food_type']; ?></p>
</br>
</div>
</div>
</div>
<?php } ?>
<!-------------------------------->
<!-- CARD 4-->
<?php if($i == 4){ ?>
<div class="row">
<div class="card1">
<div class="column image">
<img src="https://images.unsplash.com/photo-1543738066-d1e2659d4317?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=350&ixid=eyJhcHBfaWQiOjF9&ixlib=rb-1.2.1&q=80&w=400" alt="image">
</div>
<div class="column content">
<form action="addtoDB.php" method="POST"><strong><input type="submit" name="add3d" class="button button-accent button-small" value="+"></strong></form>
<h1 class="card-head"><strong> <?php echo $row['item'];?></strong> </h1>
<p class="card-data"><strong>Resturant:</strong> <?php echo $row['resturant']; ?></p></br>
<p class="card-data"><strong>Price: </strong><?php echo $row['price'];?></p></br>
<p class="card-data"><strong>Type:</strong> <?php echo $row['food_type']; ?></p>
</br>
</div>
</div>
</div>
<?php } ?>
<!-------------------------------->
<?php } ?>
</div>
</body>
</html>