-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinventory.php
More file actions
145 lines (140 loc) · 8.11 KB
/
inventory.php
File metadata and controls
145 lines (140 loc) · 8.11 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
include 'db_connection.php';
?>
<?php
session_start();
$table = "SELECT * FROM products";
$query = mysqli_query($conn, $table);
?>
<?php
include 'templates/head.html';
include 'templates/nav-admin.php';
?>
<main class="flex w-full">
<?php
include 'templates/admin-side-bar.php';
?>
<section class="w-full p-4">
<div class="w-full text-md">
<div class="bg-white shadow sm:rounded">
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="bg-white p-8 rounded-md w-full">
<div class=" flex items-center justify-between pb-6">
<div>
<h2 class="text-gray-600 font-semibold">Inventory</h2>
</div>
<div class="flex items-center justify-between">
</div>
</div>
<!--Table-->
<div>
<div class="-mx-4 sm:-mx-8 px-4 sm:px-8 py-4 overflow-x-auto">
<div class="inline-block min-w-full shadow rounded-lg overflow-hidden">
<!--Table Header-->
<table class="min-w-full leading-normal">
<thead>
<tr>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Product Name
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Description
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Category
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Brand
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Price
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Quantity
</th>
<th
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Date
</th>
</tr>
</thead>
<!--Table Body-->
<tbody>
<?php
$row = mysqli_num_rows($query);
if($row > 0) {
while($res = mysqli_fetch_array($query)) {
?>
<tr>
<!--Product name-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 overflow-wrap:break-words">
<?php echo $res['title'] ?>
</p>
</td>
<!--Description-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 overflow-wrap:break-words">
<?php echo $res['description'] ?>
</p>
</td>
<!--Category-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">
<?php echo $res['categories'] ?>
</p>
</td>
<!--Brand-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">
<?php echo $res['brand'] ?>
</p>
</td>
<!--Price-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">
<?php echo $res['price'] ?>
</p>
</td>
<!--Quantity-->
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">
<?php echo $res['quantity'] ?>
</p>
</td>
<!--Date-->
<td class="px-2 py-5 border-b border-gray-200 bg-white text-sm">
<p class="text-gray-900 whitespace-no-wrap">
<?php
$currDate = $res['create_date'];
$changeDate = date("F-d-Y", strtotime($currDate));
echo $changeDate;
?>
</p>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!------>
</div>
</div>
</div>
</div>
</section>
</main>
<?php
include 'templates/footer.html';
?>