-
Notifications
You must be signed in to change notification settings - Fork 0
/
vendor_product_approval.php
188 lines (173 loc) · 6.49 KB
/
vendor_product_approval.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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
include "includes/vendor_session.php";
include_once "includes/database.php";
$vendorid = $_SESSION["vendorid"]; // USE SESSIONS
$approvprodrows = mysqlidb::fetchAllRows("SELECT * FROM product
WHERE ProductStatus = 'Approved'
AND VendorId = $vendorid
AND ProductStock > 0");
$outofstockprodrows = mysqlidb::fetchAllRows("SELECT * FROM product
WHERE ProductStatus = 'Approved'
AND VendorId = $vendorid
AND ProductStock <= 0");
$pendingprodrows = mysqlidb::fetchAllRows("SELECT * FROM product
WHERE ProductStatus = 'Pending'
AND VendorId = $vendorid");
$rejectedprodrows = mysqlidb::fetchAllRows("SELECT * FROM product
WHERE ProductStatus = 'Denied'
AND VendorId = $vendorid");
$blacklistprodrows = mysqlidb::fetchAllRows("SELECT * FROM product
WHERE ProductStatus = 'Blacklisted'
AND VendorId = $vendorid");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="images/shirtlogo.png" type="image/x-icon">
<link rel="stylesheet" href="styles/template.css" />
<link rel="stylesheet" href="styles/vendor.css" />
<link rel="stylesheet" href="styles/pagetopbar.css" />
<title>Chapalang Clothes</title>
</head>
<body>
<!-- ----------------------------------- TOP-BAR ----------------------------------- -->
<?php include "includes/pagetopbar.php" ?>
<!-- ----------------------------------- TOP-BAR ----------------------------------- -->
<div class="body-wrapper">
<div></div>
<!-- ----------------------------------- BODY ----------------------------------- -->
<div class="content-wrapper container">
<div class="vendor-container">
<?php
include("includes/vendor_sidenav.php");
?>
<div class="vendor-body">
<input type="text" class="w-4 m-t-2" id="product-search" placeholder="Search" onkeyup="filterProducts(this.value)">
<div class="header-group">
<h3>Approved Products</h3>
<hr>
</div>
<div class="approvalimgs">
<?php
if (count($approvprodrows) > 0) {
foreach ($approvprodrows as $row) {
$productimages = explode(",", $row['ProductImage'])[0];
echo "<a class=\"item-card\" href=\"vendor_product_page.php?productid={$row['ProductId']}\">
<img class=\"item-image\" src=\"$productimages\">
<div class=\"item-name\">
$row[ProductName]
</div>
</a>
";
}
} else {
echo "<h3 class=\"cultured-dark\">You have no approved products.</h3>";
}
?>
</div>
<br>
<div class="header-group">
<h3>Pending Approval</h3>
<hr>
</div>
<div class="approvalimgs">
<?php
if (count($pendingprodrows) > 0) {
foreach ($pendingprodrows as $row) {
$productimages = explode(",", $row['ProductImage'])[0];
echo "<a class=\"item-card\" href=\"vendor_product_page.php?productid={$row['ProductId']}\">
<img class=\"item-image\" src=\"$productimages\">
<div class=\"item-name\">
$row[ProductName]
</div>
</a>
";
}
} else {
echo "<h3 class=\"cultured-dark\">You have no pending products.</h3>";
}
?>
</div>
<br>
<div class="header-group">
<h3>Out of Stock</h3>
<hr>
</div>
<div class="approvalimgs">
<?php
if (count($outofstockprodrows) > 0) {
foreach ($outofstockprodrows as $row) {
$productimages = explode(",", $row['ProductImage'])[0];
echo "<a class=\"item-card\" href=\"vendor_product_page.php?productid={$row['ProductId']}\">
<img class=\"item-image\" src=\"$productimages\">
<div class=\"item-name\">
$row[ProductName]
</div>
</a>
";
}
} else {
echo "<h3 class=\"cultured-dark\">All your products are in stock.</h3>";
}
?>
</div>
<br>
<div class="header-group">
<h3>Rejected Products</h3>
<hr>
</div>
<div class="approvalimgs">
<?php
if (count($rejectedprodrows) > 0) {
foreach ($rejectedprodrows as $row) {
$productimages = explode(",", $row['ProductImage'])[0];
echo "<a class=\"item-card\" href=\"vendor_product_page.php?productid={$row['ProductId']}\">
<img class=\"item-image\" src=\"$productimages\">
<div class=\"item-name\">
$row[ProductName]
</div>
</a>
";
}
} else {
echo "<h3 class=\"cultured-dark\">You have no rejected products.</h3>";
}
?>
</div>
<br>
<div class="header-group">
<h3>Blacklisted Products</h3>
<hr>
</div>
<div class="approvalimgs">
<?php
if (count($blacklistprodrows) > 0) {
foreach ($blacklistprodrows as $row) {
$productimages = explode(",", $row['ProductImage'])[0];
echo "<a class=\"item-card\" href=\"vendor_product_page.php?productid={$row['ProductId']}\">
<img class=\"item-image\" src=\"$productimages\">
<div class=\"item-name\">
$row[ProductName]
</div>
</a>
";
}
} else {
echo "<h3 class=\"cultured-dark\">You have no blacklisted products.</h3>";
}
?>
</div>
<br><br><br>
</div>
</div>
</div>
<!-- ----------------------------------- BODY ----------------------------------- -->
<!-- ----------------------------------- FOOTER ----------------------------------- -->
<?php include "includes/footeremployee.html" ?>
<!-- -----------------------------------FOOTER----------------------------------- -->
</div>
</body>
<script src="scripts/vendor_page.js"></script>
</html>