-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
product.php
73 lines (72 loc) · 3.87 KB
/
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
<?php
$page_title = 'All Product';
require_once('includes/load.php');
// Checkin What level user has permission to view this page
page_require_level(2);
$products = join_product_table();
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-12 p-3 p-md-5">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<div class="float-end">
<a href="add_product.php" class="btn btn-primary">Add New Products</a>
</div>
</div>
<div class="panel-body">
<table class="table text-white">
<thead>
<tr>
<th class="text-center" style="width: 50px;">#</th>
<th> Image</th>
<th> Product </th>
<th class="text-center" style="width: 10%;"> Group </th>
<th class="text-center" style="width: 10%;"> Stock </th>
<th class="text-center" style="width: 10%;"> Cost</th>
<th class="text-center" style="width: 10%;"> Sell</th>
<th class="text-center" style="width: 10%;"> Added </th>
<th class="text-center" style="width: 100px;"> </th>
</tr>
</thead>
<tbody>
<?php foreach ($products as $product):?>
<tr>
<td class="text-center"><?php echo count_id();?></td>
<td>
<?php if($product['media_id'] === '0'): ?>
<img class="img-avatar img-circle" src="uploads/products/no_image.jpg" width="80" class="img-fluid" alt="">
<?php else: ?>
<img class="img-avatar img-circle" width="80" class="img-fluid" src="uploads/products/<?php echo $product['image']; ?>" alt="">
<?php endif; ?>
</td>
<td> <?php echo remove_junk($product['name']); ?></td>
<td class="text-center"> <?php echo remove_junk($product['categorie']); ?></td>
<td class="text-center"> <?php echo remove_junk($product['quantity']); ?></td>
<td class="text-center"> <?php echo remove_junk($product['buy_price']); ?></td>
<td class="text-center"> <?php echo remove_junk($product['sale_price']); ?></td>
<td class="text-center"> <?php echo read_date($product['date']); ?></td>
<td class="text-center">
<div class="btn-group">
<a href="edit_product.php?id=<?php echo (int)$product['id'];?>" class="btn btn-primary btn-xs" title="Edit" data-toggle="tooltip">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pen" viewBox="0 0 16 16">
<path d="m13.498.795.149-.149a1.207 1.207 0 1 1 1.707 1.708l-.149.148a1.5 1.5 0 0 1-.059 2.059L4.854 14.854a.5.5 0 0 1-.233.131l-4 1a.5.5 0 0 1-.606-.606l1-4a.5.5 0 0 1 .131-.232l9.642-9.642a.5.5 0 0 0-.642.056L6.854 4.854a.5.5 0 1 1-.708-.708L9.44.854A1.5 1.5 0 0 1 11.5.796a1.5 1.5 0 0 1 1.998-.001zm-.644.766a.5.5 0 0 0-.707 0L1.95 11.756l-.764 3.057 3.057-.764L14.44 3.854a.5.5 0 0 0 0-.708l-1.585-1.585z"/>
</svg>
</a>
<a href="delete_product.php?id=<?php echo (int)$product['id'];?>" class="btn btn-danger btn-xs" title="Delete" data-toggle="tooltip">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-dash-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z"/>
</svg>
</a>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</tabel>
</div>
</div>
</div>
</div>
<?php include_once('layouts/footer.php'); ?>