-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwashing-plans.php
227 lines (205 loc) · 9.96 KB
/
washing-plans.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php //error_reporting(0);
include('includes/config.php');
if(isset($_POST['book']))
{
$ptype=$_POST['packagetype'];
$wpoint=$_POST['washingpoint'];
$fname=$_POST['fname'];
$mobile=$_POST['contactno'];
$date=$_POST['washdate'];
$time=$_POST['washtime'];
$message=$_POST['message'];
$status='New';
$bno=mt_rand(100000000, 999999999);
$sql="INSERT INTO tblcarwashbooking(bookingId,packageType,carWashPoint,fullName,mobileNumber,washDate,washTime,message,status) VALUES(:bno,:ptype,:wpoint,:fname,:mobile,:date,:time,:message,:status)";
$query = $dbh->prepare($sql);
$query->bindParam(':bno',$bno,PDO::PARAM_STR);
$query->bindParam(':ptype',$ptype,PDO::PARAM_STR);
$query->bindParam(':wpoint',$wpoint,PDO::PARAM_STR);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':mobile',$mobile,PDO::PARAM_STR);
$query->bindParam(':date',$date,PDO::PARAM_STR);
$query->bindParam(':time',$time,PDO::PARAM_STR);
$query->bindParam(':message',$message,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
echo '<script>alert("Your booking done successfully. Booking number is "+"'.$bno.'")</script>';
echo "<script>window.location.href ='washing-plans.php'</script>";
}
else
{
echo "<script>alert('Something went wrong. Please try again.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CWMS | Washing Plans</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="Free Website Template" name="keywords">
<meta content="Free Website Template" name="description">
<!-- Favicon -->
<link href="img/favicon.ico" rel="icon">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
<!-- CSS Libraries -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="lib/flaticon/font/flaticon.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php include_once('includes/header.php');?>
<!-- Page Header Start -->
<div class="page-header">
<div class="container">
<div class="row">
<div class="col-12">
<h2>Washing Plan</h2>
</div>
<div class="col-12">
<a href="index.php">Home</a>
<a href="washing-plans.php">Price</a>
</div>
</div>
</div>
</div>
<!-- Page Header End -->
<!-- Price Start -->
<div class="price">
<div class="container">
<div class="section-header text-center">
<p>Washing Plan</p>
<h2>Choose Your Plan</h2>
</div>
<div class="row">
<div class="col-md-4">
<div class="price-item">
<div class="price-header">
<h3>Basic Cleaning</h3>
<h2><span>$</span><strong>10</strong><span>.99</span></h2>
</div>
<div class="price-body">
<ul>
<li><i class="far fa-check-circle"></i>Seats Washing</li>
<li><i class="far fa-check-circle"></i>Vacuum Cleaning</li>
<li><i class="far fa-check-circle"></i>Exterior Cleaning</li>
<li><i class="far fa-times-circle"></i>Interior Wet Cleaning</li>
<li><i class="far fa-times-circle"></i>Window Wiping</li>
</ul>
</div>
<div class="price-footer">
<a class="btn btn-custom" data-toggle="modal" data-target="#myModal">Book Now</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="price-item featured-item">
<div class="price-header">
<h3>Premium Cleaning</h3>
<h2><span>$</span><strong>20</strong><span>.99</span></h2>
</div>
<div class="price-body">
<ul>
<li><i class="far fa-check-circle"></i>Seats Washing</li>
<li><i class="far fa-check-circle"></i>Vacuum Cleaning</li>
<li><i class="far fa-check-circle"></i>Exterior Cleaning</li>
<li><i class="far fa-check-circle"></i>Interior Wet Cleaning</li>
<li><i class="far fa-times-circle"></i>Window Wiping</li>
</ul>
</div>
<div class="price-footer">
<a class="btn btn-custom" data-toggle="modal" data-target="#myModal">Book Now</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="price-item">
<div class="price-header">
<h3>Complex Cleaning</h3>
<h2><span>$</span><strong>30</strong><span>.99</span></h2>
</div>
<div class="price-body">
<ul>
<li><i class="far fa-check-circle"></i>Seats Washing</li>
<li><i class="far fa-check-circle"></i>Vacuum Cleaning</li>
<li><i class="far fa-check-circle"></i>Exterior Cleaning</li>
<li><i class="far fa-check-circle"></i>Interior Wet Cleaning</li>
<li><i class="far fa-check-circle"></i>Window Wiping</li>
</ul>
</div>
<div class="price-footer">
<a class="btn btn-custom" data-toggle="modal" data-target="#myModal">Book Now</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Price End -->
<?php include_once('includes/footer.php');?>
<!--Model-->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Car Wash Booking</h4>
</div>
<div class="modal-body">
<form method="post">
<p>
<select name="packagetype" required class="form-control">
<option value="">Package Type</option>
<option value="1">BASIC CLEANING ($10.99)</option>
<option value="2">PREMIUM CLEANING ($20.99)</option>
<option value="3 ">COMPLEX CLEANING($30.99)</option>
</select>
<p>
<select name="washingpoint" required class="form-control">
<option value="">Select Washing Point</option>
<?php $sql = "SELECT * from tblwashingpoints";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
foreach($results as $result)
{ ?>
<option value="<?php echo htmlentities($result->id);?>"><?php echo htmlentities($result->washingPointName);?> (<?php echo htmlentities($result->washingPointAddress);?>)</option>
<?php } ?>
</select></p>
<p><input type="text" name="fname" class="form-control" required placeholder="Full Name"></p>
<p><input type="text" name="contactno" class="form-control" pattern="[0-9]{10}" title="10 numeric characters only" required placeholder="Mobile No."></p>
<p>Wash Date <br /><input type="date" name="washdate" required class="form-control"></p>
<p>Wash Time <br /><input type="time" name="washtime" required class="form-control"></p>
<p><textarea name="message" class="form-control" placeholder="Message if any"></textarea></p>
<p><input type="submit" class="btn btn-custom" name="book" value="Book Now"></p>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/counterup/counterup.min.js"></script>
<!-- Contact Javascript File -->
<script src="mail/jqBootstrapValidation.min.js"></script>
<script src="mail/contact.js"></script>
<!-- Template Javascript -->
<script src="js/main.js"></script>
</body>
</html>