-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
392 lines (373 loc) · 15.8 KB
/
index.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<!DOCTYPE html>
<html>
<head>
<title>The ShopMall</title>
<meta name="description" content="This is an online Grocery Store website.">
<meta name="keywords" content="Grocery, retail, shop, purchase">
<meta http-equiv="content-language" content="en-us">
<meta http-equiv="author" content="Keshav Kabra">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel='stylesheet'href='https://use.fontawesome.com/releases/v5.7.0/css/all.css' integrity=' sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ' crossorigin='anonymous'>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery-1.11.1.min.js"></script>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- start-smooth-scrolling -->
<!-- To-Top icon and functionality -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
</head>
<!-- ---------------------------------------- //HEAD -------------------------------------------- -->
<!-- ----------------------------------------- BODY ---------------------------------------------- -->
<body>
<!-- ----------------- NAV-BAR -------------------- -->
<nav class="navbar navbar-inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=" #bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="header-left">
<h3><a href="index.html" style="color:#fff;}">The ShopMall</a></h3>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<div class="product_list_header">
<form action="pay.php" method="post" class="last">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="display" value="1" />
<input type="submit" name="submit" value="View your cart" class="button" />
</fieldset>
</form>
</div>
<!-- USER LOGIN -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><h4><i class="fa fa-user" aria-hidden="true"></i></h4><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a data-toggle="modal" data-target="#login">Login</a></li>
<li role="separator" class="divider"></li>
<li><a data-toggle="modal" data-target="#signup">Sign Up</a></li>
</ul>
</li>
<!-- Dropdown Menu -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><h4>Most Demanded</h4><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="fruits.html">Fruits & Vegetables</a></li>
<li><a href="petFoods.html">Pet Food</a></li>
<li><a href="bakery.html">Bread & Bakery</a></li>
<li role="separator" class="divider"></li>
<li><a href="drinks.html">Juices</a></li>
<li role="separator" class="divider"></li>
<li><a href="cosmetics.html">Cosmetics</a></li>
</ul>
</li>
<div class="header-right">
<h3><a href="contact us/formFinal.html">Contact Us</a></h3>
</div>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<a href="index.html"><img id="logo" src="img/logo.jpg" content="The ShoppingMall"></a>
<!-- -------------------------------- TOP BRANDS --------------------------------- -->
<div class="top-brands">
<div class="container">
<h3>Hot Offers</h3>
<div class="agile_top_brands_grids">
<div class="col-md-3 top_brand_left">
<div class="hover14 column"> <!-- Shine on hovering -->
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<img title=" " alt=" " src="img/1.png" />
<p>fortune sunflower oil</p>
<h4>$7.99 <span>$10.00</span></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<form action="pay.php" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value=" " />
<input type="hidden" name="item_name" value="Fortune Sunflower Oil" />
<input type="hidden" name="amount" value="7.99" />
<input type="hidden" name="discount_amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value=" " />
<input type="hidden" name="cancel_return" value=" " />
<input type="submit" name="submit" value="Add to cart" class="button" />
</fieldset>
</form>
</div>
</div>
</figure>
</div>
</div>
</div>
</div>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block" >
<div class="snipcart-thumb">
<img title=" " alt=" " src="img/2.png" />
<p>basmati rise (5 Kg)</p>
<h4>$11.99 <span>$15.00</span></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<form action="pay.php" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value=" " />
<input type="hidden" name="item_name" value="basmati rise" />
<input type="hidden" name="amount" value="11.99" />
<input type="hidden" name="discount_amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value=" " />
<input type="hidden" name="cancel_return" value=" " />
<input type="submit" name="submit" value="Add to cart" class="button" />
</fieldset>
</form>
</div>
</div>
</figure>
</div>
</div>
</div>
</div>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block">
<div class="snipcart-thumb">
<img src="img/3.png" alt=" " class="img-responsive" />
<p>Pepsi soft drink (2 Ltr)</p>
<h4>$8.00 <span>$10.00</span></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<form action="pay.php" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value=" " />
<input type="hidden" name="item_name" value="Pepsi soft drink" />
<input type="hidden" name="amount" value="8.00" />
<input type="hidden" name="discount_amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value=" " />
<input type="hidden" name="cancel_return" value=" " />
<input type="submit" name="submit" value="Add to cart" class="button" />
</fieldset>
</form>
</div>
</div>
</figure>
</div>
</div>
</div>
</div>
<div class="col-md-3 top_brand_left">
<div class="hover14 column">
<div class="agile_top_brand_left_grid">
<div class="agile_top_brand_left_grid1">
<figure>
<div class="snipcart-item block">
<div class="snipcart-thumb">
<img src="img/4.png" alt=" " class="img-responsive" />
<p>dogs food (4 Kg)</p>
<h4>$9.00 <span>$11.00</span></h4>
</div>
<div class="snipcart-details top_brand_home_details">
<form action="pay.php" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value=" " />
<input type="hidden" name="item_name" value="dogs food" />
<input type="hidden" name="amount" value="9.00" />
<input type="hidden" name="discount_amount" value="1.00" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value=" " />
<input type="hidden" name="cancel_return" value=" " />
<input type="submit" name="submit" value="Add to cart" class="button" />
</fieldset>
</form>
</div>
</div>
</figure>
</div>
</div>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- --------------------------------- //TOP-BRANDS -------------------------------------- -->
<!-- -------------------------------- OTHER LINKS ---------------------------------------- -->
<div class="top-brands">
<div class="container">
<h3>See our other Products</h3>
<div class="row">
<div class="col-md-12">
<div class="list-group ">
<a href="products.html" class="list-group-item list-group-item-info"><b>Popular</b></a>
<a href="fruits.html" class="list-group-item list-group-item-danger"><b>Vegetables & Fruits</b></a>
<a href="edibles.html" class="list-group-item list-group-item-info"><b>Spices & Edibles</b></a>
<a href="instant.html" class="list-group-item list-group-item-danger"><b>Instant</b></a>
<a href="drinks.html" class="list-group-item list-group-item-info"><b>Juices & Soft-Drinks</b></a>
<a href="bakery.html" class="list-group-item list-group-item-danger"><b>Bread & Bakery</b></a>
<a href="dry-fruits.html" class="list-group-item list-group-item-info"><b>Dry Fruits</b></a>
<a href="petFoods.html" class="list-group-item list-group-item-danger"><b>Pet Food</b></a>
<a href="dairy.html" class="list-group-item list-group-item-info"><b>Dairy</b></a>
<a href="cosmetics.html" class="list-group-item list-group-item-danger"><b>Cosmetics</b></a>
<a href="household.html" class="list-group-item list-group-item-info"><b>Cleaning</b></a>
</div>
</div>
</div>
</div>
</div>
<!-- ----------------------------- FOOTER ---------------------------- -->
<div class="footer">
<div class="agile_footer_grids">
<div class="footer_grid_bottom">
<h4> Connect With Us</h4>
<ul class="agileits_social_icons">
<li><a href="#" class="facebook"><i class="fab fa-facebook-f" aria-hidden="true"></i></a></li>
<li><a href="#" class="twitter"><i class="fab fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" class="google"><i class="fab fa-google-plus-g" aria-hidden="true"></i></a></li>
<li><a href="#" class="instagram"><i class="fab fa-instagram" aria-hidden="true"></i></a></li>
<li><a href="#" class="quora"><i class="fab fa-quora" aria-hidden="true"></i></a></li>
</ul>
</div>
</div>
<div class="clearfix"> </div>
<div class="footer_copy">
<p>© 2019 <a href="#">The ShopMall</a>. All rights reserved | Design with ♥ by <a href="#">Keshav Kabra</a></p>
</div>
</div>
<!-- -------------------------------- BOOTSTRAP CORE JAVASCRIPT ------------------------------------ -->
<script src="js/bootstrap.min.js"></script>
<!-- DropDown NavBar Funcctionality -->
<script>
$(document).ready(function(){
$(".dropdown").hover(
function() {
$('.dropdown-menu', this).stop( true, true ).slideDown("medium");
$(this).toggleClass('open');
},
function() {
$('.dropdown-menu', this).stop( true, true ).slideUp("medium");
$(this).toggleClass('open');
}
);
});
</script>
<!-- scrolling icon -->
<!-- Log in Form -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="login">Log in</h5>
</div>
<div class="modal-body">
<div class="box">
<form method="post">
<div class="card">
<div class="card-header bg-dark text-center text-white">
<h1>Log in</h1>
</div><br>
<p style="color:#ff0000"><?php echo $_SESSION['error']; ?></p>
<label>Email</label>
<input type="text" class="form-control" name="email">
<label>Password</label>
<input type="text" class="form-control" name="password"><br>
<button class="btn btn-success" name="submit">Submit</button>
</div>
</form>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<!-- Sign Up Form -->
<div class="modal fade" id="signup" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="login">Log in</h5>
</div>
<div class="modal-body">
<div class="box">
<form method="post">
<div class="card">
<div class="card-header bg-dark text-center text-white">
<h1>Create Account</h1>
</div><br>
<p style="color:#ff0000"><?php echo $_SESSION['error']; ?></p>
<label>Name</label>
<input type="text" class="form-control" name="name">
<label>Email</label>
<input type="text" class="form-control" name="email">
<label>Password</label>
<input type="text" class="form-control" name="password"><br>
<button class="btn btn-success" name="submit">Submit</button>
</div>
</form>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();
error_reporting(0);
include "connection.php";
if(isset($_POST['submit'])){
if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['password'])){
if($_POST['name'] == '' || $_POST['email'] == '' || $_POST['password'] == ''){
$_SESSION['error'] = "All fields are required";
} else {
$stmt = $pdo->prepare('INSERT INTO signup (Name, Email, Password) VALUES (:name, :email, :password)');
$stmt->execute(array(
':name' => $_POST['name'],
':email' => $_POST['email'],
':password' => $_POST['password']));
}
}
}
?>