-
Notifications
You must be signed in to change notification settings - Fork 0
/
complaint.php
129 lines (98 loc) · 3.72 KB
/
complaint.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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css" >
<?php include_once('php/includes/common-css-js.php'); ?>
<link rel="stylesheet" href="styles/admintable.css"/>
<title>Complaints</title>
</head>
<body>
<?php
include("php/templates/header.php");
include_once 'php\includes\dbcon.php';
//Request table
$sql1="SELECT complaint_id,description,reviewed,complaint_type,request_id,user_id,create_date FROM request_complaints ";
$result2=$con->query($sql1);
//Shows the Request table details
if ($result2->num_rows > 0) {
echo("<h1 style='text-align:center;'>Request Complaints</h1>");
echo("<table class='table1'>");
echo("<th>Complaint ID</th>");
echo("<th>Complaint Type</th>");
echo("<th>Request ID</th>");
echo("<th>User ID</th>");
echo("<th>Description</th>");
echo("<th>Reviewed</th>");
echo("<th>Action</th>");
echo("<th>Complaint</th>");
while($row = $result2->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row["complaint_id"]."</td>";
echo "<td>".$row["complaint_type"]."</td>";
echo "<td>".$row["request_id"]."</td>";
echo "<td>".$row["user_id"]."</td>";
echo "<td>".$row["description"]."</td>";
if($row["reviewed"]==1){
echo "<td>Yes</th>";
}else{
echo "<td>No</th>";
}
?>
<td class="delete"><a style="text-decoration: none;" href="php\controllers\request-complaints-ctrl.php?complaint_id=<?php echo $row["complaint_id"]; ?>">Delete</a></td>
<td class="viewws"><a style="text-decoration: none;" href="review-complaint.php?id=<?php echo $row["complaint_id"]; ?>&type=request">View</a></td>
<?php
echo "</tr>";
}
echo ("</table>");
}else{
echo ('<h1 class="warnings">The Request complaint table is empty</h1>');
}
echo "<hr>";
/////////////////////////////////////////////////////////////////////////////
include_once 'php\includes\dbcon.php';
//Sale table
$sql1="SELECT complaint_id,description,reviewed,complaint_type,sale_id,user_id,create_date FROM sale_complaints ";
$result2=$con->query($sql1);
//Shows the Sale table details
if ($result2->num_rows > 0) {
echo("<h1 style='text-align:center;'>Sale Complaints</h1>");
echo("<table class='table1'>");
echo("<th>Complaint ID</th>");
echo("<th>Complaint Type</th>");
echo("<th>Sale ID</th>");
echo("<th>User ID</th>");
echo("<th>Description</th>");
echo("<th>Reviewed</th>");
echo("<th>Action</th>");
echo("<th>Complaint</th>");
while($row = $result2->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row["complaint_id"]."</td>";
echo "<td>".$row["complaint_type"]."</td>";
echo "<td>".$row["sale_id"]."</td>";
echo "<td>".$row["user_id"]."</td>";
echo "<td>".$row["description"]."</td>";
if($row["reviewed"]==1){
echo "<td>Yes</th>";
}else{
echo "<td>No</th>";
}
?>
<td class="delete"><a style="text-decoration: none;" href="php\controllers\sale-complaint-ctrl.php?complaint_id=<?php echo $row["complaint_id"]; ?>">Delete</a></td>
<td class="viewws"><a style="text-decoration: none;" href="review-complaint.php?id=<?php echo $row["complaint_id"]; ?>&type=sale">View</a></td>
<?php
echo "</tr>";
}
echo ("</table>");
}else{
echo ('<h1 class="warnings">The Sale complaint table is empty</h1>');
}
$con->close();
include("php/templates/footer.php");
?>
</body>
</html>