-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
437 lines (426 loc) · 23.4 KB
/
start.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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<?php
session_start();
/*if (isset($_SESSION["user_id"]) && isset($_SESSION["user_name"]))
{
}*/
/*var_dump($_SESSION['list'])*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" type="image/x-icon" href="img/buy_sell.ico">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<script src="main.js"></script>
<style>
.list{
cursor: pointer;
}
</style>
<title>Smart Buy</title>
</head>
<body>
<!---------------- Navbar---------------------->
<nav class="navbar navbar-dark navbar-expand">
<div class="container">
<div class="col-12">
<ul class="navbar-nav justify-content-between">
<li class="nav-item active">
<a class="nav-link" href="index.php">Smart buy</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mylist/my_list.html">My lists</a>
</li>
<li class="nav-item">
<a class="nav-link " href="mylist/my_list.html#contact_btn">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="mylist/my_list.html#about_us_btn">About us</a>
</li>
<li class="nav-item">
<?php
if (isset($_SESSION['user_id']))
{ echo "<span style='color: white'>Welcome ".$_SESSION['user_name']."</span>";
?>
<button class="btn btn-sm btn-outline-info mt-1" data-toggle="modal" id="logout">Logout</button>
<?php }
else
{?>
<button class="btn btn-sm btn-outline-info mt-1" data-toggle="modal" data-target="#sign-in">Sign in</button>
<?php }
?>
</li>
</ul>
</div>
</div>
</nav>
<!------------------------------Search----------------------->
<div class="pb-2 search_bar" id="search-bar">
<div class="container">
<div class="input-group">
<input class="form-control" type="text" placeholder="Search items...." id="txtSearch">
<span class="input-group-prepend">
<button class="btn btn-outline-info" id="btnSearch"> Search</button>
</span>
</div>
<div class="list-item" id="result">
<!-- <table class="table table-dark table-striped w-100">
<tr>
<td>Number of Shops</td>
<td>Price in A$</td>
<td>Total savings</td>
</tr>
<tr>
<td>Three Shops</td>
<td>Price in A$</td>
<td>Savings</td>
</tr>
</table> -->
</div>
</div>
</div>
<!------------------------------Sign in start----------------------->
<div class="modal" id="sign-in">
<div class="modal-dialog">
<div class="modal-content">
<div class="form-container row">
<div class="col-lg-8 col=md-12 col-sm-9 col-xs-12 form-box text-center">
<div class="mb-5">
<button class="close float-right text-light" data-dismiss="modal">×</button>
</div>
<div class="logo mb-3">
<img src="img/logo.png" width="150px">
</div>
<div class="heading mb-4">
<h4>Sign in into your account</h4>
</div>
<form>
<div class="form-input">
<span><i class="fa fa-envelope"></i></span>
<input id="sign_in_email" type="text" placeholder="Email or phone" required>
</div>
<div class="form-input">
<span><i class="fa fa-lock"></i></span>
<input id="sign_in_pass" type="password" placeholder="Password" autocomplete="off" required>
</div>
<div class="row mb-3">
<div class="col-6 d-flex">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb1">
<label class=" custom-control-label text-white" for="cb1">Remember me</label>
</div>
</div>
<div class="col-6 text-right">
<a href="#forget-password" data-toggle="modal" class="forget-link" id="forget-pw">Forget password?</a>
</div>
</div>
<div class="text-left mb-3">
<button id="btnSignIn" type="submit" class="btn btn-outline-info">Sign in</button>
</div>
<div class="text-center mb-2">
<div class="mb-3" style="color:#777"> or sign in with</div>
<a href="http://www.facebook.com" class="btn btn-social btn-facebook">facebook</a>
<a href="https://accounts.google.com/signin/v2/identifier?passive=1209600&continue=https%3A%2F%2Fadssettings.google.com%2Fauthenticated&followup=https%3A%2F%2Fadssettings.google.com%2Fauthenticated&flowName=GlifWebSignIn&flowEntry=ServiceLogin" class="btn btn-social btn-google">google</a>
<a href="https://twitter.com/login" class="btn btn-social btn-twitter">twitter</a>
</div>
<div class="text-light">Don't have an account? <a href="#sign-up" class="register-link" data-toggle="modal" id="register-here">Register here</a></div>
</form>
<div class="modal-footer mt-5">
<button class="btn btn-outline-danger" data-dismiss="modal" id="sign-in-close">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!------------------------------Sign in end----------------------->
<!------------------------------Sign up start----------------------->
<div class="modal" id="sign-up">
<div class="modal-dialog">
<div class="modal-content">
<div class="form-container row">
<div class="col-lg-8 col=md-12 col-sm-9 col-xs-12 form-box text-center">
<div class="mb-5">
<button class="close float-right text-light" data-dismiss="modal">×</button>
</div>
<div class="logo mb-3">
<img src="img/logo.png" width="150px">
</div>
<div class="heading mb-4">
<h4>Create an account</h4>
</div>
<form>
<div class="form-input">
<span><i class="fa fa-user"></i></span>
<input id="sign_up_full_name" type="text" placeholder="Full Name" required>
</div>
<div class="form-input">
<span><i class="fa fa-envelope"></i></span>
<input id="sign_up_email" type="email" placeholder="Email or phone" required>
</div>
<div class="form-input">
<span><i class="fa fa-phone"></i></span>
<input id="sign_up_contact_number" type="text" placeholder="Contact Number" required>
</div>
<div class="form-input">
<span><i class="fa fa-home"></i></span>
<input id="sign_up_address" type="text" placeholder="Address" required>
</div>
<div class="form-input">
<span><i class="fa fa-lock"></i></span>
<input id="sign_up_pass" type="password" placeholder="Password" autocomplete="off" required>
</div>
<div class="row mb-3">
<div class="col-12 d-flex">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb2">
<label id="home_condition" class=" custom-control-label text-white" for="cb2">I agree all terms & conditions</label>
</div>
</div>
</div>
<div class="text-left mb-3">
<button id="btnSignUp" type="submit" class="btn btn-outline-info">Sign up</button>
</div>
<div class="text-center mb-2">
<div class="mb-3" style="color:#777"> or sign up with</div>
<a href="http://www.facebook.com" class="btn btn-social btn-facebook">facebook</a>
<a href="https://accounts.google.com/signin/v2/identifier?passive=1209600&continue=https%3A%2F%2Fadssettings.google.com%2Fauthenticated&followup=https%3A%2F%2Fadssettings.google.com%2Fauthenticated&flowName=GlifWebSignIn&flowEntry=ServiceLogin" class="btn btn-social btn-google">google</a>
<a href="https://twitter.com/login" class="btn btn-social btn-twitter">twitter</a>
</div>
<div class="text-light">Already have an account? <a href="#sign-in" data-toggle="modal" class="register-link" id="sign-in-here">Sign in here</a></div>
</form>
<div class="modal-footer mt-5">
<button class="btn btn-outline-danger" data-dismiss="modal" id="sign-up-close">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!------------------------------Sign up end----------------------->
<!-----------------------Forget password start----------------------->
<div class="modal" id="forget-password">
<div class="modal-dialog">
<div class="modal-content">
<div class="form-container row">
<div class="col-lg-8 col=md-12 col-sm-9 col-xs-12 form-box">
<div class="mb-5">
<button class="close float-right text-light" data-dismiss="modal">×</button>
</div>
<div class=" text-center logo mb-3">
<img src="img/logo.png" width="150px">
</div>
<div class="reset-form d-block">
<form class="reset-password-form">
<h4 class="mb-3">Reset your password</h4>
<p class="mb-3 text-white">Please enter your email address</p>
<div class="form-input">
<span><i class="fa fa-envelope"></i></span>
<input type="text" placeholder="Email or phone" required>
</div>
<div class="mb-3">
<button class="btn btn-outline-info" type="submit">Send Reset link</button>
</div>
</form>
</div>
<div class="reset-confirmation d-none">
<div class="mb-4">
<h4 class="mb-3">Link was send</h4>
<h6 class="text-white">Please check your inbox</h6>
</div>
<div>
<a href="#sign-in">
<button type="submit" class="btn btn-outline-info" data-toggle="modal" data-target="#sign-in" id="sign-in-now">Sign in Now</button>
</a>
</div>
</div>
<div class="modal-footer mt-5">
<button class="btn btn-outline-danger" data-dismiss="modal" id="forget-password-close">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-----------------------Forget password ends----------------------->
<!-------------------------main body section start----------------->
<section>
<div class="dark-overlay">
<div class="home-inner">
<div class="container">
<div class="row">
<div class="col-md-7">
<div id="product_add">
</div>
<!----------------Products list table--------------------->
<div>
<h4 class="text-light">Products list</h4>
<table id="product_list_row" class="table-dark table-striped text-center mb-4 product_list_table">
<tr>
<th>Name</th>
<th>Amount</th>
<th>Unit</th>
<th>Cost</th>
<th colspan="2">Action</th>
</tr>
<?php
if(isset($_SESSION['user_id']))
{
include_once 'product_list.php';
} ?>
</table>
<button id="calculate" class="btn btn-sm btn-outline-info">Calculate</button>
</div>
<!-----------------Cheapest price table---------------------->
<div>
<div>
<select class="btn btn-outline-info disable_scrolling">
<option class="bg-dark text-info">Number of shops</option>
<option class="bg-dark text-info"><a href="#">One shop</a></option>
<option class="bg-dark text-info"><a href="#">Two shops</a></option>
<option class="bg-dark text-info"><a href="#">Three shops</a></option>
</select>
</div>
<h4 class="text-info">Get products in cheapest price</h4>
</div>
<div>
<table class="table text-center mt-1 cheapest_price_table">
<tr>
<td>
<div>
<input type="checkbox" class="btn-info" id="cb_coles">
<label class="text-white" for="cb_coles">Coles</label>
</div>
</td>
<td>
<div>
<input type="checkbox" class="btn-info" id="cb_woolworths">
<label class="text-white" for="cb_woolworths">Woolworths</label>
</div>
</td>
<td>
<div>
<input type="checkbox" class="btn-info" id="cb_aldi">
<label class="text-white" for="cb_aldi">Aldi</label>
</div>
</td>
</tr>
<tr>
<td>
<ul>
<ul id="product_list_coles">
<?php if(isset($_SESSION['user_id'])){include_once 'home_shopwise_list_coles.php';}?>
<!-- <li>Coffee</li> -->
</ul>
</ul>
</td>
<td>
<ul id="product_list_woolworths">
<?php if(isset($_SESSION['user_id'])){include_once 'home_shopwise_list_woolworths.php';}?>
<!-- <li>Mango</li> -->
</ul>
</td>
<td>
<ul id="product_list_aldi">
<?php if(isset($_SESSION['user_id'])){include_once 'home_shopwise_list_aldi.php';}?>
<!-- <li>Orange</li> -->
</ul>
</td>
</tr>
</table>
<div id="suggestion">
<!-- <span style="color: red">Hello</span> -->
</div>
</div>
<!------------------Save or Share----------------------->
<div class="btn-group">
<button class="btn btn-outline-info">Save</button>
<button class="btn btn-outline-info">Add to my lists</button>
<button class="btn btn-outline-info">Share</button>
</div>
</div>
<!----------------------------Savings table--------------------------->
<div class="col-md-5">
<table class="table table-dark table-striped text-center mt-4 saving_table">
<tr>
<td>Number of Shops</td>
<td>Total cost in A$</td>
<td>Total savings</td>
</tr>
<tr>
<td>Three Shops</td>
<td><span id="Three_shops">
<?php if(isset($_SESSION['user_id'])){include_once "three_shops_total.php";} ?></span></td>
<td>Savings</td>
</tr>
<tr>
<td>Two Shops</td>
<td>Price in A$ <span id="Two_shops"></span></td>
<td>Savings</td>
</tr>
<tr>
<td>One Shop</td>
<td>Price in A$ <span id="One_shops"></span></td>
<td>Savings</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<!-------------------------main body section end----------------->
<!-----------------------------footer start--------------------->
<footer class="text-center text-light py-1 mt-2 fixed-bottom">
<div class="container">
<div class="row">
<div class="col-md-12">
<p class="pt-2">Copyright © 2020, <a href="index.html" class=" text-light">Smart Buy</a></p>
</div>
</div>
</div>
</footer>
<!-----------------------------footer end--------------------->
<script>
/*--------------sign in & sign up-----------------*/
$(document).ready(function(){
$('#register-here').click(function(){
$('#sign-in-close').click();
});
$('#sign-in-here').click(function(){
$('#sign-up-close').click();
});
});
/*--------------forget password-----------------*/
$(document).ready(function(){
$('#forget-pw').click(function(){
$('#sign-in-close').click();
});
$('#sign-in-now').click(function(){
$('#forget-password-close').click();
});
});
function PasswordReset(){
$('form.reset-password-form').on('submit',function(e){
e.preventDefault();
$('.reset-form').removeClass('d-block').addClass('d-none');
$('.reset-confirmation').addClass('d-block');
});
}
window.addEventListener('load',function(){
PasswordReset();
});
</script>
</body>
</html>