-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_category.php
More file actions
68 lines (57 loc) · 2.12 KB
/
Copy pathview_category.php
File metadata and controls
68 lines (57 loc) · 2.12 KB
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
<?php
require_once('includes/load.php');
$page_title = 'View By Category';
if (isset($_GET['id'])) {
$category_id = (int)$_GET['id'];
$category = find_by_id('categories', $category_id);
$products_in_category = find_where("products", "WHERE categorie_id = '{$category_id}'");
} else {
redirect('categorie.php');
}
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-12">
<?php echo display_msg($msg); ?>
</div>
</div>
<div class="row">
<div class="panel panel-default">
<div class="panel-heading">
<h2 style="font-size:25px; text-transform: capitalize;">Category: <?php echo $category['name']; ?></h2>
</div>
<div class="panel-body">
<!-- <a href="category_memo.php?category=<?php echo urlencode($category['name']); ?>" class="btn btn-primary">Generate Category Memo</a> -->
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Name & <br> Indent No.</th>
<th>Receive <br> Date</th>
<th>Quantity <br> Arrived</th>
<th>Using</th>
<th>Inactive</th>
<th>Last Inventory</th>
<th>Specification</th>
</tr>
</thead>
<tbody>
<?php $serial_number = 1; ?>
<?php foreach ($products_in_category as $product) : ?>
<tr>
<td><?php echo $serial_number++; ?></td>
<td><?php echo $product['name']; ?></td>
<td><?php echo date('d/m/Y', strtotime($product['date'])); ?></td>
<td><?php echo get_total_product_using($product['id']) + get_total_product_defect($product['id']) + $product['quantity']; ?></td>
<td><?php echo get_total_product_using($product['id']); ?></td>
<td><?php echo get_total_product_defect($product['id']); ?></td>
<td><?php echo $product['quantity']; ?></td>
<td><?php echo $product['specification']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php include_once('layouts/footer.php'); ?>