SetFont('helvetica', 'B', 18); // Company Details $this->SetY(15); $this->Cell(0, 10, 'Safari Muscat Tourism LLC', 0, true, 'C', 0, '', 0, false, 'M', 'M'); $this->SetFont('helvetica', '', 10); $this->Cell(0, 8, 'Central Market, Salalah, Dhofar, Sultanate of Oman', 0, true, 'C', 0, '', 0, false, 'M', 'M'); $this->Cell(0, 8, 'PO Box: 211 | Phone: +968 99737165', 0, true, 'C', 0, '', 0, false, 'M', 'M'); // Title $this->SetFont('helvetica', 'B', 20); $this->SetY(45); $this->Cell(0, 15, 'Airfare Request Quotation', 0, true, 'C', 0, '', 0, false, 'M', 'M'); // Add a line under the title $this->SetLineStyle(array('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(150, 150, 150))); $this->Line(15, $this->GetY(), $this->getPageWidth() - 15, $this->GetY()); // Line break $this->Ln(8); } // Page footer public function Footer() { // Position at 15 mm from bottom $this->SetY(-15); // Set font $this->SetFont('helvetica', 'I', 8); // Page number $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } // Create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // Set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Safari Muscat Tourism LLC'); $pdf->SetTitle('Airfare Request - ' . $customerName); $pdf->SetSubject('Airfare Request Quotation'); // Set default header data $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // Set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // Set margins $pdf->SetMargins(PDF_MARGIN_LEFT, 60, PDF_MARGIN_RIGHT); // Increased top margin for header $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // Set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // Set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // Add a page $pdf->AddPage(); // Set font $pdf->SetFont('helvetica', '', 10); // --- CONTENT --- $html = ''; // Customer & Flight Details $html .= '

Customer Details

Name: ' . $customerName . '
Phone: ' . $phoneNumber . '
Email: ' . $email . '
Passengers: ' . $passengers . '

Flight Details

Departure: ' . $departureAirport . '
Arrival: ' . $arrivalAirport . '
Departure Date: ' . $departureDate . '
Return Date: ' . $returnDate . '

Airline: ' . $airline . '
Cabin Class: ' . $cabinClass . '
Layover: ' . $layover . '
Layover Airport: ' . $layoverAirport . '
Layover Duration: ' . $layoverDuration . '


'; // Fare & Baggage Details $html .= '

Fare & Baggage Summary

'; if ($infants > 0) { $html .= ' '; } if ($extraChargePrice > 0) { $html .= ' '; } $html .= '
Description Amount (OMR)
Passenger Fare (' . $passengers . ' x ' . number_format($fare, 3) . ') ' . $totalFare . '
Infant Fare (' . $infants . ' x ' . number_format($infantFare, 3) . ') ' . $totalInfantFare . '
' . $extraChargeDescription . ' ' . number_format($extraChargePrice, 3) . '
GRAND TOTAL ' . $grandTotal . '


'; // Baggage Details $html .= '

Baggage Allowance

Adult Checked Baggage: ' . $checkedBaggage . ' pc(s) @ ' . $weightPerPiece . ' kg each
Adult Hand Baggage: ' . $handBaggage . ' kg
Infant Baggage: ' . $infantBaggage . '
Baggage Notes: ' . $baggageNotes . '


'; // Additional Comments $html .= '

Additional Comments

' . nl2br($otherRequests) . '

'; // Print text using writeHTMLCell() $pdf->writeHTML($html, true, false, true, false, ''); // Close and output PDF document $pdf->Output('Safari_Muscat_Airfare_Request_' . preg_replace("/[^a-zA-Z0-9]/", "_", $customerName) . '.pdf', 'D'); } else { // If the form was not submitted, redirect to the form page header("Location: index.php"); exit(); } ?>