-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproducts.php
56 lines (52 loc) · 1.56 KB
/
products.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
<?php include 'include/head.php';?>
<?php include 'include/nav.php';?>
<?php
if (isset($_GET['catId']))
{
$catId = $_GET['catId'];
$array = $con->query("select * from categories where id='$catId'");
$catArray =$array->fetch_assoc();
$catName = $catArray['name'];
$stockArray = $con->query("select * from inventeries where catId='$catArray[id]'");
}
else
{
$catName = "All Inventeries";
$stockArray = $con->query("select * from inventeries");
}
include 'assets/bill.php';
?>
<div class="content container">
<a href="addnew.php" class="btn btn-primary float-right"><i class="icon icon-plus"></i> New Item</a>
<br/><br/>
<div class="tableBox" >
<table id="dataTable" class="table table-striped table-hover">
<thead>
<th>#</th>
<th>Name</th>
<th>Unit</th>
<th>Price</th>
<th></th>
</thead>
<tbody>
<?php $i=0;
while ($row = $stockArray->fetch_assoc())
{
$i=$i+1;
$id = $row['id'];
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['unit']; ?></td>
<td> <?php echo number_format ($row['price'],0);?></td>
<td colspan="center"><a href="delete.php?item=<?php echo $row['id'] ?>&url=<?php echo $_SERVER['QUERY_STRING'] ?>"><button class='btn btn-primary'>Delete Item</button></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php include 'include/footer.php';?>