-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreview-complaint.php
148 lines (107 loc) · 3.36 KB
/
review-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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
//connecting to the DB
require 'php/includes/dbcon.php';
include_once('php/includes/complaintFunctions.php');
//checking for data availability
if(isset($_GET['id']))
{
{
$cID = $_GET["id"];
$type = $_GET["type"];
//making sql query based on type
if($type="sale")
{
$sql = "SELECT * FROM sale_complaints WHERE complaint_id=$cID";
}
elseif($type="request")
{
$sql = "SELECT * FROM request_complaints WHERE complaint_id=$cID";
}
else
{
echo "Error!!!!";
}
//getting sql results
$result = $con->query($sql);
//results in array
$row= $result->fetch_assoc();
}
}//keeping session
elseif(isset($_POST["action"]))
{
echo $_POST["action"];
echo $_POST["user_id"];
modAction($_POST['action'], $_POST['user_id']);
reviewed($_POST['type']);
die();
}
else{
echo "Error loading Complaint!";
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include_once('php/includes/common-css-js.php');
?>
<script src="js/complaintFunctions.js"></script>
<link rel="stylesheet" href="styles/complaint-review.css">
</head>
<body>
<style>
table
{
border-style: groove;
border: 5px solid black;
}
tr{
border: 5px solid black;
border-right: 5px solid black;
}
.reviewContainer{
padding: 100px;
}
</style>
<?php
//linking header
include("php/templates/header.php");
?>
<!-- printing details-->
<center>
<div class="reviewContainer ">
<div class="cInfo"> Complaint ID: <?php echo $row["complaint_id"]?></div>
<div class="cInfo"> Reported By: <?php echo $row["user_id"]?></div>
<div class="cInfo"> Date of Complaint: <?php echo $row["create_date"]?></div>
<hr>
<?php if($type="sale")
{
echo "<div class=\"complaint\"> Post ID:" .$row['sale_id'] . "</div>";
}
else
{
echo "<div class=\"complaint\"> Post ID:". $row["request_id"] ."</div>";
}
?>
<div class="complaint2"> Complaint Type: <?php echo $row["complaint_type"]?></div>
<div class="desc"> Description: <?php echo $row["description"]?></div>
<hr>
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<label for="action" id=saction">SELECT AN ACTION</label>
<select name="action" id="mAction" class="maction" title="Please Select an Action" required >
<option value="warn" id="warn">Warn User</option>
<option value="suspend" id="suspend">Suspend User</option>
<option value="ban" id="ban">Ban User</option>
<option value="noAction" id="none">Ignore</option>
</select>
<!-- review button-->
<input type="hidden" name="user_id" value=<?php echo $row["user_id"]; ?>>
<input type="submit" name="submit" id="reviewed" class="sbbtn" value="Mark as Reviewed" onclick="takeAction()">
</form>
</div>
</center>
<?php
include("php/templates/footer.php"); //linking footer
?>
</body>
</html>