-
Notifications
You must be signed in to change notification settings - Fork 0
/
cancellationreceipt.php
169 lines (157 loc) · 5.67 KB
/
cancellationreceipt.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
<?php
include("header.php");
$sqlhotelcancel = "SELECT * FROM payment WHERE status='Cancelled' AND payment_id='$_GET[paymentid]'";
$qsqlhotelcancel = mysqli_query($con, $sqlhotelcancel);
$rshotelcancel = mysqli_fetch_array($qsqlhotelcancel);
$totalamt = 0;
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Cancellation Receipt</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!--start main -->
<div class="iqoniq_contant_wrapper">
<section class="gray-bg aboutus-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="about-us">
<div class="text">
<center><b style="font-size:25px;color:red;">Cancellation Receipt</b></center>
<table class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Cancellation Receipt No.</th>
<th>Cancellation Date</th>
<th>Cancellation Time</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $rshotelcancel['payment_id']; ?></td>
<td><?php echo date("d-M-Y", strtotime($rshotelcancel['payment_date'])); ?></td>
<td><?php echo date("h:i A", strtotime($rshotelcancel['payment_time'])); ?></td>
</tr>
</tbody>
</table>
<hr>
<center><b style="font-size:25px;color:red;">Room Booking records</b></center>
<table class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Bill No.</th>
<th>Hotel</th>
<th>Room Type</th>
<?php
if (!isset($_SESSION['customer_id'])) {
?>
<th>Customer</th>
<?php
}
?>
<th>Booked for</th>
<th>Booking date</th>
<th>Cost</th>
<th>Cancellation charge</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM room_booking LEFT JOIN hotel ON room_booking.hotel_id=hotel.hotel_id LEFT JOIN room_type ON room_booking.room_typeid=room_type.room_typeid LEFT JOIN customer ON room_booking.customer_id=customer.customer_id LEFT JOIN payment ON payment.room_booking_id=room_booking.room_booking_id WHERE payment.status='Cancel' AND payment.food_order_id='0' AND payment.cab_bookingid='0' AND payment.room_booking_id='$rshotelcancel[name]' ";
if (isset($_SESSION['customer_id'])) {
$sql = $sql . " AND room_booking.customer_id='$_SESSION[customer_id]'";
}
$sql = $sql . " ORDER BY room_booking.room_booking_id desc";
$qsql = mysqli_query($con, $sql);
while ($rs = mysqli_fetch_array($qsql)) {
$room_booking_id = $rs['room_booking_id'];
$sqlhotel_image = "SELECT * FROM hotel_image WHERE hotel_id='$rs[1]' AND room_typeid='0'";
$qsqlhotel_image = mysqli_query($con, $sqlhotel_image);
$rshotel_image = mysqli_fetch_array($qsqlhotel_image);
$checkin = date("d-M-Y", strtotime($rs['check_in']));
$checkout = date("d-M-Y", strtotime($rs['check_out']));
echo "<tr>
<th>
<center>
<p style='color:red;font-size:25px;'>
$rs[payment_id]</p>
</center>
</th>
<td>$rs[hotel_image] $rs[hotel_name]</td>
<td>$rs[room_type]<br>(Rs. $rs[cost] / day)</td>";
if (!isset($_SESSION['customer_id'])) {
echo "<td>$rs[customer_name]</td>";
}
echo "<td>Adults : $rs[no_ofadults]<br>Children: $rs[no_ofchildren]</td>
<td>
CheckIn : $checkin<br>Checkout : $checkout <br><b style='color:green;'>";
$checkin = strtotime($rs['check_in']);
$checkout = strtotime($rs['check_out']);
$datediff = $checkout - $checkin;
$nodays = round($datediff / (60 * 60 * 24));
$nodays = $nodays + 1;
if ($nodays == 1) {
echo $nodays . " Day";
} else {
echo $nodays . " Days";
}
echo "</b></td>
<td>Rs. " . $rs['cost'] * $nodays . "</td>
<td>Rs. ";
echo $rs['cost'] * $nodays / 2;
echo "</td></tr>";
$totalamt = $totalamt + ($rs['cost'] * $nodays);
}
?>
</tbody>
</table>
<hr>
<hr>
<input type="hidden" name="room_booking_id" id="room_booking_id" value="<?php echo $room_booking_id; ?>">
<input type="hidden" name="totalamt" id="totalamt" value="<?php echo $totalamt; ?>">
<center><b style="font-size:25px;color:red;">Cancellation details</b></center>
<table class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Total Amount</th>
<td>Rs. <?php echo $totalamt; ?></td>
</tr>
<tr>
<th>Total cancellation charge(50%)</th>
<td>Rs. <?php echo $totalamt / 2; ?></td>
</tr>
<tr>
<th>Refundable amount</th>
<td>Rs. <?php echo $totalamt / 2; ?></td>
</tr>
<tr>
<th colspan="2" style='color:red;'>Accout detail... </th>
</tr>
<tr>
<th style="width:25%;">Payment Type</th>
<th style="width:75%;"><?php echo $rshotelcancel['payment_type']; ?></th>
</tr>
<tr>
<th style="width:25%;">Card holder</th>
<th style="width:75%;"><?php echo $rshotelcancel['card_holder']; ?></th>
</tr>
<tr>
<th style="width:25%;">Card No</th>
<th style="width:75%;"><?php echo $rshotelcancel['card_no']; ?></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- iqoniq Contant Wrapper End-->
<?php
include("footer.php");
?>