-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbooking-form.php
322 lines (266 loc) · 11.4 KB
/
booking-form.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<?php
session_start();
include_once('connect.php');
// if(isset($_SESSION['u_id'])
// {
//$paypal_url='https://www.paypal.com/cgi-bin/webscr'; // Test Paypal API URL
//$paypal_id='[email protected]'; // Business email ID
$book = $_REQUEST['bookid'];
$q17 = mysqli_query($connect,'Select * from users,booking where uid="'.$_SESSION['u_id'].'" and uid=userid and bookid="'.$book.'"');
if(mysqli_num_rows($q17)>0)
{
$r17=mysqli_fetch_array($q17);
// $q18 = mysqli_query($connect,"select * from booking where bookid=".$book);
// $r18 = mysqli_fetch_array($q18);
?>
<!doctype html>
<html>
<head>
<title>Booking form</title>
<?php include 'lib/top.php';?>
<script src="https://checkout.stripe.com/checkout.js"></script>
</head>
<body>
<div class="container-fluid"><!--container-fluid start-->
<div class="row">
<!--==============menu header=========================-->
<div class="menu-had2">
<?php include 'lib/header.php';?>
</div><!--menu-had close-->
<!--==============menu header close=========================-->
<div class="banner-bg">
<div class="banner-upper">
<div class="container">
<div class="row">
<div class="banner-txt">
<h1> Booking is now very easy</h1>
<h4>Feel free to book a place and enjoy your occasion.</h4>
</div>
</div><!--row close-->
</div><!--container close-->
</div><!--banner-upper close-->
</div><!--banner-bg close-->
<div class="container">
<div class="row">
<div class="col-lg-8 col-sm-8 col-md-8 col-xs-12">
<div class="tellus-data col-lg-12 col-md-12 col-sm-12 col-xs-12 pd-lr-0">
<form id="bkform" method="post" action="creditcard.php" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pd-lr-0" >
<!--<form method="post" action="creditcard2.php" id="bkform" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pd-lr-0" >-->
<div class="had-frm">Your Details</div>
<div class="frm-field-mar">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Package</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input type="hidden" value="<?php echo $book; ?>" id="booking_id" >
<input type="text" name="book_id" hidden value="<?php echo $book; ?>">
<input readonly="" type="text" value="<?php echo $r17['hours']. " " . $r17['package']; ?>" class="form-control" id="" placeholder="Premium">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Price Per <?php echo $r17['package']; ?></label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="$<?php echo $r17['price']; ?>" class="form-control" id="" placeholder="2000/-">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Checkin</label>
</div>
<?php
$dtin = date_format(date_create($r17['checkin'] . " " . $r17['ftime']), 'Y-m-d g:i a');
$dtout = date_format(date_create($r17['checkout'] . " " . $r17['ltime']), 'Y-m-d g:i a');
?>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $dtin; ?>" name="checkin" class="form-control" id="" placeholder="2-10-12">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Checkout</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $dtout ?>" name="checkout" class="form-control" id="" placeholder="5-10-12">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Total Price</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" id="amount" type="text" name="show_price" value=$<?php echo $r17['hotel'] ?> class="form-control" >
<input type="hidden" name="total_price" value=<?php echo $r17['hotel'] ?> >
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Number of persons</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $r17['guests'] ?>" class="form-control" id="" placeholder="1">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Name</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $r17['fname']." ".$r17['lname']; ?>" class="form-control" id="" placeholder="Name">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Contact Number</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $r17['contact']; ?>" class="form-control" id="" placeholder="Contact">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Location</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $_REQUEST['theplace'] ?>" name="theplace" class="form-control" id="" placeholder="Location">
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mg-top10">
<div class="col-md-3 col-lg-3 col-sm-4 col-xs-6">
<label for="space">Email ID</label>
</div>
<div class="col-md-9 col-lg-9 col-sm-8 col-xs-6">
<input readonly="" type="text" value="<?php echo $r17['email']; ?>" class="form-control" id="" placeholder="Email">
<input type="hidden" name="placeid" value="<?php echo $_POST['placeid'] ?>">
</div>
</div>
<!--=======================================-->
<div class="col-md-12 text-center mg-top20 mg-bottom20">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-success">
<!--<button type="button" id="paypal_data" name="paypal_insertion" style="background: transparent;border: none; padding: 0px;">Pay online</button>-->
<button type="submit" id="payonline" name="payonline" style="background: transparent;border: none; padding: 0px;">Pay online</button>
</label>
<label class="btn btn-success ">
<button type="button" required="" class="cancel-btn btn-danger" name="method"style="background: transparent;border: none; padding: 0px;" value="<?php echo $r17['bookid']; ?>">Cancel Booking</button>
</label>
</div>
</div>
</div>
</form>
<?php
$sql4 = mysqli_query($connect,"SELECT * FROM place,users WHERE user_id=uid and place_id='".$r17['placeid']."'");
$row4 = mysqli_fetch_array($sql4);
?>
<form method="post" id="book_messagess">
<input name="to_msg" value="<?php echo $row4['uid']; ?>" type="hidden">
<div class="hides">
<textarea required="" class="form-control height90" name="message" placeholder="Type Your Message Here.."></textarea>
<input type="text" name="place_id" hidden value="<?php echo $r17['placeid']; ?>">
</div>
<button class="btn-reply send_btn2 mg-top10" type="submit" name="book_messagess" style="display: none;"><i class="fa fa-share-square-o"></i> Send</button>
<button class="btn-reply cancel_btn2 mg-top10" type="button" style="display: none;"><i class="fa fa-times"></i> Cancel</button>
</form>
</div>
</div>
<form action="<?php echo $paypal_url ?>" method="post" name="frmPayPal1">
<input type="hidden" name="business" value="<?php echo $paypal_id ?>">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="<?php echo $row4['space_name'];?>">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="<?php echo $r17['hotel']; ?>">
<input type="hidden" name="currency_code" value="USD">
<!--<input type="hidden" name="cancel_return" value="http://vismaadlabs.org/bookmyspace/forms.php?bookid_cancel=<?php //echo $r17['bookid']; ?>">
<input type="hidden" name="return" value="http://vismaadlabs.org/bookmyspace/forms.php?bookid_success=<?php //echo $r17['bookid']; ?>&ser_placeid=<?php //echo $r17['placeid']; ?>">
<input type="image" id="paypal_submit" border="0" name="submit" hidden>-->
<!-- <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> -->
</form>
<!-- <span><button style="float: right; margin-bottom: 1%;" class="btn-3" data-toggle="modal" data-target="#compose">Compose</button></span> -->
<!--==========WHY LIST YOUR PLACE?============-->
<div class="col-lg-4 col-sm-4 col-md-4 col-xs-12">
<div class="tellus-data">
<div class="had-frm">Why list your place?</div>
<div class="safe-lst">
<div class="col-lg-2 col-sm-2 col-md-2 col-xs-2">
<img class="img-responsive" src="img/save.png">
</div>
<div class="col-lg-10 col-sm-10 col-md-10 col-xs10">
<span class="had-2nd">It's safe</span>
<p>We provide a trusted environment.</p>
</div>
<div class="clearfix"></div>
</div>
<div class="safe-lst">
<div class="col-lg-2 col-sm-2 col-md-2 col-xs-2">
<img class="img-responsive" src="img/easy.png">
</div>
<div class="col-lg-10 col-sm-10 col-md-10 col-xs10">
<span class="had-2nd">It's easy</span>
<p>We'll do all the hard work of finding guests, while you just enjoy earning money with a spare space.</p>
</div>
<div class="clearfix"></div>
</div>
<div class="safe-lst">
<div class="col-lg-2 col-sm-2 col-md-2 col-xs-2">
<img class="img-responsive" src="img/free.png">
</div>
<div class="col-lg-10 col-sm-10 col-md-10 col-xs10">
<span class="had-2nd">It's free</span>
<p>We don't charge you to upload your place, and you get instant access to thousands of guests.</p>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<!--=====================================-->
<!--==========WHY LIST YOUR PLACE CLOSE============-->
</div><!--row close-->
</div><!--container close-->
<!--======footer======-->
<?php include 'lib/footer.php';
}
else
{
header('location:searchlst.php');
}
// else
// {
// header('location:index.php');
// }
?>
<script>
//$tots = <?php echo $r17['hotel'] ?> * 100;
document.getElementById('payonline').addEventListener('click', function(e) {
$('form#bkform').submit();
});
/*var handler = StripeCheckout.configure({
key: 'pk_test_IdZ2U4nGUg0vVG2yu8eMgbbc',
//image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
locale: 'auto',
token: function(token) {
// You can access the token ID with `token.id`.
// Get the token ID to your server-side code for use.
}
});
$tots = <?php //echo $r17['hotel'] ?> * 100;
document.getElementById('payonline').addEventListener('click', function(e) {
// Open Checkout with further options:
handler.open({
name: 'testStripe',
description: '2 widgets',
amount: $tots
});
e.preventDefault();
});
// Close Checkout on page navigation:
/*window.addEventListener('popstate', function() {
handler.close();
});*/
</script>
<!--======footer close======-->
</div><!--row close-->
</div><!--container-fluid close-->
</body>
</html>