-
Notifications
You must be signed in to change notification settings - Fork 0
/
review.php
196 lines (165 loc) · 4.18 KB
/
review.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<html>
<?php
session_start();
$e=$_SESSION['username'];
$msg='';
$msg1='';
$host="remotemysql.com";
$dbusername="M2M1cnixjh";
$dbpassword="RMelnhl7c8";
$db="M2M1cnixjh";
$cn = mysqli_connect($host, $dbusername, $dbpassword, $db);
if(isset($_POST['submit'])){
$Restaurantname=$_POST['rn'];
$reviews = $_POST['rv'];
$userId=$e;
$resti=mysqli_query($cn,"select restid from restaurant where restname='$Restaurantname';");
$retrieve=mysqli_fetch_array($resti);
if(empty($retrieve))
{
$msg = "<div class='msg1'><h3 style='color:red;'>Invalid restaurant name!</h3></div>";
}
else{
$restid =$retrieve['restid'];
$sql="insert into review(reviews,restid,userid) values ('$reviews','$restid','$e');";
mysqli_query($cn,$sql);
$msg1="<div class='msg'><h3 style='color:green';>You review has been recorded!</h3></div>";
}
}
?>
<head>
<link rel="stylesheet" type="text/css" href="restaurant.css">
<style>
.msg
{
padding-left: 49%;
}
.msg1
{
padding-left: 50%;
}
body
{
background-color:#fff;
}
form
{
padding-left: 18%;
padding-top: 7%;
font-family: arial,georgia;
font-size: 100%;
color: #fff;
border:25px;
}
}
textarea
{
resize: none;
}
textarea
{
width: 320px;
height: 250px;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
resize: none;
}
h1{
padding-left: : 13%;
margin: 0px;
font-size: 35px;
font-display: center;
font-family: arial,georgia;
}
hr
{
display: block;
unicode-bidi: isolate;
margin-block-start: 0.5em;
margin-block-end: 0.5em;
margin-inline-start: auto;
margin-inline-end: auto;
overflow: hidden;
border-style: inset;
border-width: 1px;
}
input{
background: transparent;
border: none;
border-bottom: 1px solid #fff;
color: #fff;
height: 40px;
font-size: 66%;
}
.box
{ width:500px;
height: 505px;
background: #000;
color:#fff;
position: absolute;
top:23%;
left: 41%;
}
.box input[type="submit"]
{
border: none;
outline: none;
height: 40px;
background: #fb2525;
color: #fff
font-size:18px;
}
.box input[type="submit"]:hover
{
cursor: pointer;
background: #ffc107;
color:#000;
}
.b3
{
margin-left: 18%;
height: 35%;
width:50%;
}
</style>
</head>
<body>
<br>
<h1>WRITE REVIEWS</h1>
<br>
<hr>
<div class="sidenav">
<br>
<a href="profile.php">Profile</a><br>
<a href="home.html">Home</a><br>
<a href="reviews.html">Review</a><br>
<a href="restaurant.html">Reserve</a><br>
<a href="logout.php">Logout</a><br>
</div>
<div class="box">
<form method="POST">
<label>Restaurant Name : </label>
<select id="rn" name="rn">
<option value="Grasshopper">Grasshopper</option>
<option value="Empire Restaurant">Empire Restaurant</option>
<option value="Stories">Stories</option>
<option value="House of Commons">House of Commons</option>
<option value="The Permit Room">The Permit Room</option>
<option value="Roots">Roots</option>
<option value="The Barbecue Kingdom">The Barbecue Kingdom</option>
<option value="Rolls & Bowls">Rolls & Bowls</option>
<option value="The Rice Bowl">The Rice Bowl</option>
</select>
<br><br><br>
<label>Review : </label>
<br><br>
<textarea name="rv" placeholder="Enter your Review Here" ></textarea></br>
<br>
<input type="submit" name ="submit" value="Submit" class="b3">
</form>
</div>
</body>
<?php echo $msg; ?>
<?php echo $msg1; ?>
</html>