-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewfeedback.php
166 lines (164 loc) · 5.54 KB
/
viewfeedback.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
<?php
include("header.php");
if (!isset($_SESSION['staffid'])) {
echo "<script>window.location='index.php';</script>";
}
if (isset($_GET['delid'])) {
$sql = "DELETE FROM feedback WHERE feedback_id='$_GET[delid]'";
$qsql = mysqli_query($con, $sql);
echo mysqli_error($con);
if (mysqli_affected_rows($con) == 1) {
echo "<SCRIPT>alert('Feedback deatils deleted successfully...');</SCRIPT>";
echo "<script>window.location='viewfeedback.php';</script>";
}
}
function is_image($path)
{
$a = getimagesize($path);
$image_type = $a[2];
if (in_array($image_type, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP))) {
return true;
}
return false;
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>View Feedback</h2>
</div>
</div>
<!-- Sub Banner End -->
<!-- iqoniq Contant Wrapper Start-->
<div class="iqoniq_contant_wrapper">
<section class="gray-bg aboutus-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="about-us">
<div class="text">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Customer</th>
<th style="width: 150px;">Feedback For</th>
<th>Feedback</th>
<th>Ratings</th>
<th style="width: 100px;">Publish Date</th>
<th style="width: 150px;">Action</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT feedback.*,customer.customer_name FROM feedback LEFT JOIN customer ON customer.customer_id=feedback.customer_id";
$qsql = mysqli_query($con, $sql);
while ($rs = mysqli_fetch_array($qsql)) {
$tofor = "";
if ($rs['tourism_placeid'] != 0) {
$sqltourism_place = "SELECT * FROM tourism_place WHERE tourism_placeid='$rs[tourism_placeid]'";
$qsqltourism_place = mysqli_query($con, $sqltourism_place);
$rstourism_place = mysqli_fetch_array($qsqltourism_place);
$tofor = $rstourism_place['tourism_place'] . " Tourism...";
}
if ($rs['hotel_id'] != 0) {
$sqltourism_place = "SELECT * FROM hotel WHERE hotel_id='$rs[hotel_id]'";
$qsqltourism_place = mysqli_query($con, $sqltourism_place);
$rstourism_place = mysqli_fetch_array($qsqltourism_place);
$tofor = "Hotel" . $rstourism_place['hotel_name'];
}
echo "<tr>
<td>$rs[customer_name]</td>
<td>$tofor</td>
<td>$rs[feedback]";
echo "<br>";
if ($rs['tourism_placeid'] != 0) {
$sqlimg = "SELECT * FROM gallery WHERE tourism_placeid='$rs[0]' and status='Active' AND gallerytype='Feedback'";
$qsqlimg = mysqli_query($con, $sqlimg);
echo mysqli_error($con);
while ($rsimg = mysqli_fetch_array($qsqlimg)) {
$path = "imgfeedback/" . $rsimg['upload_file'];
if (is_image($path) == true) {
?>
<img src="<?php echo $path; ?>" style="width: 50px;height:50px;cursor: pointer;" onclick="loadfile('1','<?php echo $path; ?>')" data-toggle="modal" data-target="#ModalLoadGallery">
<?php
} else {
?>
<img src="images/vidimg.png" style="width: 50px;height:50px;cursor: pointer;" onclick="loadfile('2','<?php echo $path; ?>')" data-toggle="modal" data-target="#ModalLoadGallery">
<?php
}
}
}
echo "</td>
<td>$rs[ratings] stars</td>
<td>" . date("d-M-Y", strtotime($rs['feedback_dt'])) . "</td>
<td>
";
if ($_SESSION['stafftype'] == "Administrator") {
echo "
<A href='viewfeedback.php?delid=$rs[0]' class='btn btn-danger' onclick='return confirmdel()'>Delete</a>";
if ($rs['tourism_placeid'] != 0) {
echo "<A href='feedbackpanel.php?location_id=$rs[tourism_placeid]' class='btn btn-primary' target='_blank' >View</a>";
}
if ($rs['hotel_id'] != 0) {
echo "<A href='hoteldetails.php?hotelid=$rs[hotel_id]' class='btn btn-primary' target='_blank'>View</a>";
}
}
echo "
</td>
</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- iqoniq Contant Wrapper End-->
<?php
include("footer.php");
?>
<script>
function confirmdel() {
if (confirm("Are you sure want to delete this record?") == true) {
return true;
} else {
return false;
}
}
</script>
<!-- Load Records starts here -->
<div class="modal fade" id="ModalLoadGallery" tabindex="-1" role="dialog">
<div class="modal-dialog login1 login5 login5-1">
<div class="modal-content">
<div class="user-box">
<!--FORM FIELD START-->
<div class="mg_input_1">
<!-- iqoniq Mina Banner Start-->
<div class="mg_hotel_banner">
<div class="mg_slider1" id="loadmodrec">
<center><img src="images/loadinggif.gif"></center>
</div>
</div>
<!-- iqoniq Mina Banner End-->
</div>
<!--FORM FIELD END-->
</div>
</div>
</div>
</div>
<!-- Load detailed Records ends here -->
<script>
function loadfile(filetype, path) {
document.getElementById("loadmodrec").innerHTML = '<center><img src="images/loadinggif.gif"></center>';
if (filetype == 1) {
document.getElementById("loadmodrec").innerHTML = "<img src='" + path + "' style='width: 100%'>";
}
if (filetype == 2) {
document.getElementById("loadmodrec").innerHTML = "<video width='100%' height='500' controls><source src='" + path + "' type='video/mp4'></video>";
}
}
</script>