-
Notifications
You must be signed in to change notification settings - Fork 0
/
display_complaints.php
73 lines (62 loc) · 2.6 KB
/
display_complaints.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
<?php
require('top.inc.php');
$admin_reply = '';
if ($_SESSION['loggedin']) {
$customer_id = $_SESSION['id'];
} else {
echo "<script> location.href='index.php'; </script>";
}
$sql = "SELECT * FROM complaints where customer_id = '$customer_id'order by order_id";
$result = $con->query($sql);
$row = $result->fetch_assoc();
$complaint = $row["complaint"];
$order_id = $row["order_id"];
$complaint_date = $row["complaint_date"];
$admin_reply = $row["admin_reply"];
//echo $admin_reply;
if (isset($_GET['id']) && $_GET['id'] != '') {
$id = get_safe_value($con, $_GET['order_id']);
$res = mysqli_query($con, "select * from orders where order_id='$id' and customer_id='$customer_id'");
// var_dump($res);
$check = mysqli_num_rows($res);
if ($check > 0) {
$row = mysqli_fetch_assoc($res);
$order_id = $row['order_id'];
}
}
?>
<div class="content pb-0">
<div class="animated fadeIn">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header" style="text-align:center"><strong>Previous Complaints</strong></div>
<form method="post" enctype="multipart/form-data">
<div class="card-body card-block">
<div class="form-group">
<label for="customer_id" class=" form-control-label">customer_id</label>
<input type="text" name="customer_id" class="form-control" required value="<?php echo $customer_id ?>" readonly>
</div>
<div class="form-group">
<label for="order_id" class=" form-control-label">order_id</label>
<input type="text" name="order_id" class="form-control" required value="<?php echo $order_id ?>" readonly>
</div>
<div class="form-group">
<label for="complaint" class=" form-control-label">complaint</label>
<input type="text" name="complaint" class="form-control" required value="<?php echo $complaint ?>" readonly>
</div>
<div class="form-group">
<label for="admin_reply" class=" form-control-label">admin_reply</label>
<input type="text" name="admin_reply" class="form-control" required placeholder="You will show your Reply here When the Admin will get back to you!! "required value="<?php echo $admin_reply ?>" readonly>
</div>
<div class="form-group">
<label for="contact" class=" form-control-label">complaint_date</label>
<input type="text" name="complaint_date" class="form-control" required value="<?php echo $complaint_date ?>" readonly>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>