PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.7
Yatra – Travel Booking & Tour Operator Software v3.0.2.7
3.0.16 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 All 84 releases
yatra / templates / pdf / itinerary.php

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

371 lines 19.4 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 $tripDescription = (string) ($trip_description ?? '');
18 $tripDuration = (string) ($trip_duration ?? '');
19 $tripDifficulty = (string) ($trip_difficulty ?? '');
20 $tripHighlights = (string) ($trip_highlights ?? '');
21 $tripIncludes = (string) ($trip_includes ?? '');
22 $tripExcludes = (string) ($trip_excludes ?? '');
23
24 $travelDate = (string) ($travel_date ?? '');
25 $returnDate = (string) ($return_date ?? '');
26
27 $currencySymbol = (string) ($currency_symbol ?? '');
28 $totalAmount = (string) ($total_amount ?? '0.00');
29 $amountPaid = (string) ($amount_paid ?? '0.00');
30 $amountDue = (string) ($amount_due ?? '0.00');
31
32 $travelerCount = (int) ($traveler_count ?? 1);
33 $departureLocation = (string) ($departure_location ?? '');
34 $destination = (string) ($destination ?? '');
35
36 ?><!DOCTYPE html>
37 <html lang="en">
38 <head>
39 <meta charset="UTF-8">
40 <meta name="viewport" content="width=device-width, initial-scale=1.0">
41 <title>Travel Itinerary - <?php echo htmlspecialchars($bookingRef, ENT_QUOTES, 'UTF-8'); ?></title>
42 <style>
43 @page { size: A4 portrait; margin: 0mm; }
44 * { margin: 0; padding: 0; box-sizing: border-box; }
45 body { margin: 0; padding: 0; font-family: "DejaVu Sans", sans-serif; font-size: 12px; color: #111; }
46 .content { padding: 12mm 12mm 14mm 12mm; }
47
48 .page-break { page-break-before: always; }
49 .avoid-break { page-break-inside: avoid; }
50
51 .header { width: 100%; border-collapse: collapse; }
52 .header td { vertical-align: top; }
53 .brand { background: #1e40af; color: #fff; padding: 6mm 6mm; }
54 .brand h1 { font-size: 18px; font-weight: 700; margin: 0; }
55 .brand p { font-size: 11px; margin-top: 4px; }
56
57 .itinerary-number { background: #f3f4f6; padding: 4mm 6mm; border-bottom: 2px solid #1e40af; margin-top: 2mm; }
58 .itinerary-number h2 { font-size: 16px; font-weight: 700; color: #1e40af; margin: 0; }
59 .itinerary-number .ref { font-size: 13px; color: #6b7280; margin-top: 2px; }
60
61 .section { margin-top: 6mm; page-break-inside: avoid; }
62 .section-title { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 3mm; padding-bottom: 2mm; border-bottom: 1px solid #e5e7eb; }
63
64 .panel { width: 100%; border: 1px solid #e5e7eb; border-collapse: collapse; margin-top: 6mm; margin-bottom: 6mm; }
65 .panel td { padding: 5mm 5mm; vertical-align: top; }
66 .panel h3 { font-size: 11px; text-transform: uppercase; color: #6b7280; margin-bottom: 8px; letter-spacing: 0.5px; }
67 .muted { color: #6b7280; }
68
69 .trip-details { width: 100%; border-collapse: collapse; margin-bottom: 6mm; }
70 .trip-details th { background: #f9fafb; font-weight: 600; text-align: left; padding: 3mm 4mm; border: 1px solid #e5e7eb; }
71 .trip-details td { padding: 3mm 4mm; border: 1px solid #e5e7eb; }
72 .trip-details .label { font-weight: 600; color: #6b7280; width: 30%; }
73
74 .timeline { margin: 4mm 0; }
75 .timeline-item { position: relative; padding-left: 8mm; margin-bottom: 6mm; page-break-inside: avoid; }
76 .timeline-item:before { content: ''; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; background: #1e40af; border-radius: 50%; }
77 .timeline-item:after { content: ''; position: absolute; left: 3px; top: 14px; width: 2px; height: calc(100% - 8px); background: #e5e7eb; }
78 .timeline-item:last-child:after { display: none; }
79 .timeline-date { font-weight: 600; color: #1e40af; margin-bottom: 1mm; }
80 .timeline-title { font-weight: 600; margin-bottom: 1mm; }
81 .timeline-desc { color: #6b7280; line-height: 1.4; }
82
83 .status { display: inline-block; padding: 1mm 3mm; border-radius: 2mm; font-size: 10px; font-weight: 600; text-transform: uppercase; }
84 .status.confirmed { background: #d1fae5; color: #065f46; }
85 .status.pending { background: #fef3c7; color: #92400e; }
86 .status.cancelled { background: #fee2e2; color: #991b1b; }
87
88 .footer { margin-top: 8mm; padding-top: 4mm; border-top: 1px solid #e5e7eb; font-size: 10px; color: #6b7280; }
89 .footer td { vertical-align: top; }
90
91 .trip-description { background: #f8fafc; padding: 4mm; border-left: 4px solid #1e40af; margin-bottom: 6mm; page-break-inside: avoid; }
92 .trip-description h3 { color: #1e40af; margin-bottom: 2mm; font-size: 14px; }
93 .trip-description p { line-height: 1.5; margin-bottom: 2mm; }
94
95 .itinerary-highlights { margin: 4mm 0; }
96 .highlight-item { padding: 2mm 0; border-bottom: 1px dashed #e5e7eb; }
97 .highlight-item:last-child { border-bottom: none; }
98 .highlight-title { font-weight: 600; color: #374151; }
99 .highlight-desc { color: #6b7280; font-size: 11px; margin-top: 1mm; }
100 </style>
101 </head>
102 <body>
103 <div class="content">
104 <!-- Header -->
105 <table class="header">
106 <tr>
107 <td style="width: 60%;">
108 <div class="brand">
109 <h1><?php echo htmlspecialchars($companyName ?: 'Travel Company', ENT_QUOTES, 'UTF-8'); ?></h1>
110 <p><?php esc_html_e('Travel Itinerary Document', 'yatra'); ?></p>
111 </div>
112 </td>
113 <td style="width: 40%;">
114 <div class="brand" style="background: #374151; text-align: right;">
115 <p style="font-size: 10px; margin-bottom: 2px;"><?php esc_html_e('Booking Reference', 'yatra'); ?></p>
116 <p style="font-size: 14px; font-weight: 700;"><?php echo htmlspecialchars($bookingRef ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></p>
117 </div>
118 </td>
119 </tr>
120 </table>
121
122 <div class="itinerary-number">
123 <h2><?php esc_html_e('Travel Itinerary', 'yatra'); ?></h2>
124 <div class="ref"><?php esc_html_e('Issued:', 'yatra'); ?> <?php echo htmlspecialchars($bookingDate, ENT_QUOTES, 'UTF-8'); ?></div>
125 </div>
126
127 <!-- Trip Description -->
128 <?php if (!empty($tripDescription)): ?>
129 <div class="section">
130 <div class="section-title"><?php esc_html_e('About This Trip', 'yatra'); ?></div>
131 <div class="trip-description">
132 <h3><?php echo htmlspecialchars($tripTitle, ENT_QUOTES, 'UTF-8'); ?></h3>
133 <p><?php echo nl2br(htmlspecialchars($tripDescription, ENT_QUOTES, 'UTF-8')); ?></p>
134 </div>
135 </div>
136 <?php endif; ?>
137
138 <!-- Trip Details -->
139 <div class="section">
140 <div class="section-title"><?php esc_html_e('Trip Information', 'yatra'); ?></div>
141 <table class="panel">
142 <tr>
143 <td style="width: 50%;">
144 <h3><?php esc_html_e('Trip Details', 'yatra'); ?></h3>
145 <table class="trip-details">
146 <tr>
147 <th class="label"><?php esc_html_e('Trip Name', 'yatra'); ?></th>
148 <td><?php echo htmlspecialchars($tripTitle, ENT_QUOTES, 'UTF-8'); ?></td>
149 </tr>
150 <tr>
151 <th class="label"><?php esc_html_e('Duration', 'yatra'); ?></th>
152 <td><?php echo htmlspecialchars($tripDuration ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></td>
153 </tr>
154 <tr>
155 <th class="label"><?php esc_html_e('Difficulty Level', 'yatra'); ?></th>
156 <td><?php echo htmlspecialchars($tripDifficulty ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></td>
157 </tr>
158 <tr>
159 <th class="label"><?php esc_html_e('Number of Travelers', 'yatra'); ?></th>
160 <td><?php echo $travelerCount; ?></td>
161 </tr>
162 </table>
163 </td>
164 <td style="width: 50%;">
165 <h3><?php esc_html_e('Travel Information', 'yatra'); ?></h3>
166 <table class="trip-details">
167 <tr>
168 <th class="label"><?php esc_html_e('Departure Location', 'yatra'); ?></th>
169 <td><?php echo htmlspecialchars($departureLocation ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></td>
170 </tr>
171 <tr>
172 <th class="label"><?php esc_html_e('Destination', 'yatra'); ?></th>
173 <td><?php echo htmlspecialchars($destination ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></td>
174 </tr>
175 <tr>
176 <th class="label"><?php esc_html_e('Travel Date', 'yatra'); ?></th>
177 <td><?php echo htmlspecialchars($travelDate ?: 'N/A', ENT_QUOTES, 'UTF-8'); ?></td>
178 </tr>
179 <?php if (!empty($returnDate)): ?>
180 <tr>
181 <th class="label"><?php esc_html_e('Return Date', 'yatra'); ?></th>
182 <td><?php echo htmlspecialchars($returnDate, ENT_QUOTES, 'UTF-8'); ?></td>
183 </tr>
184 <?php endif; ?>
185 <tr>
186 <th class="label"><?php esc_html_e('Booking Status', 'yatra'); ?></th>
187 <td><span class="status <?php echo $statusClass; ?>"><?php echo htmlspecialchars($bookingStatus, ENT_QUOTES, 'UTF-8'); ?></span></td>
188 </tr>
189 </table>
190 </td>
191 </tr>
192 </table>
193 </div>
194
195 <!-- Customer Information -->
196 <div class="section">
197 <div class="section-title"><?php esc_html_e('Traveler Information', 'yatra'); ?></div>
198 <table class="panel">
199 <tr>
200 <td style="width: 50%;">
201 <h3><?php esc_html_e('Primary Traveler', 'yatra'); ?></h3>
202 <table class="trip-details">
203 <tr>
204 <th class="label"><?php esc_html_e('Name', 'yatra'); ?></th>
205 <td><?php echo htmlspecialchars($customerName, ENT_QUOTES, 'UTF-8'); ?></td>
206 </tr>
207 <tr>
208 <th class="label"><?php esc_html_e('Email', 'yatra'); ?></th>
209 <td><?php echo htmlspecialchars($customerEmail, ENT_QUOTES, 'UTF-8'); ?></td>
210 </tr>
211 </table>
212 </td>
213 <td style="width: 50%;">
214 <h3><?php esc_html_e('Booking Information', 'yatra'); ?></h3>
215 <table class="trip-details">
216 <tr>
217 <th class="label"><?php esc_html_e('Booking Reference', 'yatra'); ?></th>
218 <td><?php echo htmlspecialchars($bookingRef, ENT_QUOTES, 'UTF-8'); ?></td>
219 </tr>
220 <tr>
221 <th class="label"><?php esc_html_e('Booking Date', 'yatra'); ?></th>
222 <td><?php echo htmlspecialchars($bookingDate, ENT_QUOTES, 'UTF-8'); ?></td>
223 </tr>
224 <tr>
225 <th class="label"><?php esc_html_e('Status', 'yatra'); ?></th>
226 <td><span class="status <?php echo $statusClass; ?>"><?php echo htmlspecialchars($bookingStatus, ENT_QUOTES, 'UTF-8'); ?></span></td>
227 </tr>
228 </table>
229 </td>
230 </tr>
231 </table>
232 </div>
233
234 <!-- Trip Highlights -->
235 <?php if (!empty($tripHighlights)): ?>
236 <div class="section">
237 <div class="section-title"><?php esc_html_e('Trip Highlights', 'yatra'); ?></div>
238 <div class="itinerary-highlights">
239 <?php
240 $highlights = is_array($tripHighlights) ? $tripHighlights : explode("\n", $tripHighlights);
241 foreach ($highlights as $highlight):
242 $highlight = trim($highlight);
243 if (!empty($highlight)):
244 ?>
245 <div class="highlight-item">
246 <div class="highlight-title">• <?php echo htmlspecialchars($highlight, ENT_QUOTES, 'UTF-8'); ?></div>
247 </div>
248 <?php
249 endif;
250 endforeach;
251 ?>
252 </div>
253 </div>
254 <?php endif; ?>
255
256 <!-- Travel Timeline -->
257 <div class="section">
258 <div class="section-title"><?php esc_html_e('Travel Timeline', 'yatra'); ?></div>
259 <div class="timeline">
260 <div class="timeline-item">
261 <div class="timeline-date"><?php echo htmlspecialchars($travelDate ?: 'TBD', ENT_QUOTES, 'UTF-8'); ?></div>
262 <div class="timeline-title"><?php esc_html_e('Departure', 'yatra'); ?></div>
263 <div class="timeline-desc"><?php echo esc_html(sprintf(__('Departure from %s. Please arrive at least 30 minutes before departure time.', 'yatra'), htmlspecialchars($departureLocation ?: __('meeting point', 'yatra'), ENT_QUOTES, 'UTF-8'))); ?></div>
264 </div>
265
266 <div class="timeline-item">
267 <div class="timeline-date"><?php echo htmlspecialchars($travelDate ?: 'TBD', ENT_QUOTES, 'UTF-8'); ?></div>
268 <div class="timeline-title"><?php esc_html_e('Arrival at Destination', 'yatra'); ?></div>
269 <div class="timeline-desc"><?php echo esc_html(sprintf(__('Arrival at %s. Check-in and accommodation briefing.', 'yatra'), htmlspecialchars($destination ?: __('destination', 'yatra'), ENT_QUOTES, 'UTF-8'))); ?></div>
270 </div>
271
272 <?php if (!empty($tripDuration)): ?>
273 <?php
274 $days = (int) preg_replace('/\D/', '', $tripDuration);
275 for ($i = 2; $i <= $days; $i++):
276 ?>
277 <div class="timeline-item">
278 <div class="timeline-date"><?php esc_html_e('Day', 'yatra'); ?> <?php echo $i; ?></div>
279 <div class="timeline-title"><?php esc_html_e('Activities & Sightseeing', 'yatra'); ?></div>
280 <div class="timeline-desc"><?php echo esc_html(sprintf(__('Full day of planned activities and sightseeing at %s. Detailed itinerary will be provided by your tour guide.', 'yatra'), htmlspecialchars($destination, ENT_QUOTES, 'UTF-8'))); ?></div>
281 </div>
282 <?php endfor; ?>
283 <?php endif; ?>
284
285 <?php if (!empty($returnDate)): ?>
286 <div class="timeline-item">
287 <div class="timeline-date"><?php echo htmlspecialchars($returnDate, ENT_QUOTES, 'UTF-8'); ?></div>
288 <div class="timeline-title"><?php esc_html_e('Return Journey', 'yatra'); ?></div>
289 <div class="timeline-desc"><?php echo esc_html(sprintf(__('Departure from %s and return to %s.', 'yatra'), htmlspecialchars($destination, ENT_QUOTES, 'UTF-8'), htmlspecialchars($departureLocation ?: __('origin', 'yatra'), ENT_QUOTES, 'UTF-8'))); ?></div>
290 </div>
291 <?php endif; ?>
292 </div>
293 </div>
294
295 <!-- Important Information -->
296 <div class="section">
297 <div class="section-title"><?php esc_html_e('Important Information', 'yatra'); ?></div>
298 <table class="trip-details">
299 <tr>
300 <th class="label"><?php esc_html_e('What to Bring', 'yatra'); ?></th>
301 <td>Comfortable clothing, walking shoes, sunscreen, hat, camera, personal medications, and any required travel documents.</td>
302 </tr>
303 <tr>
304 <th class="label"><?php esc_html_e('Weather Conditions', 'yatra'); ?></th>
305 <td>Please check weather forecast before departure and pack accordingly. Weather conditions may vary by destination.</td>
306 </tr>
307 <tr>
308 <th class="label"><?php esc_html_e('Emergency Contact', 'yatra'); ?></th>
309 <td><?php echo htmlspecialchars($companyPhone ?: 'Contact your travel agent', ENT_QUOTES, 'UTF-8'); ?></td>
310 </tr>
311 </table>
312 </div>
313
314 <!-- What's Included -->
315 <?php if (!empty($tripIncludes)): ?>
316 <div class="section avoid-break">
317 <div class="section-title"><?php esc_html_e('What\'s Included', 'yatra'); ?></div>
318 <div class="trip-description">
319 <?php
320 $includes = is_array($tripIncludes) ? $tripIncludes : explode("\n", $tripIncludes);
321 foreach ($includes as $include):
322 $include = trim($include);
323 if (!empty($include)):
324 ?>
325 <p>• <?php echo htmlspecialchars($include, ENT_QUOTES, 'UTF-8'); ?></p>
326 <?php
327 endif;
328 endforeach;
329 ?>
330 </div>
331 </div>
332 <?php endif; ?>
333
334 <!-- What's Not Included -->
335 <?php if (!empty($tripExcludes)): ?>
336 <div class="section avoid-break">
337 <div class="section-title"><?php esc_html_e('What\'s Not Included', 'yatra'); ?></div>
338 <div class="trip-description">
339 <?php
340 $excludes = is_array($tripExcludes) ? $tripExcludes : explode("\n", $tripExcludes);
341 foreach ($excludes as $exclude):
342 $exclude = trim($exclude);
343 if (!empty($exclude)):
344 ?>
345 <p>• <?php echo htmlspecialchars($exclude, ENT_QUOTES, 'UTF-8'); ?></p>
346 <?php
347 endif;
348 endforeach;
349 ?>
350 </div>
351 </div>
352 <?php endif; ?>
353
354 <!-- Footer -->
355 <table class="footer">
356 <tr>
357 <td style="width: 60%;">
358 <p><strong><?php echo htmlspecialchars($companyName ?: 'Travel Company', ENT_QUOTES, 'UTF-8'); ?></strong></p>
359 <p><?php echo htmlspecialchars($companyAddress, ENT_QUOTES, 'UTF-8'); ?></p>
360 <p>Email: <?php echo htmlspecialchars($companyEmail, ENT_QUOTES, 'UTF-8'); ?> | Phone: <?php echo htmlspecialchars($companyPhone, ENT_QUOTES, 'UTF-8'); ?></p>
361 </td>
362 <td style="width: 40%; text-align: right;">
363 <p>This is a computer-generated document.</p>
364 <p>No signature required.</p>
365 </td>
366 </tr>
367 </table>
368 </div>
369 </body>
370 </html>
371