forked from MuktaGhosh/Automated-Food-Ordering-System
-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
99 lines (84 loc) · 2.4 KB
/
login.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
<?php include 'inc/header.php';?>
<?php
$login = Session::get("cuslogin");
if ($login == true) {
header("Location:order.php");
}
?>
<?php
$cmr = new Customer();
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['login'])){
$custLogin = $cmr->customerLogin($_POST);
}
?>
<div class="main">
<div class="content">
<div class="login_panel">
<?php
if (isset($custLogin)) {
echo json_encode($custLogin);
} ?>
<h3>Existing Customers</h3>
<p>Sign in with the form below.</p>
<form action="" method="post" >
<input name="email" placeholder="Email" type="text" />
<input name="pass" placeholder="password" type="text"/>
<div class="buttons"><div><button class="grey" name="login">Sign In</button></div></div>
</div>
</form>
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['register']))
{
$customerReg = $cmr->customerRegistration($_POST);
}
?>
<div class="register_account">
<?php
if (isset($customerReg)) {
echo json_encode($customerReg);
}
?>
<h3>Register New Account</h3>
<form action="" method="post">
<table>
<tbody>
<tr>
<td>
<div>
<input type="text" name="name" placeholder="Name" >
</div>
<div>
<input type="text" name="city" placeholder="City" >
</div>
<div>
<input type="text" name="zip" placeholder="Zip-Code" >
</div>
<div>
<input type="text" name="email" placeholder="Email" >
</div>
</td>
<td>
<div>
<input type="text" name="address" placeholder="Address" >
</div>
<div>
<input type="text" name="country" placeholder="Country" >
</div>
<div>
<input type="text" name="pass" placeholder="Password" >
</div>
<div>
<input type="text" name="phone" placeholder="Phone" >
</div>
</td>
</tr>
</tbody></table>
<div class="search"><div><button class="grey" name = "register">Create Account</button></div></div>
<div class="clear"></div>
</form>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php include 'inc/footer.php';?>