forked from pcsaini/hotel_management_system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
complain.php
169 lines (153 loc) · 7.66 KB
/
complain.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Complaint</li>
</ol>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Complaint</h1>
</div>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">Make Complaint</div>
<div class="panel-body">
<?php
if (isset($_GET['error'])) {
echo "<div class='alert alert-danger'>
<span class='glyphicon glyphicon-info-sign'></span> Error on Complaint !
</div>";
}
if (isset($_GET['success'])) {
echo "<div class='alert alert-success'>
<span class='glyphicon glyphicon-info-sign'></span> Complaint Successfully Added !
</div>";
}
?>
<form role="form" data-toggle="validator" method="post" action="ajax.php">
<div class="row">
<div class="form-group col-lg-6">
<label>Complainant Name</label>
<input type="text" class="form-control" placeholder="Complainant Name" name="complainant_name" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-6">
<label>Type Of Complaint</label>
<input type="text" class="form-control" placeholder="Complaint Type" name="complaint_type" required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group col-lg-12">
<label>Complaint Description</label>
<textarea class="form-control" name="complaint" placeholder="Complaint" required></textarea>
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary" name="createComplaint">Submit</button>
<button type="reset" class="btn btn-lg btn-danger">Reset</button>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">Complaint Management</div>
<div class="panel-body">
<?php
if (isset($_GET['resolveError'])) {
echo "<div class='alert alert-danger'>
<span class='glyphicon glyphicon-info-sign'></span> Error on Resolve !
</div>";
}
if (isset($_GET['resolveSuccess'])) {
echo "<div class='alert alert-success'>
<span class='glyphicon glyphicon-info-sign'></span> Complaint Successfully Resolve !
</div>";
}
?>
<table class="table table-striped table-bordered table-responsive" cellspacing="0" width="100%" id="rooms">
<thead>
<tr>
<th>Sr. No</th>
<th>Complainant Name</th>
<th>Type Of Complaint</th>
<th>Complaint</th>
<th>Created Date</th>
<th>Resolve</th>
<th>Budget</th>
</tr>
</thead>
<tbody>
<?php
$complaint_query = "SELECT * FROM complaint";
$complaint_result = mysqli_query($connection, $complaint_query);
if (mysqli_num_rows($complaint_result) > 0) {
$num = 0;
while ($complaint = mysqli_fetch_assoc($complaint_result)) {
$num++
?>
<tr>
<td><?php echo $num ?></td>
<td><?php echo $complaint['complainant_name'] ?></td>
<td><?php echo $complaint['complaint_type'] ?></td>
<td><?php echo $complaint['complaint'] ?></td>
<td><?php echo date('M j, Y',strtotime($complaint['created_at'])) ?></td>
<td>
<?php if(!$complaint['resolve_status']){
echo '<button class="btn btn-success" data-toggle="modal" data-target="#complaintModal" data-id="' . $complaint['id'] . '" id="complaint">Resolve</a>';
} else{
echo date('M j, Y',strtotime($complaint['resolve_date']));
}
?>
</td>
<th><?php echo $complaint['budget'] ?></th>
</tr>
<?php }
} else {
echo "No Rooms";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Add Room Modal -->
<div id="complaintModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Complaint Resolve</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-12">
<form data-toggle="validator" role="form" method="post" action="ajax.php">
<div class="form-group">
<label>Budget</label>
<input class="form-control" placeholder="Budget" name="budget" data-error="Enter Budget" required>
<div class="help-block with-errors"></div>
</div>
<input type="hidden" id="complaint_id" name="complaint_id" value="">
<button class="btn btn-success pull-right" name="resolve_complaint">Resolve Complaint</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<p class="back-link">MIS Developed by <a href="https://www.pcsaini.in">pcsaini</a></p>
</div>
</div>
</div> <!--/.main-->