-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
125 lines (125 loc) · 4.49 KB
/
profile.php
File metadata and controls
125 lines (125 loc) · 4.49 KB
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
<?php
require_once 'auth.php';
include 'includes/header.php';
include 'includes/nav.php';
include 'includes/profile-data.php';
?>
<div id="main">
<div class="container">
<div class="row">
<div class="col-md-5">
<h4>User credentials</h4>
<form class="form-horizontal" action="includes/profile-data.php" method="POST">
<div class="form-group">
<label for="inputEmail1" class="control-label col-md-4">Username</label>
<div class="col-md-8">
<input type="text" value="<?php echo $user['user_name'] ?>" class="form-control" disabled name="username" id="inputEmail1">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4">Email</label>
<div class="controls col-md-8">
<input type="email" value="<?php echo $user['user_email'] ?>" class="form-control" disabled name="email">
</div>
</div>
<p class="help-block">Change password</p>
<?php
if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) {
?>
<div class="alert alert-warning">
<ul class="list-unstyled">
<?php
foreach ($_SESSION['ERRMSG_ARR'] as $msg) {
echo '<li>'.$msg.'</li>';
}
?>
</ul>
</div>
<?php
unset($_SESSION['ERRMSG_ARR']);
}
?>
<div class="form-group">
<label class="control-label col-md-4">Password</label>
<div class="controls col-md-8">
<input type="password" class="form-control" name="password">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4">Confirm Password</label>
<div class="controls col-md-8">
<input type="password" class="form-control" name="cpassword">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-4"></label>
<div class="controls col-md-8">
<button type="submit" class="btn btn-default">Change it!</button>
</div>
</div>
</form>
</div>
<div class="col-md-7">
<h4>Orders</h4>
<?php
if(isset($orders))
{
?>
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Order Date</th>
<th>Products</th>
<th>Order Status</th>
<th>Order Cost</th>
</tr>
</thead>
<tbody>
<?php
foreach ($orders as $order) {
switch ($order->od_status) {
case 'New':
$status = '<span class="label label-primary">New</span>';
break;
case 'Shipped':
$status = '<span class="label label-info">Shipped</span>';
break;
case 'Completed':
$status = '<span class="label label-success">Completed</span>';
break;
case 'Cancelled':
$status = '<span class="label label-danger">Cancelled</span>';
break;
default:
$status = '<span class="label label-default">Processing</span>';
break;
}
?>
<tr>
<td><?php echo $order->od_id ?></td>
<td><?php echo $order->od_date ?></td>
<td><?php echo $order->products ?></td>
<td><?php echo $status ?></td>
<?php setlocale(LC_MONETARY,'en_US'); ?>
<td> ₹ <?php echo money_format('%!i', floatval($order->od_cost)); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
else { ?>
<div class="alert alert-warning">We didn't find any order placed by you.</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
include 'includes/footer.php';
?>