forked from mgherghi/inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_view_product.php
194 lines (191 loc) · 6.87 KB
/
user_view_product.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
$page_title = 'All Product';
require_once('includes/load.php');
// Checkin What level user has permission to view this page
//page_require_level(3);
$product = find_by_id('products',(int)$_GET['id']);
$all_categories = find_all('categories');
$all_photo = find_all('media');
$all_stock = find_all_rev('stock');
$all_checkouts = find_all_rev('checkout');
$all_ee = find_all('person');
if( ! $product )
{
$session->msg("d","Missing product id.");
// redirect('products.php');
}
if(isset($_POST['signout']))
{
array_push($_SESSION['items'],$product['gpc_number']);
redirect("add_order.php", false);
}
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-6">
<?php echo display_msg($msg); ?>
</div>
</div>
<div class="row">
<div class="col-md-2">
<form method="post" action="">
<div class="form-group">
<div class="input-group">
<span class="input-group-btn">
<button type="submit" name="signout" class="btn btn-primary">Add item to cart</button>
</span>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<strong>
<span class="glyphicon glyphicon-th"></span>
<span>Product Detail</span>
</strong>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-6">
<h4><?php echo remove_junk(first_character($product['name']));?></h4>
<div><label>Description:</label></div>
<div><?php echo remove_junk($product['description']); ?></div>
</div>
<div class="col-md-4">
<?php
foreach ($all_photo as $photo){
if ( $product['media_id'] == $photo['id'] ){?>
<img class="img-thumbnail" src="uploads/products/<?php echo $photo['file_name']; ?>" alt="">
<?php
}
}
?>
</div>
</div>
<?php
foreach ($all_categories as $category ){
if ( $product['category_id'] == $category['id'] ){
break;
}
}
?>
<div class="row">
<div class="col-md-10">
<div class="panel-body">
<ul>
<li class="text-left"> Category: <?php echo remove_junk($category['name']); ?></li>
<li class="text-left"> Location: <?php echo remove_junk($product['location']); ?></li>
<li class="text-left"> GPC P/N: <?php echo remove_junk($product['gpc_number']); ?></li>
<li class="text-left"> Stock: <?php echo remove_junk($product['quantity']); ?></li>
<li class="text-left"> Min Quantity: <?php echo remove_junk($product['min']); ?></li>
<li class="text-left"> Max Quantity: <?php echo remove_junk($product['max']); ?></li>
<li class="text-left"> Item Cost: $<?php echo remove_junk($product['item_cost']); ?></li>
<li class="text-left"> Manufacturer: <?php echo remove_junk($product['manufacturer']); ?></li>
<li class="text-left"> Manufacturer P/N: <?php echo remove_junk($product['manufacturernumber']); ?></li>
<li class="text-left"> Supplier: <?php echo remove_junk($product['supplier']); ?></li>
<li class="text-left"> Alternate Manufacturer: <?php echo remove_junk($product['alt_manufacturer']); ?></li>
<li class="text-left"> Alternate Manufacturer P/N: <?php echo remove_junk($product['alt_manufacturernumber']); ?></li>
<li class="text-left"> Alternate Supplier: <?php echo remove_junk($product['alt_supplier']); ?></li>
<li class="text-left"> Notes: <?php echo remove_junk($product['notes']); ?></li>
<li class="text-left"> Critical Item: <?php if ($product['crit'] < '1') { echo "no";} else { echo "yes";}; ?></li>
<li class="text-left"> Last Movement: <?php echo read_date($product['date']); ?></li>
<li class="text-left"> Line: <?php echo remove_junk($product['Line']); ?></li>
<li class="text-left"> Machine: <?php echo read_date($product['Machine']); ?></li>
<li class="text-left"> position: <?php echo remove_junk($product['position']); ?></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<strong>
<span class="glyphicon glyphicon-th"></span>
<span>Inventory Movement</span>
</strong>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th class="text-center" style="width: 10%;"> Date </th>
<th class="text-center" style="width: 10%;"> Quantity </th>
<th class="text-center" style="width: 10%;"> Comments </th>
</tr>
</thead>
<tr>
<?php
/*foreach ( $all_stock as $stock ){
echo '<tr>';
if ( $stock['product_id'] == $product['id'] ){
echo '<td class="text-center">'.$stock['date'].'</td>';
echo '<td class="text-center">'.$stock['quantity'].'</td>';
echo '<td class="text-center">'.$stock['comments'].'</td>';
}
echo '</tr>';
}*/
?>
</tr>
</table>
</div>
</div>
</div>
-->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<strong>
<span class="glyphicon glyphicon-th"></span>
<span>Inventory Movement</span>
</strong>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th class="text-center" style="width: 10%;"> ID </th>
<th class="text-center" style="width: 10%;"> Employee </th>
<th class="text-center" style="width: 10%;"> Date </th>
<th class="text-center" style="width: 10%;"> Quantity </th>
<th class="text-center" style="width: 10%;"> line </th>
<th class="text-center" style="width: 10%;"> machine </th>
<th class="text-center" style="width: 10%;"> reason </th>
</tr>
</thead>
<tr>
<?php
foreach ( $all_checkouts as $checkout ){
echo '<tr>';
if ( (int)$checkout['item'] == $product['gpc_number'] ){
echo '<td class="text-center">'.$checkout['id'].'</td>';
foreach($all_ee as $ee){
if ($checkout['employee'] == $ee['ee_number']){
echo '<td class="text-center">'.$ee['last_name'].', '.$ee['first_name'].'</td>';
}
}
echo '<td class="text-center">'.$checkout['date'].'</td>';
echo '<td class="text-center">'.$checkout['q_taken'].'</td>';
echo '<td class="text-center">'.$checkout['line'].'</td>';
echo '<td class="text-center">'.$checkout['machine'].'</td>';
echo '<td class="text-center">'.$checkout['reason'].'</td>';
}
echo '</tr>';
}
?>
</tr>
</table>
</div>
</div>
</div>
<?php include_once('layouts/footer.php'); ?>