PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.8
Yatra – Travel Booking & Tour Operator Software v3.0.2.8
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / templates / pdf / voucher.php

voucher.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.8, at templates/pdf/voucher.php

202 lines 9.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $companyName = (string) ($company_name ?? '');
4 $companyAddress = (string) ($company_address ?? '');
5 $companyEmail = (string) ($company_email ?? '');
6 $companyPhone = (string) ($company_phone ?? '');
7
8 $customerName = (string) ($customer_name ?? '');
9 $customerEmail = (string) ($customer_email ?? '');
10
11 $bookingRef = (string) ($booking_ref ?? '');
12 $bookingDate = (string) ($booking_date ?? '');
13 $bookingStatus = (string) ($booking_status ?? '');
14 $statusClass = (string) ($status_class ?? 'pending');
15
16 $tripTitle = (string) ($trip_title ?? '');
17 $tripDuration = (string) ($trip_duration ?? '');
18 $tripDifficulty = (string) ($trip_difficulty ?? '');
19
20 $travelDate = (string) ($travel_date ?? '');
21 $returnDate = (string) ($return_date ?? '');
22
23 $currencySymbol = (string) ($currency_symbol ?? '');
24 $totalAmount = (string) ($total_amount ?? '0.00');
25 $amountPaid = (string) ($amount_paid ?? '0.00');
26 $amountDue = (string) ($amount_due ?? '0.00');
27
28 $travelerCount = (int) ($traveler_count ?? 1);
29 $departureLocation = (string) ($departure_location ?? '');
30 $destination = (string) ($destination ?? '');
31
32 ?><!DOCTYPE html>
33 <html lang="en">
34 <head>
35 <meta charset="UTF-8">
36 <meta name="viewport" content="width=device-width, initial-scale=1.0">
37 <title>Travel Voucher - <?php echo htmlspecialchars($bookingRef, ENT_QUOTES, 'UTF-8'); ?></title>
38 <style>
39 @page { size: A4 portrait; margin: 0mm; }
40 * { margin: 0; padding: 0; box-sizing: border-box; }
41 body { margin: 0; padding: 0; font-family: "DejaVu Sans", sans-serif; font-size: 12px; color: #111; }
42 .content { padding: 12mm 12mm 14mm 12mm; }
43
44 .header { width: 100%; border-collapse: collapse; }
45 .header td { vertical-align: top; }
46 .brand { background: #059669; color: #fff; padding: 6mm 6mm; }
47 .brand h1 { font-size: 20px; font-weight: 700; margin: 0; }
48 .brand p { font-size: 12px; margin-top: 4px; font-weight: 500; }
49
50 .voucher-number { background: #f3f4f6; padding: 4mm 6mm; border-bottom: 2px solid #059669; }
51 .voucher-number .number { font-size: 16px; font-weight: 700; color: #059669; }
52
53 .panel { width: 100%; border: 1px solid #e5e7eb; border-collapse: collapse; margin-top: 6mm; margin-bottom: 6mm; }
54 .panel td { padding: 5mm 5mm; vertical-align: top; }
55 .panel h3 { font-size: 11px; text-transform: uppercase; color: #6b7280; margin-bottom: 8px; letter-spacing: 0.5px; }
56 .muted { color: #6b7280; }
57
58 .trip-info { background: #f9fafb; border-left: 4px solid #059669; padding: 6mm; margin: 6mm 0; }
59 .trip-info h4 { color: #059669; font-size: 14px; margin-bottom: 4mm; }
60
61 .details { width: 100%; border-collapse: collapse; }
62 .details td { padding: 1.5mm 0; vertical-align: top; }
63 .details .k { width: 20mm; white-space: nowrap; font-weight: 700; }
64 .details .v { white-space: nowrap; }
65 .details .v-wrap { white-space: normal; }
66
67 .badge { display: inline-block; padding: 2px 10px; font-size: 10px; border-radius: 12px; border: 1px solid #e5e7eb; margin-left: 6px; vertical-align: middle; line-height: 1.4; }
68 .badge-confirmed { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
69 .badge-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
70 .badge-cancelled { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
71
72 .travelers { width: 100%; border-collapse: collapse; margin-top: 4mm; }
73 .travelers th { text-align: left; font-size: 10px; text-transform: uppercase; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #e5e7eb; padding: 10px 12px; }
74 .travelers td { border-bottom: 1px solid #e5e7eb; padding: 12px; vertical-align: top; }
75 .right { text-align: right; }
76
77 .totals { width: 100%; border-collapse: collapse; margin-top: 6mm; }
78 .totals td { padding: 7px 12px; }
79 .totals .label { color: #374151; }
80 .totals .value { text-align: right; }
81 .totals .grand { font-weight: 700; color: #059669; border-top: 2px solid #059669; padding-top: 12px; }
82
83 .footer { margin-top: 8mm; padding-top: 6mm; border-top: 1px solid #e5e7eb; font-size: 10px; color: #6b7280; text-align: center; }
84 </style>
85 </head>
86 <body>
87 <table class="header">
88 <tr>
89 <td class="brand">
90 <h1><?php echo htmlspecialchars($companyName, ENT_QUOTES, 'UTF-8'); ?></h1>
91 <p><?php esc_html_e('Travel Voucher', 'yatra'); ?></p>
92 </td>
93 </tr>
94 </table>
95
96 <div class="voucher-number">
97 <div class="number"><?php esc_html_e('Voucher #', 'yatra'); ?><?php echo htmlspecialchars($bookingRef, ENT_QUOTES, 'UTF-8'); ?></div>
98 </div>
99
100 <div class="content">
101 <table class="panel">
102 <tr>
103 <td style="width: 40%;">
104 <h3><?php esc_html_e('Traveler Information', 'yatra'); ?></h3>
105 <div><strong><?php echo htmlspecialchars($customerName, ENT_QUOTES, 'UTF-8'); ?></strong></div>
106 <div class="muted"><?php echo htmlspecialchars($customerEmail, ENT_QUOTES, 'UTF-8'); ?></div>
107 <div class="muted"><?php esc_html_e('Travelers:', 'yatra'); ?> <?php echo (int) $traveler_count; ?></div>
108 </td>
109 <td style="width: 30%;">
110 <h3><?php esc_html_e('Booking Details', 'yatra'); ?></h3>
111 <table class="details">
112 <tr>
113 <td class="k"><?php esc_html_e('Booking #:', 'yatra'); ?></td>
114 <td class="v-wrap"><?php echo htmlspecialchars($bookingRef, ENT_QUOTES, 'UTF-8'); ?></td>
115 </tr>
116 <tr>
117 <td class="k"><?php esc_html_e('Date:', 'yatra'); ?></td>
118 <td class="v"><?php echo htmlspecialchars($bookingDate, ENT_QUOTES, 'UTF-8'); ?></td>
119 </tr>
120 <tr>
121 <td class="k"><?php esc_html_e('Status:', 'yatra'); ?></td>
122 <td class="v"><span class="badge badge-<?php echo htmlspecialchars($statusClass, ENT_QUOTES, 'UTF-8'); ?>"><?php echo htmlspecialchars($bookingStatus, ENT_QUOTES, 'UTF-8'); ?></span></td>
123 </tr>
124 </table>
125 </td>
126 <td style="width: 30%;">
127 <h3><?php esc_html_e('Company', 'yatra'); ?></h3>
128 <div><?php echo htmlspecialchars($companyName, ENT_QUOTES, 'UTF-8'); ?></div>
129 <?php if ($companyAddress !== ''): ?>
130 <div class="muted"><?php echo htmlspecialchars($companyAddress, ENT_QUOTES, 'UTF-8'); ?></div>
131 <?php endif; ?>
132 <?php if ($companyEmail !== ''): ?>
133 <div class="muted"><?php echo htmlspecialchars($companyEmail, ENT_QUOTES, 'UTF-8'); ?></div>
134 <?php endif; ?>
135 <?php if ($companyPhone !== ''): ?>
136 <div class="muted"><?php echo htmlspecialchars($companyPhone, ENT_QUOTES, 'UTF-8'); ?></div>
137 <?php endif; ?>
138 </td>
139 </tr>
140 </table>
141
142 <div class="trip-info">
143 <h4><?php echo htmlspecialchars($tripTitle, ENT_QUOTES, 'UTF-8'); ?></h4>
144 <table class="details">
145 <tr>
146 <td class="k"><?php esc_html_e('Duration:', 'yatra'); ?></td>
147 <td class="v"><?php echo htmlspecialchars($tripDuration, ENT_QUOTES, 'UTF-8'); ?></td>
148 </tr>
149 <?php if ($tripDifficulty !== ''): ?>
150 <tr>
151 <td class="k"><?php esc_html_e('Difficulty:', 'yatra'); ?></td>
152 <td class="v"><?php echo htmlspecialchars($tripDifficulty, ENT_QUOTES, 'UTF-8'); ?></td>
153 </tr>
154 <?php endif; ?>
155 <?php if ($departureLocation !== ''): ?>
156 <tr>
157 <td class="k"><?php esc_html_e('Departure:', 'yatra'); ?></td>
158 <td class="v"><?php echo htmlspecialchars($departureLocation, ENT_QUOTES, 'UTF-8'); ?></td>
159 </tr>
160 <?php endif; ?>
161 <?php if ($destination !== ''): ?>
162 <tr>
163 <td class="k"><?php esc_html_e('Destination:', 'yatra'); ?></td>
164 <td class="v"><?php echo htmlspecialchars($destination, ENT_QUOTES, 'UTF-8'); ?></td>
165 </tr>
166 <?php endif; ?>
167 <tr>
168 <td class="k"><?php esc_html_e('Travel Date:', 'yatra'); ?></td>
169 <td class="v"><?php echo htmlspecialchars($travelDate, ENT_QUOTES, 'UTF-8'); ?></td>
170 </tr>
171 <?php if ($returnDate !== ''): ?>
172 <tr>
173 <td class="k"><?php esc_html_e('Return Date:', 'yatra'); ?></td>
174 <td class="v"><?php echo htmlspecialchars($returnDate, ENT_QUOTES, 'UTF-8'); ?></td>
175 </tr>
176 <?php endif; ?>
177 </table>
178 </div>
179
180 <table class="totals">
181 <tr>
182 <td class="label"><?php esc_html_e('Total Amount', 'yatra'); ?></td>
183 <td class="value"><?php echo $currencySymbol . htmlspecialchars($totalAmount, ENT_QUOTES, 'UTF-8'); ?></td>
184 </tr>
185 <tr>
186 <td class="label"><?php esc_html_e('Amount Paid', 'yatra'); ?></td>
187 <td class="value"><?php echo $currencySymbol . htmlspecialchars($amountPaid, ENT_QUOTES, 'UTF-8'); ?></td>
188 </tr>
189 <tr>
190 <td class="label"><?php esc_html_e('Balance Due', 'yatra'); ?></td>
191 <td class="value"><?php echo $currencySymbol . htmlspecialchars($amountDue, ENT_QUOTES, 'UTF-8'); ?></td>
192 </tr>
193 </table>
194 </div>
195
196 <div class="footer">
197 <p><?php esc_html_e('This voucher confirms your booking and should be presented at check-in. Please keep it safe for your travel records.', 'yatra'); ?></p>
198 <p><?php esc_html_e('For questions or changes, contact us at', 'yatra'); ?> <?php echo htmlspecialchars($companyEmail, ENT_QUOTES, 'UTF-8'); ?> <?php esc_html_e('or call', 'yatra'); ?> <?php echo htmlspecialchars($companyPhone, ENT_QUOTES, 'UTF-8'); ?></p>
199 </div>
200 </body>
201 </html>
202