Repository navigation
Expand file tree
/
Copy pathadminProductReportPrint.php
More file actions
93 lines (68 loc) · 2.59 KB
/
Copy pathadminProductReportPrint.php
File metadata and controls
93 lines (68 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
91
92
93
<?php
session_start();
include "connection.php";
if (isset($_SESSION["a"])) {
$rs = Database::search("SELECT * FROM `product`
INNER JOIN `category` ON `product`.`category_cat_id`=`category`.`cat_id`
INNER JOIN `size` ON `product`.`size_size_id`=`size`.`size_id` ORDER BY `product`.`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>Product Report</title>
</head>
<body>
<div class="container mt-3">
<a href="adminReport.php"><img src="Resources/back.png" height="25"></a>
</div>
<div id="printarea">
<div class="container mt-3">
<h2 class="text-center ">Product Report</h2>
<table class="table table-hover mt-5">
<thead>
<tr>
<th>Product ID</th>
<th>Product Name</th>
<th>Category</th>
<th>Description</th>
<th>Image</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < $num; $i++) {
$d = $rs->fetch_assoc();
?>
<tr>
<td><?php echo $d["id"] ?></td>
<td><?php echo $d["name"] ?></td>
<td><?php echo $d["category_name"] ?></td>
<td><?php echo $d["description"] ?></td>
<td><img src="<?php echo $d["path"] ?>" height="100" /></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="container mt-3 d-flex justify-content-end">
<button class="btn btn-outline-dark col-2" onclick="window.printDiv()">Print</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");
}
?>