<?php
require('../../fpdf.php');
include "../../root.class.php";

$db = new db_safeguard();
$request_res = $db->query("delivery_request", "SELECT * FROM delivery_request WHERE supplier_batch_no = '{$_GET['supplier_batch_no']}'");
$request_data = $request_res->fetch_assoc();

$pdf = new FPDF();
$pdf->AliasNbPages();
$pdf->AddPage('p');

$pdf->SetFont('Arial', 'B', 20);
$pdf->Cell(200, 15, "DELIVERY SCHEDULE REQUEST" , 0, 1, 'C');
$pdf->Cell(200, 15, "FOR {$_GET['supplier_batch_no']}" , 0, 1, 'C');
$pdf->Cell(10, 8, '', 0, 1, 'L');
$pdf->SetFont('Arial', '', 10);

$pdf->Cell(70, 8, "Date Created : ", "", 0, 'L');
$pdf->Cell(70, 8, $request_data['date_created'], "", 1, 'L');
$pdf->Cell(70, 8, "PURCHASE ORDER NO : ", "", 0, 'L');
$pdf->Cell(70, 8, $request_data['purchase_order_no'], "", 1, 'L');
$pdf->Cell(10, 5, '', 0, 1, 'L');

$pdf->Cell(70, 8, "Delivery Contact Person : ", "", 0, 'L');
$pdf->Cell(70, 8, $request_data['contact_person'], "", 1, 'L');
$pdf->Cell(70, 8, "Delivery Contact Number : ", "", 0, 'L');
$pdf->Cell(70, 8, $request_data['contact_number'], "", 1, 'L');
$pdf->Cell(10, 5, '', 0, 1, 'L');

$pdf->Cell(70, 8, "Delivery certificate email : ", "", 0, 'L');
$pdf->Cell(70, 8, $request_data['delivery_certificate_email'], "", 1, 'L');

$pdf->Output();