This repository has been archived by the owner on Aug 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
orders.php
161 lines (153 loc) · 9.77 KB
/
orders.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
<div class="page-content">
<div class="container">
<ul class="page-breadcrumb breadcrumb">
<ul class="page-breadcrumb breadcrumb">
<li>
<span>All Orders</span>
<i class="fa fa-circle"></i>
</li>
<li>
<a href="<?php echo $base_dir; ?>/orders/client">Client Orders</a>
<i class="fa fa-circle"></i>
</li>
<li>
<a href="<?php echo $base_dir; ?>/orders/retail">Retail Orders</a>
</li>
</ul>
</ul>
<div class="page-content-inner">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat blue">
<div class="visual">
<i class="fa fa-money fa-icon-medium"></i>
</div>
<div class="details">
<div class="number"> $<?php echo $total_revenue; ?> </div>
<div class="desc"> Estimated Revenue</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat red">
<div class="visual">
<i class="fa fa-credit-card"></i>
</div>
<div class="details">
<div class="number"> $<?php echo $total_costs; ?></div>
<div class="desc"> Estimated Expenses</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat yellow">
<div class="visual">
<i class="fa fa-credit-card"></i>
</div>
<div class="details">
<div class="number"> $<?php echo $total_profit; ?></div>
<div class="desc"> Estimated Profit</div>
</div>
<a class="more" href="#"> View more
<i class="m-icon-swapright m-icon-white"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat green">
<div class="visual">
<i class="fa fa-shopping-cart fa-icon-medium"></i>
</div>
<div class="details">
<div class="number"> <?php echo $num_sales; ?> </div>
<div class="desc"> Total Orders</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light ">
<div class="portlet-title">
<div class="caption">
<i class="icon-share font-blue"></i>
<span class="caption-subject font-blue bold uppercase">Order History</span>
</div>
<div class="actions">
<div class="btn-group">
<a class="btn btn-primary btn-sm" href="<?php echo $base_dir ?>/orders/add">
<i class="fa fa-plus" aria-hidden="true"></i>
<span class="hidden-xs"> Add New </span>
</a>
</div>
</div>
</div>
<div class="portlet-body">
<?php getOrderAlert(); ?>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th> Order #</th>
<th> Date</th>
<th> Type</th>
<th> Description</th>
<th> Status</th>
<th> Quantity</th>
<th> Revenue</th>
<th> Actions</th>
</tr>
</thead>
<tbody>
<?php
while ($client_order = mysqli_fetch_assoc($result)) {
?>
<tr <?php if (isset($_SESSION['order_id_updated'])) {
if ($_SESSION['order_id_updated'] == $client_order['order_id']) {
?>
class="updated-order"
<?php
unset($_SESSION['order_id_updated']);
}
} ?>
>
<td><a class="" href="<?php echo $base_dir; ?>/orders/view/<?php echo $client_order['order_id'] ?>"> <?php echo $client_order['order_number'] ?></a></td>
<td> <?php echo $client_order['date_order'] ?> </td>
<td> <?php if ($client_order['order_type'] == 1) {
echo "Client";
} else {
echo "Retail";
} ?> </td>
<td><a class="" href="<?php echo $base_dir; ?>/orders/view/<?php echo $client_order['order_id'] ?>"> <?php if (strlen($client_order['description']) > 20) {
echo substr($client_order['description'], 0, 20) . "...";
} else echo $client_order['description']; ?></a></td>
<?php if (empty($client_order['submitted_task'])) { ?>
<td class="order-not-sent"><strong>Not Sent </strong><a data-toggle="confirmation" class="btn btn-xs btn-default" data-href="./edit-order?order_id=<?php echo $client_order['order_id'] ?>&task=submitted"><i class="fa fa-check-circle-o"></i> Submitted</a></td>
<?php } elseif (empty($client_order['paid_invoice_task'])) { ?>
<td class="order-unpaid-invoice"><strong>Unpaid TCT </strong><a data-toggle="confirmation" class="btn btn-xs btn-default" data-href="./edit-order?order_id=<?php echo $client_order['order_id'] ?>&task=paid"><i class="fa fa-check-circle-o"></i> Paid</a></td>
<?php } elseif (empty($client_order['sent_invoice_task'])) { ?>
<td class="order-invoice-customer"><strong>Send Invoice </strong> <a data-toggle="confirmation" class="btn btn-xs btn-default" data-href="./edit-order?order_id=<?php echo $client_order['order_id'] ?>&task=sent"><i class="fa fa-check-circle-o"></i> Sent</a></td>
<?php } elseif (empty($client_order['received_task'])) { ?>
<td class="order-unreceived"><strong> Payment </strong> <a data-toggle="confirmation" class="btn btn-xs btn-default" data-href="./edit-order?order_id=<?php echo $client_order['order_id'] ?>&task=received"><i class="fa fa-check-circle-o"></i> Received</a></td>
<?php } else { ?>
<td class="order-complete"><strong>Complete </strong></td>
<?php } ?>
<td> <?php echo $client_order['s'] + $client_order['m'] + $client_order['l'] + $client_order['xl'] + $client_order['xxl'] + $client_order['xxxl'] ?> </td>
<!-- <td> --><?php //echo $client_order['cost_total'] ?><!-- </td>-->
<td> <?php echo toDollars($client_order['revenue']) ?> </td>
<td><a class="btn btn-xs btn-default" href="<?php echo $base_dir; ?>/orders/view/<?php echo $client_order['order_id'] ?>"><i class="fa fa-search"></i> <span class="hidden-xs">View</span></a>
<a class="btn btn-xs btn-default" href="<?php echo $base_dir; ?>/orders/edit/<?php echo $client_order['order_id'] ?>"><i class="fa fa-edit"></i> <span class="hidden-xs">Edit</span></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>