-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
52 lines (48 loc) · 1.8 KB
/
index.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
<?php include 'header.php';?>
<!-- After Nav -->
<div class="container">
<div class="row">
<div class="col-xs-12 main-content">
<h1 class="page-title">Available Stock</h1>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Company</th>
<th>Quantity</th>
<th>Price</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<?php
include('db_con.php');
$sql = "Select * from products ORDER BY product_name ASC";
$result = mysqli_query($conn, $sql);
$i = 1;
if(mysqli_num_rows($result) > 0)
while($row = mysqli_fetch_row($result)) {
echo "<tr>";
echo '<th scope="row">'.$i.'</th>';
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "<td>".number_format($row[4],2)."</td>";
echo '<td> <a href="edit-stock.php?p_name='.$row[1].'&p_company='.$row[2].'&p_quantity='.$row[3].'&p_price='.$row[4].'">Edit</a> </td>';
echo "</tr>";
$i++;
}
?>
</tbody>
</table>
</div> <!-- xs-12 -->
</div> <!-- row -->
</div> <!-- container -->
<?php include 'footer.php';?>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>