Explorar el Código

PDF changes. Temporary fix for boolean fields. Fail image changed.

Alan Lam hace 8 años
padre
commit
6fa6ffec9f
Se han modificado 2 ficheros con 33 adiciones y 4 borrados
  1. 33 4
      controllers/test_pdf.php
  2. BIN
      public/img/fail.png

+ 33 - 4
controllers/test_pdf.php

@@ -50,7 +50,16 @@ $pdf->Image("public/img/logo.png", 11, 10, 80);
 // Right contact info
 // Right contact info
 $y = 10;
 $y = 10;
 
 
+$pdf->SetFont("Arial", "B");
+$pdf->SetTextColor(255, 0, 0);
+
 $pdf->SetXY(115, $y = 10);
 $pdf->SetXY(115, $y = 10);
+$pdf->Cell(80, 5, "Test ID: $test->id", 0, 0, "R");
+
+$pdf->SetFont("Arial", "");
+$pdf->SetTextColor(0, 0, 0);
+
+$pdf->SetXY(115, $y += 5);
 $pdf->Cell(80, 5, "Tel: 01579 342 104", 0, 0, "R", false, "tel:01579+342+104");
 $pdf->Cell(80, 5, "Tel: 01579 342 104", 0, 0, "R", false, "tel:01579+342+104");
 
 
 $pdf->SetFont("Arial", "U");
 $pdf->SetFont("Arial", "U");
@@ -93,10 +102,17 @@ $pdf->SetY($pdf->GetY() + 2);
 $pdf->SetFont("Arial", "", $normal_font_size);
 $pdf->SetFont("Arial", "", $normal_font_size);
 $pdf->SetTextColor(0, 0, 0);
 $pdf->SetTextColor(0, 0, 0);
 
 
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+$pdf->Cell(30, $cell_height, "Location ID:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(100, $cell_height, $test->location_id, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
 $pdf->Cell(30, $cell_height, "Manager:", 0, 0);
 $pdf->Cell(30, $cell_height, "Manager:", 0, 0);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->SetX($pdf->GetX() + 5);
-$pdf->Cell(100, $cell_height, "N/A", 0, 1);
+$pdf->Cell(100, $cell_height, $location->area_manager, 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
 
 
 $pdf->Cell(30, $cell_height, "Phone:", 0, 0);
 $pdf->Cell(30, $cell_height, "Phone:", 0, 0);
@@ -299,6 +315,11 @@ $pdf->SetX($pdf->GetX() + 5);
 $pdf->Cell($value_width, $cell_height, $values["play_jackpot"] ?? "N/A", 0, 1);
 $pdf->Cell($value_width, $cell_height, $values["play_jackpot"] ?? "N/A", 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 
 
+$pdf->Cell($field_width, $cell_height, "Stake Played:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $values["play_machine_stake"] ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
 $pdf->Cell($field_width, $cell_height, "Minutes Played:", 0, 0);
 $pdf->Cell($field_width, $cell_height, "Minutes Played:", 0, 0);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->Cell($value_width, $cell_height, $values["play_minutes"] ?? "N/A", 0, 1);
 $pdf->Cell($value_width, $cell_height, $values["play_minutes"] ?? "N/A", 0, 1);
@@ -309,20 +330,28 @@ $pdf->SetX($pdf->GetX() + 5);
 $pdf->Cell($value_width, $cell_height, $values["play_spent"] ?? "N/A", 0, 1);
 $pdf->Cell($value_width, $cell_height, $values["play_spent"] ?? "N/A", 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 
 
+$value = $values["citizen_card_brochure_displayed"];
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
 
 
 $pdf->Cell($field_width, $cell_height, "Citizen Card Brochure Displayed:", 0, 0);
 $pdf->Cell($field_width, $cell_height, "Citizen Card Brochure Displayed:", 0, 0);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->SetX($pdf->GetX() + 5);
-$pdf->Cell($value_width, $cell_height, $values["citizen_card_brochure_displayed"] ?? "N/A", 0, 1);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 
 
+$value = $values["think_21_badge"];
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
 $pdf->Cell($field_width, $cell_height, "Think 21 Badge Worn by Staff:", 0, 0);
 $pdf->Cell($field_width, $cell_height, "Think 21 Badge Worn by Staff:", 0, 0);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->SetX($pdf->GetX() + 5);
-$pdf->Cell($value_width, $cell_height, $values["think_21_badge"] ?? "N/A", 0, 1);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 
 
+$value = $values["think_21_poster"];
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
 $pdf->Cell($field_width, $cell_height, "Think 21 Posters Displayed:", 0, 0);
 $pdf->Cell($field_width, $cell_height, "Think 21 Posters Displayed:", 0, 0);
 $pdf->SetX($pdf->GetX() + 5);
 $pdf->SetX($pdf->GetX() + 5);
-$pdf->Cell($value_width, $cell_height, $values["think_21_poster"] ?? "N/A", 0, 1);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
 
 
 $pdf->Cell($field_width, $cell_height, "Think 21 Poster Notes:", 0, 1);
 $pdf->Cell($field_width, $cell_height, "Think 21 Poster Notes:", 0, 1);

BIN
public/img/fail.png