| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <?php
- // Location / Tester Headers
- $pdf->SetTextColor(56, 87, 35);
- $pdf->SetFont("Arial", "B", $header_font_size);
- $tester_x = 150;
- $tester_y = $pdf->GetY();
- $pdf->Cell(135, 10, $location_text, 0, 1, "L", true);
- $pdf->SetY($pdf->GetY() + 2);
- $pdf->SetFont("Arial", "", $normal_font_size);
- $pdf->SetTextColor(0, 0, 0);
- $pdf->Cell(30, $cell_height, "Region / Manager:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Write($cell_height, $location->region);
- $pdf->Write($cell_height, "/ ");
- $pdf->Write($cell_height, $location->area_manager);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $pdf->Cell(30, $cell_height, "Address:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->MultiCell(100, $cell_height, $location->getDisplayAddress(["address_1", "address_2", "city"], "\n"), 0, 1);
- $pdf->Cell(30, $cell_height, "Postcode:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(100, $cell_height, $location->postal_code, 0, 1);
- $pdf->Cell(30, $cell_height, "Shop Name - Left:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(100, $cell_height, $test->shop_left, 0, 1);
- $pdf->Cell(30, $cell_height, "Shop Name - Right:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(100, $cell_height, $test->shop_right, 0, 1);
- $test_details_y = $pdf->GetY();
- // Tester Info
- $pdf->SetXY($tester_x, $tester_y);
- $pdf->SetLeftMargin(150);
- $pdf->SetTextColor(56, 87, 35);
- $pdf->SetFont("Arial", "B", $header_font_size);
- $pdf->Cell(50, 10, " Tester", 0, 1, "L", true);
- $pdf->SetY($pdf->GetY() + 2);
- $pdf->SetFont("Arial", "", $normal_font_size);
- $pdf->SetTextColor(0, 0, 0);
- $pdf->Cell(20, $cell_height, "Gender:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(20, $cell_height, $tester->getGenderText(), 0, 1);
- $pdf->Cell(20, $cell_height, "Attire:", 0, 1);
- $pdf->SetX(150);
- $pdf->SetFont("Arial", "", $small_font_size);
- $pdf->MultiCell(50, 4, $test->attire, 0, 1);
- // Test Details
- $pdf->SetLeftMargin(10);
- $pdf->setXY(10, $test_details_y + 5 + 2);
- $pdf->SetTextColor(56, 87, 35);
- $pdf->SetFont("Arial", "B", $header_font_size);
- $pdf->Cell(190, 10, " Test Details", 0, 1, "L", true);
- $pdf->SetY($pdf->GetY() + 2);
- // Date / Time
- $id_requests_y = $pdf->GetY();
- $pdf->SetFont("Arial", "B", $normal_font_size);
- $pdf->SetTextColor(0, 0, 0);
- $pdf->Cell(95, $cell_height, "Date & Time", 0, 1);
- $pdf->SetFont("Arial");
- $pdf->Cell(23, $cell_height, "Date");
- $pdf->Cell(23, $cell_height, "Entry");
- $pdf->Cell(23, $cell_height, "Exit");
- $pdf->Cell(23, $cell_height, "Duration", 0, 1);
- $pdf->SetFont("Arial", "", $small_font_size);
- $pdf->Cell(23, $cell_height, $date_start);
- $pdf->Cell(23, $cell_height, $time_start);
- $pdf->Cell(23, $cell_height, $time_end);
- $pdf->Cell(23, $cell_height, str_pad($diff->h, 2, "0", STR_PAD_LEFT) . ":" . str_pad($diff->i, 2, "0", STR_PAD_LEFT) . ":" . str_pad($diff->s, 2, "0", STR_PAD_LEFT), 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- // Venue Details
- $pdf->SetFont("Arial", "B", $normal_font_size);
- $pdf->Cell(95, $cell_height, "Venue", 0, 1);
- $pdf->SetFont("Arial");
- $cleanliness = $values["cleanliness"];
- switch($cleanliness) {
- case 1: $cleanliness = "Very dirty"; break;
- case 2: $cleanliness = "Dirty"; break;
- case 3: $cleanliness = "Adequate"; break;
- case 4: $cleanliness = "Clean"; break;
- case 5: $cleanliness = "Very clean"; break;
- }
- $pdf->Cell(30, $cell_height, "Cleanliness:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(57.5, $cell_height, $cleanliness, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $pdf->SetFont("Arial", "B", $normal_font_size);
- $pdf->Cell(95, $cell_height, "Tester's Notes", 0, 1);
- $pdf->SetFont("Arial");
- $pdf->SetFont("Arial", "", $small_font_size);
- $pdf->MultiCell(90, 4, Util::convertUTF8($test->additional_notes), 0, 1);
- $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_path = $test->getDirectory() . "/location_photo.jpg";
- $size = getimagesize($location_photo_path);
- list($image_width, $image_height) = $size;
- $width = 0;
- $height = 0;
- if($image_height > $image_width) {
- $height = 70;
- }
- else {
- $width = 70;
- }
- $pdf->Image($location_photo_path, $pdf->GetX(), $pdf->GetY(), $width, $height);
- // Staff Details
- $pdf->SetLeftMargin(107.5);
- $pdf->SetY($id_requests_y);
- $pdf->SetFont("Arial", "B", $normal_font_size);
- $pdf->Cell(95, $cell_height, "Staff Details", 0, 1);
- $pdf->SetFont("Arial");
- $value = $values["staff_badge_worn"] ?? "";
- if(strlen($value) == 0) $value = "Don't know/Not approached";
- else $value = ($value == 0) ? "No" : "Yes";
- $pdf->Cell(30, $cell_height, "Staff Badge Worn:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $value = $values["staff_name"] ?? "";
- $pdf->Cell(30, $cell_height, "Staff Name:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $value = $values["drink_offered"] ?? "";
- $value = $value ? "Yes" : "No";
- $pdf->Cell(30, $cell_height, "Drink Offered:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $value = $values["staff_offered_drink_name"] ?? "";
- $value = $value ?: "No drink offered";
- $pdf->Cell(30, $cell_height, "Drink Name:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $value = $values["staff_offered_promotion"] ?? "";
- $value = $value ? "Yes" : "No";
- $pdf->Cell(30, $cell_height, "Promotion Offered:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $value = $values["staff_offered_promotion_name"] ?? "";
- $value = $value ?: "No promotion offered";
- $pdf->Cell(95, $cell_height, "Promotion Name:", 0, 1);
- $pdf->SetFont("Arial", "", $small_font_size);
- $pdf->MultiCell(90, 4, $value, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $value = $values["staff_help"] ?? "";
- $value = $value ? "Yes" : "No";
- $pdf->Cell(30, $cell_height, "Machine Explanation:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $value = $values["staff_behaviour"];
- switch($value) {
- case 1: $value = "Rude"; break;
- case 2: $value = "Slightly rude"; break;
- case 3: $value = "Neither rude or polite"; break;
- case 4: $value = "Polite and friendly"; break;
- case 5: $value = "Very polite and friendly"; break;
- default: $value = "N/A"; break;
- }
- $pdf->Cell(30, $cell_height, "Staff Behaviour:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $pdf->SetY($pdf->GetY() + $cell_height);
- $value = $values["staff_uniform"] ?? "";
- $value = $value ? "Yes" : "No";
- $pdf->Cell(30, $cell_height, "Staff Uniform:", 0, 0);
- $pdf->SetX($pdf->GetX() + 5);
- $pdf->Cell(60, $cell_height, $value, 0, 1);
- $value = $values["staff_uniform_description"] ?? "";
- $value = $value ?: "N/A";
- $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");
- ?>
|