forked from MuktaGhosh/Automated-Food-Ordering-System
-
Notifications
You must be signed in to change notification settings - Fork 1
/
editprofile.php
107 lines (85 loc) · 2.64 KB
/
editprofile.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
<?php include 'inc/header.php';?>
<?php
$login = Session::get("cuslogin");
if ($login == false) {
header("Location:login.php");
}
?>
<?php
$cmrId = Session::get("cmrId");
$cmr = new Customer();
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit'])){
$updateCmr = $cmr->customerUpdate($_POST, $cmrId);
}
?>
<style>
.tblone{width: 550px;margin:0 auto; border:2px solid #ddd;}
.tblone tr td{text-align: justify;}
.tblone input[type="text"]{width: 400px;padding: 5px; font-size: 15px;}
</style>
<div class="main">
<div class="content">
<div class="section group">
<?php
$cmr = new Customer();
$id = Session::get("cmrId");
$getdata = $cmr->getCustomerData($id);
if ($getdata) {
while ($result = $getdata->fetch_assoc()) {
?>
<form action="" method="post">
<table class="tblone">
<?php
if (isset($updateCmr)) {
echo "<tr><td colspan='2'>".$updateCmr."</td></tr>";
}
?>
<tr>
<td colspan="2"><h2>Update Profile Details</h2></td>
</tr>
<tr>
<td width="20%">Name</td>
<td><input type="text" name="name" value="<?php echo $result['name']; ?>">
</td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address" value="<?php echo $result['address']; ?>">
</td>
</tr>
<tr>
<td>City</td>
<td><input type="text" name="city" value="<?php echo $result['city']; ?>">
</td>
</tr>
<tr>
<td>Country</td>
<td><input type="text" name="country" value="<?php echo $result['country']; ?>">
</td>
</tr>
<tr>
<td>Zipcode</td>
<td><input type="text" name="zip" value="<?php echo $result['zip']; ?>">
</td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value="<?php echo $result['email']; ?>">
</td>
</tr>
<tr>
<td>Phone</td>
<td><input type="text" name="phone" value="<?php echo $result['phone']; ?>">
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Save"></td>
</tr>
</table>
</form>
<?php } } ?>
</div>
</div>
</div>
<?php include 'inc/footer.php';?>