-
Notifications
You must be signed in to change notification settings - Fork 0
/
makecomplaint.php
140 lines (98 loc) · 3.73 KB
/
makecomplaint.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
<?php
ob_start();
include 'css/style.css';
session_start();
include 'connection1.php';
include 'userheader.php';
$n666 = $_SESSION['login'];
$sql = "select * from complaint where rname = '$n666' ";
$result = $conn->query($sql);
?>
<html>
<head>
<title>products </title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<a href="userhome.php"><h3> <font color="#0000FF" > <span class="material-icons" >arrow_circle_left</span></font></h3></a>
<center>
<div class="col-md-12">
<form name="registration" method="post">
<table>
<tr>
<td id="center"><h4>Complaint registration</h4></td>
</tr>
<tr>
<td><input name="order" type="text" placeholder="Order No" required></td>
</tr>
<tr>
<td><input name="ctext" type="text" placeholder=" complaint" maxlength="1000" required></td>
</tr>
<tr id="center">
<td><input name="submit" type="submit" value="Register" onclick="myFunction()"></td>
</tr>
</table></form></center>
<?php
if(isset($_POST['submit'])){
$on = $_POST['order'];
$rto = $_POST['ctext'];
$sql11 = "select orderdis from orders where id ='$on'";
$result11 = $conn->query($sql11);
if($result11->num_rows > 0){
while($row=$result11->fetch_assoc()){
$_SESSION['randomfun']= $row['orderdis'];}}
$door = $_SESSION['randomfun'];
$timec = date("h:i:sa");
$datec = date("d/m/Y");
$names=$_SESSION['login'];
$sql2= "insert into complaint(complaint,dname,rname,cdate,ctime,cstatus)values('$rto','$door','$names','$datec','$timec','$on')";
$result12 = $conn->query($sql2);
if($result12){
header("location:makecomplaint.php");
}
}
?> <div class="div-center">
<table class="table table-hover" id="list">
<tr>
<th>OrderNo </th>
<th>complaint </th>
<th>Date and time </th>
<th>Response </th>
</tr>
<tr >
<?php
if($result->num_rows > 0){
while($row=$result->fetch_assoc()){
?>
<td><?php echo $row['cstatus']; ?></td>
<td><?php echo $row['complaint']; ?></td>
<td><?php echo $row['cdate']; ?><br><?php echo $row['ctime']; ?></td>
<td><?php echo $row['creply']; ?></td>
</tr>
</div>
<?php
}
}
if(isset($_POST['delete'])){
$id = $_POST['delete'];
$sql2 = "delete from tbl_containment where id= '$id' ";
$result = $conn->query($sql2);
if($result){
header("Location:staff_view_containment.php");
echo 'Data Deleted';
}
}
?>
</table> </div>
</div>
</body>
<script>
function myFunction() {
confirm("Registered Successfully");
}
</script>
</html>