-
Notifications
You must be signed in to change notification settings - Fork 4
/
invoice.php
165 lines (146 loc) · 5.15 KB
/
invoice.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
<?php
if(isset($_GET['bookingno']))
{
$sql = "SELECT *, DATE(BusDateTime) AS ScheduleDate FROM s900_database.booking
RIGHT JOIN s900_database.bus_schedule ON s900_database.booking.ScheduleNo = s900_database.bus_schedule.ScheduleNo
RIGHT JOIN s900_database.account ON s900_database.booking.AccountNo = s900_database.account.AccountNo
WHERE BookingNo = ".$_GET['bookingno'];
$query = mysqli_query($con,$sql);
$row = mysqli_fetch_array($query);
if($row)
{
$bookingNo = $row['BookingNo'];
$purchasedDate = $row['BookingTimestamp'];
$bookingDate = $row['BusDateTime'];
$firstName = $row['FirstName'];
$lastName = $row['LastName'];
$email = $row['Email'];
$quantity = $row['Quantity'];
$ticketPrice = $row['TicketPrice'];
$depart = $row['ScheduleDepart'];
$arrive = $row['ScheduleArrive'];
$seatNo = $row['BusSeat'];
$bookingStatus = $row['BookingStatus'];
$totalamount = number_format((float)$quantity*$ticketPrice, 2, '.', '');
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="css/invoice.css" rel="stylesheet">
</head>
<body>
<div class="invoice-box" id="invoice-box">
<table cellpadding="0" cellspacing="0">
<tr class="top">
<td colspan="2">
<table>
<tr>
<td class="title">
<img src="images/logo_black.png" style="width:20%; max-width:300px;">
</td>
<td><?php
if($bookingStatus == "Completed")
echo '
<h3 style="color: #588da8">Completed</h3>
';
else if($bookingStatus == "Cancelled")
echo '
<h3 style="color: #d8345f">Cancelled</h3>
';
?>
<p><small>Need Help? Toll Number: +60-339882525<br>Email: [email protected]</small></p>
</td>
</tr>
</table>
</td>
</tr>
<!-- Trip Details -->
<tr class="heading">
<td>
TRIP DETAILS
</td>
<td>
</td>
</tr>
<tr class="details">
<td>
KKKL express
</td>
<td>
<?=$depart." > ".$arrive?>
<br>
<?=$bookingDate?>
</td>
</tr>
<!-- Boarding Dropping -->
<tr class="heading">
<td>
TRAVELLER DETAILS
</td>
<td>
</td>
</tr>
<tr class="item">
<td>
<?=$firstName." ".$lastName?>
<p><small>Primary Passenger</small></p>
</td>
<td>
<?=$seatNo?>
<p><small>Seat Number</small></p>
</td>
</tr>
<tr class="item">
<td>
<?=$bookingNo?>
<br>
<p><small>Booking Number</small></p>
</td>
<td>
<?=$bookingDate?>
<br>
<p><small>Departure Time</small></p>
</td>
</tr>
<tr class="heading">
<td>
CONTACT DETAILS
</td>
<td>
</td>
</tr>
<tr class="item">
<td>
<?=$email?>
<p><small>Email</small></p>
</td>
<td>
</td>
</tr>
<tr class="total">
<td></td>
<td>
Total Amount: RM<?=$totalamount?>
</td>
</tr>
</table>
<?php
if($bookingStatus != "Confirmed")
{
echo '<br>';
echo '<p style="text-align:center;">Thank you for choosing <strong>blueBus</strong>!</p>';
}
else
{
echo '<p style="text-align:center;"><img src="https://api.qrserver.com/v1/create-qr-code/?data='.$bookingNo.'&size=100x100" alt="'.$bookingNo.'" title="" /></p>';
echo '<p><strong>Note:</strong> <small>Customers are advised to present a print out of this ticket along with an identity proof to redeem the boarding pass at check-in counter. Failing to
do so, the boarding might be denied.</small></p>';
}
?>
</div>
</body>
</html>