-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstock.php
108 lines (90 loc) · 3.25 KB
/
stock.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
<?php
$page_title = 'All stock';
require_once('includes/load.php');
// Checkin What level user has permission to view this page
page_require_level(1);
$all_stock = find_all('stock');
$all_products = find_all('products');
?>
<!-- ************************* -->
<?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>Inventory Log</span>
<!-- ************************* -->
</strong>
<div class="pull-right">
<a href="add_stock.php" class="btn btn-primary">Add Stock</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;">Product</th>
<th class="text-center" style="width: 50px;">Quantity</th>
<th class="text-center" style="width: 50px;">Comments</th>
<th class="text-center" style="width: 50px;">Date</th>
<th class="text-center" style="width: 100px;">Actions</th>
</tr>
</thead>
<tbody>
<!-- ************************* -->
<?php foreach ($all_stock as $stock):?>
<tr>
<td class="text-center">
<a href="view_product.php?id=<?php echo (int)$stock['product_id'];?>">
<?php
foreach ( $all_products as $product )
{
if ( $stock['product_id'] == $product['id'] ) { echo $product['name']; }
}
?>
</a>
</td>
<td class="text-center">
<?php echo remove_junk(ucfirst($stock['quantity']));?>
</td>
<td class="text-center">
<?php echo remove_junk(ucfirst($stock['comments']));?>
</td>
<td class="text-center">
<?php echo remove_junk(ucfirst($stock['date']));?>
</td>
<td class="text-center">
<div class="btn-group">
<a href="edit_stock.php?id=<?php echo (int)$stock['id'];?>" class="btn btn-xs btn-warning" data-toggle="tooltip" title="Edit">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a href="delete_stock.php?id=<?php echo (int)$stock['id'];?>" onClick="return confirm('Are you sure you want to delete?')" class="btn btn-xs btn-danger" data-toggle="tooltip" title="Remove">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</td>
</tr>
<?php endforeach; ?>
<!-- ************************* -->
</tbody>
</table>
</div>
</div>
<?php
/**
print "<pre>";
print_r($all_stock);
print "</pre>\n";
**/
?>
</div>
</div>
</div>
<?php include_once('layouts/footer.php'); ?>