-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheventbooking.php
211 lines (203 loc) · 10 KB
/
eventbooking.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
include('config.php');
$name=$email=$phone=$eventname=$date=$time='';
$errors=array('name'=>'','email'=>'','phone'=>'','other'=>'');
if(isset($_POST['submit'])){
if(empty($_POST['name'])){
$errors['name']="Enter the name field";
}
else{
$name=$_POST['name'];
if(!preg_match('/^[a-zA-Z\s]+$/',$name)){
$errors['name']="Name must contain only alphabets ans spaces";
}
}
if(empty($_POST['email'])){
$errors['email']="Enter the email field";
}
else{
$email=$_POST['email'];
if(!filter_var($email,FILTER_VALIDATE_EMAIL)){
$errors['email']= "Enter a valid email address";
}
}
if(empty($_POST['phone'])){
$errors['phone']="Enter the phone number";
}
else{
$phone=$_POST['phone'];
}
if(empty($_POST['eventname']) && empty($_POST['date']) && empty($_POST['time'])){
$errors['other']="Fill all the required fields";
}
else{
$eventname=$_POST['eventname'];
$time=$_POST['time'];
$date=$_POST['date'];
}
$query = "insert into event(name,email,phone,eventname,date,time) values('$name','$email','$phone','$eventname','$date','$time')";
$result = mysqli_query($conn, $query);
$rv=explode('-',$eventname);
$to =$email;
$subject = "Your Booking Details at The Grand Resort";
$txt ="THE GRAND RESORT"."\n"."Event Booking Details"."\n"."Name : ".$name."\n"."Phone No : ".$phone."\n"."Email Id: ".$email."\n"."Event Booked : ".$rv[0]."\n".
"Date : ".$date."\n".
"Time : ".$time."\n".
"Amount : ".$rv[1]."\n"."You have successfully submitted your booking details!!"."\n"."You can further proceed for the payment!!"."\n"."Payment option can be viewed under the reserved section!!"."\n"."Thank you!!";
mail($to,$subject,$txt);
header('Location: home.php');
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Booking</title>
<!-- font awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="css/booking.css">
</head>
<body>
<header>
<nav class="nav-wrapper brown lighten-1">
<a href="#" class="brand-logo "><b>THE GRAND RESORT</b></a>
<a href="#" class="sidenav-trigger" data-target="link"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li>
<a href="home.php"><b>HOME</b></a>
</li>
</ul>
<ul id="link" class="sidenav">
<li>
<a href="home.php"><b>HOME</b></a>
</li>
</ul>
</nav>
</header>
<div class="parallax-container">
<div class="parallax">
<img src="images/service.webp" class="responsive-img"> </div>
</div>
<div class="row">
<h5 class="brown-text center"><strong>BOOK YOUR EVENT AND CELEBRATE GRAND</strong></h5>
<div class="col container s10 m8 l6 offset-s1 offset-m2 offset-l3">
<div class="card z-depth-5 #ffebee red lighten-5">
<div class="card-content">
<div class="card-title brown-text center"><b>BOOKING FORM</b></div>
<div class="row">
<form action="eventbooking.php" method="POST" class="col s10 m8 l6 offset-s1 offset-m2 offset-l3">
<div class="row">
<div class="input-field">
<input type="text" placeholder="Name" name="name">
<label for="name" class="active brown-text"><strong>Name</strong></label>
<div class="red-text">
<?php echo $errors['name'];?>
</div>
</div>
</div>
<div class="row">
<div class="input-field">
<input type="tel" placeholder="Phone no" name="phone">
<label for="phn" class="active brown-text"><strong>Phone no</strong></label>
<div class="red-text">
<?php echo $errors['phone'];?>
</div>
</div>
</div>
<div class="row">
<div class="input-field">
<input type="email" placeholder="Email Id" name="email">
<label for="email" class="active brown-text"><strong>Email Id</strong></label>
<div class="red-text">
<?php echo $errors['email'];?>
</div>
</div>
</div>
<div class="row">
<div class="input-field">
<label for="dropdown" class="active brown-text"><strong>Choose your event</strong></label>
<select id="dropdown" class="dropdown-content" name="eventname">
<option value="" class="brown-text">Choose your option</option>
<option value="weddings-50000" data-icon="images/wedding.jpg">Weddings -- ₹50000</option>
<option value="meetings-20000" data-icon="images/meeting.jpg">Meetings -- ₹20000</option>
<option value="parties-25000" data-icon="images/party.jpg">Parties -- ₹25000</option>
</select>
<div class="red-text">
<?php echo $errors['other'];?>
</div>
</div>
</div>
<div class="row">
<div class="input-field">
<input type="date" placeholder="date" name="date">
<label for="date" class="active brown-text"><strong>Date</strong></label>
<div class="red-text"><?php echo $errors['other'];?></div>
</div>
</div>
<div class="row">
<div class="input-field">
<label for="dropdown" class="active brown-text"><strong>Choose your preferred time</strong></label>
<select id="dropdown" class="dropdown-content" name="time">
<option value="" class="brown-text" disabled>Choose your option</option>
<option value="day">Day</option>
<option value="evening">Evening</option>
</select>
<div class="red-text">
<?php echo $errors['other'];?>
</div>
</div>
</div>
<div class="row">
<div class="input-field">
<div class="check">
<label>
<input type="checkbox"/>
<span class="brown-text"><strong>I agree to the terms and conditions.</strong></span>
</label>
</div>
</div>
</div>
<div class="center">
<a href="#roombooked" class="modal-trigger"><input type="submit" value="submit" class="btn brown waves-effect waves-light z-depth-4 white-text" name="submit"></a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="footer-copyright brown darken-1">
<div class="container center-align white-text">
<b>©2021 The Grand Resort</b><br>
<b>Made with by Deepthi Sherly J</b>
</div>
</div>
<div class="modal" id="roombooked">
<div class="modal-content">
<h4>Room Booked Successfully!!</h4>
</div>
<div class="modal-footer">
<a href="home.php" class="modal-close btn brown waves-effect waves-light">Okay</a>
</div>
</div>
<script src=" https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js "></script>
<script>
$(document).ready(function() {
$('.sidenav').sidenav();
$('.carousel').carousel();
setInterval(function() {
$('.carousel').carousel('next');
}, 2000);
$('.dropdown-trigger').dropdown();
$('select').formSelect();
$('.parallax').parallax();
});
</script>
</body>
</html>