Repository navigation
Expand file tree
/
Copy pathadminStockReportPrint.php
More file actions
90 lines (65 loc) · 2.59 KB
/
Copy pathadminStockReportPrint.php
File metadata and controls
90 lines (65 loc) · 2.59 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
session_start();
include "connection.php";
if (isset($_SESSION["a"])) {
$rs = Database::search("SELECT * FROM `stock` INNER JOIN `product` ON `stock`.`product_id` = `product`.`id` ORDER BY `stock`.`stock_id` ASC");
$num = $rs->num_rows;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bootstrap.css" />
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="resource/img/icon1.svg"/>
<title>Stock Report</title>
</head>
<body>
<div class="container mt-4 printbtn">
<a href="adminReport.php"><img src="resources/back.png" style="width: 50px; cursor: pointer;" /></a>
</div>
<div class="justify-content-center align-content-center d-flex">
<div class="container mt-4">
<h2 class="text-center ">Stock Report</h2>
<table class="table table-hover table-bordered mt-5 text-center">
<thead>
<tr>
<th>Stock ID</th>
<th>Product Name</th>
<th>Stock Qty</th>
<th>Unit Price</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < $num; $i++) {
$d = $rs->fetch_assoc();
?>
<tr>
<td><?php echo $d["stock_id"] ?></td>
<td><?php echo $d["name"] ?></td>
<td><?php echo $d["qty"] ?></td>
<td><?php echo $d["price"] ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="container d-flex justify-content-center mt-5 mb-5 gap-4">
<button class="btn btn-outline-dark col-2 printbtn" onclick="window.print()">Print</button>
<!-- <button class="btn btn-outline-danger text-light col-2" >Download</button> -->
</div>
<script src="script.js"></script>
<script src="bootstrap.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</body>
</html>
<?php
} else {
echo ("You are not a valid admin");
}
?>