-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview_feedback.php
73 lines (57 loc) · 1.58 KB
/
view_feedback.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
/**
* Version : 0.1
* Author: Luka Antolic-Soban
*/
/* get connect to MYSQL server */
require 'connect.php';
/* instances for search engine */
$location = "";
$rating ="";
$comment = "";
$query = "";
$result = "";
$table = "";
$items = array();
$review_location = "";
if (isset($_POST['Check'])) {
$location = $_POST['location']; //location
$query = "SELECT Rating, Comment FROM Review WHERE Location = '$location'";
$result=mysql_query($query);
$table .= "<table border='1' style = 'width:100%'>";
$table .= "<tr><th>Rating</th><th>Comment</th></tr>";
while($row = mysql_fetch_assoc($result)) {
$table.= "<tr><td>" . $row['Rating'] . "</td><td>" . $row['Comment'] . "</td></tr>";
}
$table .= "</table>";
$review_location .= "Reviews of " . $location . " location:";
}
if (isset($_POST['back'])) {
header("Location: customer_panel.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>View Review</title>
</head>
<body>
<div style="text-align:center">VIEW FEEDBACK</div>
Location:
<form method="post">
<select name="location">
<option value="Atlanta">Atlanta</option>
<option value="Charlotte">Charlotte</option>
<option value="Savannah">Savannah</option>
<option value="Orlando">Orlando</option>
<option value="Miami">Miami</option>
</select>
<input type='submit' name='Check' value='Check Reviews' />
<br></br>
<input type='submit' name='back' value='Go Back' />
</form>
<br></br>
<p><big><?php echo $review_location; ?> </big></p>
<div id="mydiv"><?php echo $table; ?></div>
</body>
</html>