forked from mgherghi/inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_orders.php
83 lines (80 loc) · 3.07 KB
/
user_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
<?php
$page_title = 'All Sign Outs';
require_once('includes/load.php');
// Checkin What level user has permission to view this page
//page_require_level(1);
$all_orders = find_all_rev('checkout');
$all_ee = find_all('person');
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-12">
<?php echo display_msg($msg); ?>
</div>
</div>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-heading">
<strong>
<span class="glyphicon glyphicon-th"></span>
<span>All Sign Outs</span>
</strong>
<div class="pull-right">
<a href="add_order.php" class="btn btn-primary">Go To Sign Out</a>
</div>
</div>
<div class="panel-body">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th class="text-center" style="width: 50px;">#</th>
<th class="text-center" style="width: 50px;">Employee</th>
<th class="text-center" style="width: 50px;">Item number</th>
<th class="text-center" style="width: 50px;">Qty. Taken</th>
<th class="text-center" style="width: 50px;">Date</th>
<th class="text-center" style="width: 100px;">Reason</th>
<th class="text-center" style="width: 100px;">Line</th>
<th class="text-center" style="width: 100px;">Machine</th>
<th class="text-center" style="width: 100px;">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($all_orders as $checkout):?>
<tr>
<td class="text-center"><?php echo $checkout['id'];?></td>
<td class="text-center">
<?php foreach ($all_ee as $ee){
if ($checkout['employee'] == $ee['ee_number']){
echo $ee['last_name'].', '.$ee['first_name'];
}
}
?>
</td>
<?php $product = find_by_gpcnum('products', $checkout['item']); ?>
<td class="text-center">
<a href="user_view_product.php?id=<?php echo (int)$product['id'];?>"><?php echo remove_junk($product['gpc_number']); ?> </a>
</td>
<td class="text-center"><?php echo remove_junk(ucfirst($checkout['q_taken']));?></td>
<td class="text-center"><?php echo remove_junk(ucfirst($checkout['date']));?></td>
<td class="text-center"><?php echo remove_junk(ucfirst($checkout['reason']));?></td>
<td class="text-center"><?php echo remove_junk(ucfirst($checkout['line']));?></td>
<td class="text-center"><?php echo remove_junk(ucfirst($checkout['machine']));?></td>
<td class="text-center">
<div class="btn-group">
<?php if ($checkout['reason'] == 'returned'){
echo '<span class="glyphicon glyphicon-ok"></span>';
}else{
echo '<a href="return_order.php?id='.(int)$checkout['id'].'" onClick="return confirm("Are you sure you want to return?")" class="btn btn-xs btn-danger" data-toggle="tooltip" title="Return">';
echo '<span class="glyphicon glyphicon-import"></span>';
echo '</a>';
}?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php include_once('layouts/footer.php'); ?>