-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroom-reservation-2.php
167 lines (141 loc) · 8.34 KB
/
room-reservation-2.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
<?php
include 'scss/classes.php';
$days = $_SESSION['departure'];
$diff1 = strtotime("+".$days." days", strtotime($_SESSION['arrival']));
$totalPrice = $_SESSION['totalPrice'];
if(isset($_GET['paystack-trxref'])){
if($_GET['paystack-trxref'] == $_SESSION['rand']){
$actRes = $conn->prepare("UPDATE reservations SET resStatus = ? WHERE resID = ?");
$actRes->execute(array("approved",$_SESSION['rID']));
if($actRes){
$msg = "Congratulations ".$_SESSION['cofname']."! Your payment was successful. Please see booking details below: \r\n\r\n".$_SESSION['descr']."\r\n\r\nWarm regards,\r\nThe Lekki Coliseum.";
$mail = ($_SESSION['ResEmail'], "Successful payment notification!", $msg, "FROM: [email protected]");
$mail2 = mail("[email protected]", "Reservation Payment Notice", "You have a new online payment for Reservation No. #".$_SESSION['rID'], "FROM: [email protected]");
header("Location: reservation-step-3.php");
} else { echo "<script> alert('Payment was not successful, please try again.'); window.location = 'reservation-step-3.php?payment=card'; </script>"; }
}
}
if(isset($_SESSION['rID'])){
$getReservationsq = $conn->prepare("SELECT * FROM reservations a JOIN billings b USING(resID) WHERE a.resID = ?");
$getReservationsq->execute(array($_SESSION['rID']));
$getReservations = $getReservationsq->fetch(PDO::FETCH_ASSOC);
} else {
header("Location: reservation.php");
}
$resStep = "3";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- TITLE -->
<title>Room Reservation | The Lekki Coliseum</title>
<?php include 'scss/headtags.php'; ?>
</head>
<!--[if IE 7]> <body class="ie7 lt-ie8 lt-ie9 lt-ie10"> <![endif]-->
<!--[if IE 8]> <body class="ie8 lt-ie9 lt-ie10"> <![endif]-->
<!--[if IE 9]> <body class="ie9 lt-ie10"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
<!-- PRELOADER -->
<div id="preloader">
<span class="preloader-dot"></span>
</div>
<!-- END / PRELOADER -->
<!-- PAGE WRAP -->
<div id="page-wrap">
<!-- HEADER -->
<?php include 'scss/header.php'; ?>
<!-- END / HEADER -->
<!-- SUB BANNER -->
<section class="section-sub-banner bg-9">
<div class="sub-banner">
<div class="container">
<div class="text text-center">
<h2>RESERVATION</h2>
<p>Reservation Complete</p>
</div>
</div>
</div>
</section>
<!-- END / SUB BANNER -->
<!-- RESERVATION -->
<section class="section-reservation-page bg-white">
<div class="container">
<div class="reservation-page">
<div class="row">
<!-- CONTENT -->
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="reservation_content">
<?php if(!isset($_GET['payment'])){ ?>
<div class="reservation-chosen-message bg-gray text-center">
<h4>RESERVATION #<?php echo $_SESSION['rID']; ?> OVERVIEW AND ACCOUNT DETAILS</h4>
<p><?php echo "Dear ".$_SESSION['cofname']." ".$_SESSION['colname'].", see below your reservation overview."; ?> </p>
<?php if($getReservations['resStatus'] !== "approved"){ ?>
<p>
<?php echo $days." night(s) in ".$_SESSION['room'].", from ".date("d M, Y", strtotime($_SESSION['arrival']))." to ".date("d M, Y", $diff1).". <br /> Please make payment of the sum of <strong>N".number_format($totalPrice,0)."</strong> to the account number below within 12hours to prevent cancelation of your reservation. <br /><br /> Colliseum Courts Cencepts Limited <br />FCMB (USD) - 2130575026<br />FCMB (Naira) - 2130575040<br />Access (Diamond) (Naira) - 0083271321"; ?>
</p>
<?php } else { ?>
<p>
<?php echo $days." night(s) in ".$_SESSION['room'].", from ".date("d M, Y", strtotime($_SESSION['arrival']))." to ".date("d M, Y", $diff1).". <br /> Thank you for choosing us, we look forward to giving you a lush experience. <br /><strong>Please copy your reservation number for verification purpose on arrival.</strong>"; ?>
</p>
<?php } ?>
<a href="index.php" class="awe-btn awe-btn-6">GO HOME</a>
</div>
<?php } else if(isset($_GET['payment']) && $_GET['payment'] == "card") { ?>
<div class="reservation-chosen-message bg-gray text-center">
<h4>RESERVATION #<?php echo $_SESSION['rID']; ?> OVERVIEW</h4>
<p><?php echo "Dear ".$_SESSION['cofname']." ".$_SESSION['colname'].", see below your reservation overview."; ?> </p>
<p>
<?php echo $days." night(s) in ".$_SESSION['room'].", from ".date("d M, Y", strtotime($_SESSION['arrival']))." to ".date("d M, Y", $diff1).". <br /> Please make payment of the sum of <strong>N".number_format($totalPrice,0)."</strong> with your debit/credit card by clicking the button below."; ?>
</p>
<p>
<?php
$_SESSION['rand'] = rand(1111,9999).rand(33333,88888);
?>
<form action="reservation-step-3.php" method="GET" >
<script
src="https://js.paystack.co/v1/inline.js"
data-key="pk_live_7ff1206e8d94d7d55325cf11032857a0ac03b654"
data-email="<?php echo $_SESSION['ResEmail']; ?>"
data-amount="<?php echo $totalPrice."00"; ?>"
data-ref="<?php echo $_SESSION['rand']; ?>"
>
</script>
</form>
</p>
</div>
<?php } ?>
</div>
</div>
<div class="col-md-2"></div>
<!-- END / CONTENT -->
</div>
</div>
</div>
</section>
<!-- END / RESERVATION -->
<!-- FOOTER -->
<?php include 'scss/footer.php'; ?>
<!-- END / FOOTER -->
</div>
<!-- END / PAGE WRAP -->
<!-- LOAD JQUERY -->
<script type="text/javascript" src="js/lib/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/lib/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="js/lib/bootstrap-select.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script type="text/javascript" src="js/lib/isotope.pkgd.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.themepunch.revolution.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.themepunch.tools.min.js"></script>
<script type="text/javascript" src="js/lib/owl.carousel.js"></script>
<script type="text/javascript" src="js/lib/jquery.appear.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.countTo.js"></script>
<script type="text/javascript" src="js/lib/jquery.countdown.min.js"></script>
<script type="text/javascript" src="js/lib/jquery.parallax-1.1.3.js"></script>
<script type="text/javascript" src="js/lib/jquery.magnific-popup.min.js"></script>
<script type="text/javascript" src="js/lib/SmoothScroll.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
</body>
</html>