-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_stock.php
58 lines (56 loc) · 2.27 KB
/
view_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
<?php require './config.php'; ?>
<div class="page">
<div class="row">
<div class="col-md-12">
<div class="center">
<?php
$num = 0;
$total = 0;
$sql = "SELECT * FROM `stock`ORDER BY id DESC LIMIT 50";
$result = mysqli_query($con, $sql);
// if($result) print_r($result);
$num = mysqli_num_rows($result);
// echo$num;
if ($num != 0) {
?>
<table class="table table-bordered table-hover table-responsive">
<tr class="active">
<th>Company</th>
<th>Item Code</th>
<th>Quantity</th>
<th>Purchase Rate</th>
<th>Selling Rate</th>
<th>Total</th>
</tr>
<?php
while ($row = mysqli_fetch_array($result)) {
Echo '<tr class="success">
<td class="active">' . $row['company'] . '</td>
<td class="active">' . $row['item'] . '</td>
<td class="success">' . $row['qty'] . '</td>
<td class="warning">' . $row['p_rate'] . '</td>
<td class="danger">' . $row['s_rate'] . '</td>
<td class="info">' . $row['total'] . '</td>
</tr>';
$total += $row['total'];
}
?>
<tr class="warning">
<td></td>
<td></td>
<td></td>
<td></td>
<td><?php echo 'Total ' ?></td>
<td><?php echo $total ?></td>
<td></td>
</tr>
</table>
<?php
} else {
echo" <h1 class = 'center' > NO Data Available </h1> ";
}
?>
</div>
</div>
</div>
</div>