Просмотр исходного кода

Add location photo and footer to PDF

Alan Lam 8 лет назад
Родитель
Сommit
ff5bbf9f90
1 измененных файлов с 31 добавлено и 1 удалено
  1. 31 1
      template_processing/mystery_shop/test_pdf.php

+ 31 - 1
template_processing/mystery_shop/test_pdf.php

@@ -124,7 +124,18 @@ $pdf->SetFont("Arial");
 
 $pdf->SetFont("Arial", "", $small_font_size);
 $pdf->MultiCell(90, 4, Util::convertUTF8($test->additional_notes), 0, 1);
-$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetY($pdf->GetY() + $cell_height);
+
+// Location photo
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(95, $cell_height, "Location Photo", 0, 1);
+$pdf->SetFont("Arial");
+
+$location_photo = $test->getDirectory() . "/location_photo.jpg";
+
+$pdf->Image($location_photo, $pdf->GetX(), $pdf->GetY(), 90);
+
 
 // Staff Details
 $pdf->SetLeftMargin(107.5);
@@ -212,4 +223,23 @@ $pdf->Cell(95, $cell_height, "Staff Uniform Description:", 0, 1);
 $pdf->SetFont("Arial", "", $small_font_size);
 $pdf->MultiCell(90, 4, $value, 0, 1);
 
+// Footer
+$pdf->SetLeftMargin(10);
+
+$pdf->SetY(265);
+
+$pdf->SetFillColor(0, 146, 69);
+$pdf->Rect($pdf->GetX(), $pdf->GetY(), 190, 1, "DF");
+
+$pdf->SetY($pdf->GetY() + 6);
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(0, $cell_height, "Check Policy Limited");
+$pdf->SetY($pdf->GetY() + $cell_height);
+$pdf->SetFont("Arial", "", $normal_font_size);
+$pdf->Cell(0, $cell_height, "8 Market Street, Liskeard, Cornwall, PL14 3JJ");
+$pdf->SetY($pdf->GetY() + $cell_height);
+$pdf->Cell(0, $cell_height, "Company Number: 09506865");
+
+
 ?>