-
Notifications
You must be signed in to change notification settings - Fork 0
/
products_report.php
56 lines (46 loc) · 1.86 KB
/
products_report.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
<?php
include "db_conn.php";
if (isset($_POST['productid'])) {
$productid = $_POST["productid"];
$sql1 = "SELECT * FROM `product_report` WHERE `productid` = '$productid'";
$result1 = mysqli_query($conn, $sql1);
if (mysqli_num_rows($result1) > 0) {
while ($row1 = mysqli_fetch_assoc($result1)) {
$id = $row1['id'];
$user = $row1['user'];
$issue = $row1['issue'];
$statement = $row1['statement'];
$date = $row1['date'];
$time = $row1['time'];
$sql2 = "SELECT * FROM `account` WHERE `username` = '$user'";
$result2 = mysqli_query($conn, $sql2);
if (mysqli_num_rows($result2) > 0) {
while ($row2 = mysqli_fetch_assoc($result2)) {
$profile = $row2['profile'];
echo '
<div class="report-cons">
<div class="report-img-cons">
<img src="documents/profile/'.$profile.'" alt="" class="report-profile-imgs">
</div>
<div class="report-des-cons">
<h1 class="report-title">'.$issue.'</h1>
<h2 class="report-username">'.$user.'</h2>
<h3 class="report-comment">'.$statement.'</h3>
</div>
<div class="report-btn-grp">
<i class="fa-solid fa-check" id="accept-report" onclick="acceptReport('.$id.')"></i>
<i class="fa-solid fa-x" id="reject-report" onclick="rejectReport('.$id.')"></i>
</div>
</div>';
}
} else {
echo "Failed";
}
}
} else {
echo "";
}
} else {
echo "Unknown1";
}
?>