-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRatingForm.php
More file actions
89 lines (70 loc) · 3.31 KB
/
RatingForm.php
File metadata and controls
89 lines (70 loc) · 3.31 KB
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
<?php
require './Classes/Room.php';
require './Classes/Reviews.php';
use Classes\Reviews;
use Classes\Room;
$room= Room::showRoomDetails();
?>
<!DOCTYPE html>
<html data-bs-theme="light" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Rating Form</title>
<link rel="stylesheet" href="assets/css/review-Form.css">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
</head>
<body>
<?php
$message="";
if($_SERVER["REQUEST_METHOD"]==="POST"){
$selected_room_name=$_POST["room_type"];
$rating=$_POST["rate"];
$review_body=$_POST["review"];
$review=new Reviews($selected_room_name, $rating, $review_body);
$status=$review->addReview();
if($status){
$message="<p style='color:blue'>feedback send successfully.</p>";
}else{
$message="<p style='color:red'>failed to send the feedback!</p>";
}
}
?>
<section class="shadow contact-clean" style="background: #3269a8">
<form id="feedbackForm" class="bg-dark border rounded border-secondary shadow-lg" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" style="background: rgb(248,248,249);">
<h2 class="text-center text-white">Ratings and reviews</h2>
<?=$message?>
<div class="form-group mb-3">
<label class="form-label"> Select the Room</label>
<select class="form-select" name="room_type">
<?php
foreach ($room as $room){
?>
<option><?=$room->getRoomType();?></option>
<?php }?>
</select>
<br>
</div>
<div class="form-group mb-3">
<label for="rate" class="form-label"> Select your Rating</label>
<select class="form-select" name="rate">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<br>
</div>
<div class="form-group mb-3"><textarea class="form-control" name="review" placeholder="Review" rows="14" required/></textarea></div>
<div class="form-group mb-3"><button class="btn btn-primary" type="submit">Post </button> <button class="btn btn-primary" type="reset">Reset </button></div>
<div class="form-group mb-3">
<br>
<p class="text-center text-info" style="font-size: 12px;">Copyright © 2023 UWU/CST. All Rights Reserved.</p>
</div>
</form>
</section>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-init.js"></script>
</body>
</html>