forked from matteveland/inventory_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder_picklist.php
145 lines (137 loc) · 4.03 KB
/
order_picklist.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
<?php
/**
* order_picklist.php
*
* @package default
*/
$page_title = 'Order Picklist';
require_once 'includes/load.php';
// Checkin What level user has permission to view this page
page_require_level(3);
$order_id = 0;
if (isset($_GET['id'])) {
$order_id = (int) $_GET['id'];
} else {
$session->msg("d", "Missing order id.");
}
$sales = find_sales_by_order_id( $order_id );
$order = find_by_id("orders", $order_id);
$products_available = join_product_table();
?>
<!doctype html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Order Picklist</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<style>
@media print {
html,body{
font-size: 9.5pt;
margin: 0;
padding: 0;
}.page-break {
page-break-before:always;
width: auto;
margin: auto;
}
}
.page-break{
width: 980px;
margin: 0 auto;
}
.sale-head{
margin: 40px 0;
text-align: center;
}.sale-head h1,.sale-head strong{
padding: 10px 20px;
display: block;
}.sale-head h1{
margin: 0;
border-bottom: 1px solid #212121;
}.table>thead:first-child>tr:first-child>th{
border-top: 1px solid #000;
}
table thead tr th {
text-align: center;
border: 1px solid #ededed;
}table tbody tr td{
vertical-align: middle;
}.sale-head,table.table thead tr th,table tbody tr td,table tfoot tr td{
border: 1px solid #212121;
white-space: nowrap;
}.sale-head h1,table thead tr th,table tfoot tr td{
background-color: #f8f8f8;
}tfoot{
color:#000;
text-transform: uppercase;
font-weight: 500;
}
</style>
</head>
<body>
<?php if ($sales): ?>
<div class="page-break">
<div class="sale-head pull-right">
<h1>Order #<?php echo remove_junk(ucfirst($order['id']));?></h1>
<strong><?php echo remove_junk($order['date']);?> </strong>
</div>
<div class="sale-head pull-left">
<h1><?php echo remove_junk(ucfirst($order['customer']));?> </h1>
</div>
<table class="table table-border">
<thead>
<tr>
<th>Product SKU</th>
<th>Product Title</th>
<th>Product Location</th>
<th>Stock Remaining</th>
<th>Quantity Ordered</th>
<th>Available</th>
<th>Picked</th>
<th>Dispatched</th>
</tr>
</thead>
<tbody>
<?php foreach ($sales as $sale): ?>
<tr>
<td class="text-center">
<?php
foreach ( $products_available as $product ) {
if ( $product['name'] == $sale['name'] )
{
echo remove_junk($product['sku']);
}
}
?>
</td>
<td class="text-center"><?php echo remove_junk(ucfirst($sale['name']));?></td>
<td class="text-center"><?php echo remove_junk($sale['location']);?></td>
<td class="text-center">
<?php
foreach ( $products_available as $product ) {
if ( $product['name'] == $sale['name'] )
{
echo remove_junk($product['quantity']);
}
}
?>
</td>
<td class="text-center"><?php echo remove_junk($sale['qty']);?></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else:
$session->msg("d", "Sorry no sales has been found. ");
redirect('orders.php', false);
endif;
?>
</body>
</html>
<?php if (isset($db)) { $db->db_disconnect(); } ?>