test_invoice.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <?php
  2. $test = Test::get($id);
  3. if(!$test) throw new Exception("Test not found.");
  4. if($test->status != Test::STATUS_COMPLETED) throw new Exception("An invoice cannot be generated for this test yet.");
  5. if(Core::$user->id != $test->tester_id && !Core::$user->canAdmin()) throw new Exception("You do not have permission to access this resource.");
  6. $project = $test->getProject();
  7. $location = $test->getLocation();
  8. $tester = $test->getTester();
  9. $location_address = $location->name . ", " . $location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]);
  10. $fee = !empty($test->test_fee) ? $test->test_fee : $project->default_tester_fee;
  11. $address = $tester->getInvoiceAddress();
  12. if(!$address) throw new Exception("Invoice address not found. Please set an address as the invoice address then try again.");
  13. if(!$tester->hasValidPaymentMethod()) throw new Exception("No valid payment method found. Please go to the Settings page and make sure all respective fields are filled in and then try again.");
  14. $address_parts = array_filter([
  15. $address->address_1,
  16. $address->address_2,
  17. $address->city,
  18. $address->county,
  19. $address->postal_code,
  20. ]);
  21. $reference =
  22. "T" . str_pad($test->id, 3, "0", STR_PAD_LEFT) .
  23. "/L" . str_pad($location->id, 3, "0", STR_PAD_LEFT) .
  24. "/U" . str_pad($tester->id, 3, "0", STR_PAD_LEFT);
  25. $tiny_font_size = 8;
  26. $small_font_size = 10;
  27. $normal_font_size = 10;
  28. $header_font_size = 14;
  29. $cell_height = 5;
  30. $cell_margin = 2;
  31. list($date_start, $time_start) = explode(" ", $test->dts_start);
  32. list($date_end, $time_end) = explode(" ", $test->dts_end);
  33. $dt_start = new DateTime($test->dts_start);
  34. $dt_end = new DateTime($test->dts_end);
  35. $diff = $dt_start->diff($dt_end, true);
  36. $date_start = date("d/m/Y", strtotime($test->dts_start));
  37. // A4 size: 210x297mm
  38. // Full Width = 210 - 20 = 190
  39. // Half Width = (210 - 20 - 10) / 2 = 90
  40. // Column 1 x = 10
  41. // Column 2 x = 110
  42. $pdf = new TestPDF("P", "mm", "A4");
  43. $pdf->SetSubject("Test Invoice");
  44. $pdf->SetCreator(APP_NAME);
  45. $pdf->SetAuthor(APP_NAME);
  46. $pdf->SetTitle("Invoice ($reference)");
  47. $pdf->AddPage();
  48. $pdf->SetFont("Arial");
  49. $pdf->SetDrawColor(240, 240, 240);
  50. $pdf->SetFillColor(240);
  51. $pdf->SetAutoPageBreak(false);
  52. // Right title
  53. $pdf->SetLeftMargin(110);
  54. $pdf->SetFont("Arial", "", 30);
  55. $pdf->MultiCell(90, 8, "INVOICE", 0, "R");
  56. $pdf->SetFontSize($normal_font_size);
  57. $pdf->MultiCell(90, 8, "Ref: $reference", 0, "R");
  58. $pdf->MoveY(8);
  59. $pdf->SetTextColor(128);
  60. $pdf->Cell(45, 8, "Date:", 0, 0, "R");
  61. $pdf->SetTextColor(0);
  62. $pdf->Cell(45, 8, date("d/m/Y"), 0, 1, "R");
  63. $pdf->SetTextColor(128);
  64. $pdf->Cell(45, 8, "Due Date:", 0, 0, "R");
  65. $pdf->SetTextColor(0);
  66. $pdf->Cell(45, 8, date("d/m/Y", time() + 864000), 0, 1, "R");
  67. $pdf->Rect(110, $pdf->GetY(), 90, 8, "F");
  68. $pdf->Cell(45, 8, "Balance Due:", 0, 0, "R");
  69. $pdf->SetTextColor(0);
  70. $pdf->Cell(45, 8, utf8_decode("£") . number_format($fee, 2), 0, 1, "R");
  71. // Left addresses
  72. $pdf->SetXY(10, 10);
  73. $pdf->SetLeftMargin(10);
  74. $pdf->SetTextColor(0);
  75. $pdf->SetFont("Arial", "B", $normal_font_size);
  76. $pdf->Cell(90, 4, $tester->getDisplayName(), 0, 1);
  77. $pdf->SetFont("Arial");
  78. $pdf->MultiCell(90, 4, implode("\n", $address_parts));
  79. $pdf->MoveY(8);
  80. $pdf->SetTextColor(128);
  81. $pdf->Cell(90, 4, "Bill To:", 0, 1);
  82. $pdf->SetFont("Arial", "B", $normal_font_size);
  83. $pdf->SetTextColor(0, 0, 0);
  84. $pdf->Cell(90, 4, APP_NAME, 0, 1);
  85. $pdf->SetFont("Arial");
  86. $pdf->MultiCell(90, 4, implode("\n", ["8 Market Street", "Liskeard", "Cornwall", "PL14 3JJ"]));
  87. // Header
  88. $pdf->MoveY(8);
  89. $pdf->SetFillColor(64);
  90. $pdf->Rect(10, $pdf->GetY(), 190, 8, "F");
  91. $pdf->SetTextColor(255);
  92. $pdf->Cell(115, 8, "Item");
  93. $pdf->Cell(15, 8, "Quantity");
  94. $pdf->Cell(30, 8, "Rate", 0, 0, "R");
  95. $pdf->Cell(30, 8, "Amount", 0, 0, "R");
  96. $pdf->MoveY(10);
  97. // Item
  98. $pdf->SetTextColor(0);
  99. $pdf->SetFont("Arial", "", $normal_font_size);
  100. $y = $pdf->GetY();
  101. $pdf->MultiCell(115, 5, "Age Verification Test\n$location_address\n" . date("d/m/Y H:i", strtotime($test->dts_start . " UTC")), 0, "L");
  102. $next_y = $pdf->GetY();
  103. $pdf->SetXY(125, $y);
  104. $pdf->Cell(15, 5, 1, 0, 0, "R");
  105. $pdf->Cell(30, 5, utf8_decode("£") . number_format($fee, 2), 0, 0, "R");
  106. $pdf->Cell(30, 5, utf8_decode("£") . number_format($fee, 2), 0, 0, "R");
  107. $pdf->SetXY(10, $next_y);
  108. $pdf->MoveY(10);
  109. $pdf->SetTextColor(128);
  110. $pdf->Cell(150, 5, "Total:", 0, 0, "R");
  111. $pdf->SetTextColor(0);
  112. $pdf->Cell(40, 5, utf8_decode("£") . number_format($fee, 2), 0, 1, "R");
  113. $pdf->MoveY(10);
  114. $pdf->SetTextColor(128);
  115. $pdf->MultiCell(190, 6, "Pay To:");
  116. $pdf->SetTextColor(0);
  117. $pdf->MultiCell(190, 6, $tester->getDisplayName());
  118. switch($tester->preferred_payment_method) {
  119. case User::PAYMENT_METHOD_BANK_TRANSFER: {
  120. $pdf->SetFont("Arial", "B");
  121. $pdf->MultiCell(190, 6, "Bank Transfer");
  122. $pdf->SetFont("Arial");
  123. $pdf->MultiCell(190, 6, "Bank Name: $tester->bank_name");
  124. $pdf->MultiCell(190, 6, "Sort Code: $tester->bank_sort_code");
  125. $pdf->MultiCell(190, 6, "Account Number: $tester->bank_account_number");
  126. break;
  127. }
  128. case User::PAYMENT_METHOD_PAYPAL: {
  129. $pdf->SetFont("Arial", "B");
  130. $pdf->MultiCell(190, 6, "PayPal");
  131. $pdf->SetFont("Arial");
  132. $pdf->MultiCell(190, 6, "PayPal Address: $tester->paypal_email");
  133. break;
  134. }
  135. }
  136. $pdf->MoveY(10);
  137. $pdf->SetTextColor(128);
  138. $pdf->MultiCell(190, 6, "Contact Info:");
  139. $pdf->SetTextColor(0);
  140. $pdf->MultiCell(190, 6, "Email: $tester->email");
  141. $pdf->MultiCell(190, 6, "Phone: $tester->phone");
  142. /*
  143. // Left contact info
  144. $y = 10;
  145. $pdf->SetFont("Arial", "B", $normal_font_size);
  146. $pdf->SetTextColor(255, 0, 0);
  147. $pdf->SetLeftMargin(120);
  148. $pdf->SetY(10);
  149. $pdf->Cell(80, 4, "Test / Location ID: $test->id / $location->id", 0, 1, "R");
  150. $pdf->SetFont("Arial", "");
  151. $pdf->SetTextColor(0, 0, 0);
  152. $pdf->Cell(80, 4, "Tel: 01579 342 104", 0, 1, "R", false, "tel:01579+342+104");
  153. $pdf->SetFont("Arial", "U");
  154. $pdf->SetTextColor(0, 128, 255);
  155. $pdf->Cell(80, 4, "check-policy.com", 0, 1, "R", false, "https://check-policy.com");
  156. $pdf->Cell(80, 4, "info@check-policy.com", 0, 1, "R");
  157. $pdf->SetLeftMargin(10);
  158. $pdf->SetXY(10, $pdf->GetY() + $cell_margin);
  159. // Header
  160. $pdf->SetTextColor(56, 87, 35);
  161. $pdf->SetFont("Arial", "B", $header_font_size);
  162. $pdf->Cell(190, 10, " Test Result", 0, 1, "L", true);
  163. // Pass/Fail
  164. $image_width = 130;
  165. if($test->pass) {
  166. $pdf->Image("public/img/pass.png", (210 - $image_width) / 2, $pdf->GetY() + 2, $image_width);
  167. }
  168. else {
  169. $pdf->Image("public/img/fail.png", (210 - $image_width) / 2, $pdf->GetY() + 2, $image_width);
  170. }
  171. $pdf->SetY($pdf->GetY() + 30);
  172. $pdf->SetTextColor(56, 87, 35);
  173. // Location / Tester Headers
  174. $pdf->SetFont("Arial", "B", $header_font_size);
  175. $tester_x = 150;
  176. $tester_y = $pdf->GetY();
  177. $header = " $location->name";
  178. if($location->internal_id) {
  179. $header .= " (ID: $location->internal_id)";
  180. }
  181. $pdf->Cell(135, 10, $header, 0, 1, "L", true);
  182. $pdf->SetY($pdf->GetY() + 2);
  183. $pdf->SetFont("Arial", "", $normal_font_size);
  184. $pdf->SetTextColor(0, 0, 0);
  185. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  186. $pdf->Cell(30, $cell_height, "Region / Manager:", 0, 0);
  187. $pdf->SetX($pdf->GetX() + 5);
  188. $pdf->Write($cell_height, $location->region);
  189. $pdf->Write($cell_height, "/ ");
  190. $pdf->Write($cell_height, $location->area_manager);
  191. $pdf->SetY($pdf->GetY() + $cell_height);
  192. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  193. $pdf->Cell(30, $cell_height, "Address:", 0, 0);
  194. $pdf->SetX($pdf->GetX() + 5);
  195. $pdf->MultiCell(100, $cell_height, $location->getDisplayAddress(["address_1", "address_2", "city"], "\n"), 0, 1);
  196. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  197. $pdf->Cell(30, $cell_height, "Postcode:", 0, 0);
  198. $pdf->SetX($pdf->GetX() + 5);
  199. $pdf->Cell(100, $cell_height, $location->postal_code, 0, 1);
  200. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  201. $pdf->Cell(30, $cell_height, "Shop Name - Left:", 0, 0);
  202. $pdf->SetX($pdf->GetX() + 5);
  203. $pdf->Cell(100, $cell_height, $test->shop_left, 0, 1);
  204. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  205. $pdf->Cell(30, $cell_height, "Shop Name - Right:", 0, 0);
  206. $pdf->SetX($pdf->GetX() + 5);
  207. $pdf->Cell(100, $cell_height, $test->shop_right, 0, 1);
  208. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
  209. $test_details_y = $pdf->GetY();
  210. // Tester Info
  211. $pdf->SetXY($tester_x, $tester_y);
  212. $pdf->SetLeftMargin(150);
  213. $pdf->SetTextColor(56, 87, 35);
  214. $pdf->SetFont("Arial", "B", $header_font_size);
  215. $pdf->Cell(50, 10, " Tester", 0, 1, "L", true);
  216. $pdf->SetY($pdf->GetY() + 2);
  217. $pdf->SetFont("Arial", "", $normal_font_size);
  218. $pdf->SetTextColor(0, 0, 0);
  219. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
  220. $pdf->Cell(20, $cell_height, "Gender:", 0, 0);
  221. $pdf->SetX($pdf->GetX() + 5);
  222. $pdf->Cell(20, $cell_height, $tester->getGenderText(), 0, 1);
  223. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
  224. $pdf->Cell(20, $cell_height, "Attire:", 0, 1);
  225. $pdf->SetX(150);
  226. $pdf->SetFont("Arial", "", $small_font_size);
  227. $pdf->MultiCell(50, 4, $test->attire, 0, 1);
  228. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
  229. // Test Details
  230. $pdf->SetLeftMargin(10);
  231. $pdf->setXY(10, $test_details_y + 5 + 2);
  232. $pdf->SetTextColor(56, 87, 35);
  233. $pdf->SetFont("Arial", "B", $header_font_size);
  234. $pdf->Cell(190, 10, " Test Details", 0, 1, "L", true);
  235. $pdf->SetY($pdf->GetY() + 2);
  236. // Date / Time
  237. $id_requests_y = $pdf->GetY();
  238. $pdf->SetFont("Arial", "B", $normal_font_size);
  239. $pdf->SetTextColor(0, 0, 0);
  240. $pdf->Cell(95, $cell_height, "Date & Time", 0, 1);
  241. $pdf->SetY($pdf->GetY() + 2);
  242. $pdf->SetFont("Arial");
  243. $pdf->Cell(23, $cell_height, "Date");
  244. $pdf->Cell(23, $cell_height, "Entry");
  245. $pdf->Cell(23, $cell_height, "Exit");
  246. $pdf->Cell(23, $cell_height, "Duration", 0, 1);
  247. $pdf->SetFont("Arial", "", $small_font_size);
  248. $pdf->Cell(23, $cell_height, $date_start);
  249. $pdf->Cell(23, $cell_height, $time_start);
  250. $pdf->Cell(23, $cell_height, $time_end);
  251. $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);
  252. $pdf->SetY($pdf->GetY() + 2);
  253. // Staff
  254. $pdf->SetFont("Arial", "B", $normal_font_size);
  255. $pdf->Cell(95, $cell_height, "Staff", 0, 1);
  256. $pdf->SetY($pdf->GetY() + 2);
  257. $pdf->SetFont("Arial");
  258. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  259. $pdf->Cell(30, $cell_height, "Name:", 0, 0);
  260. $pdf->SetX($pdf->GetX() + 5);
  261. $pdf->Cell(57.5, $cell_height, $test->challenger_name, 0, 1);
  262. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  263. $pdf->Cell(30, $cell_height, "Gender:", 0, 0);
  264. $pdf->SetX($pdf->GetX() + 5);
  265. $pdf->Cell(57.5, $cell_height, $test->challenger_gender, 0, 1);
  266. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  267. $pdf->Cell(30, $cell_height, "Description:", 0, 1);
  268. $pdf->SetFont("Arial", "", $small_font_size);
  269. $pdf->MultiCell(90, 4, $test->challenger_description, 0, 1);
  270. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  271. $pdf->SetY($pdf->GetY() + 2);
  272. $pdf->SetFont("Arial", "B", $normal_font_size);
  273. $pdf->Cell(95, $cell_height, "Tester's Notes", 0, 1);
  274. $pdf->SetY($pdf->GetY() + 2);
  275. $pdf->SetFont("Arial");
  276. $pdf->SetFont("Arial", "", $small_font_size);
  277. $pdf->MultiCell(90, 4, $test->additional_notes, 0, 1);
  278. $pdf->SetY($pdf->GetY() + 2);
  279. // Challenge
  280. $pdf->SetLeftMargin(107.5);
  281. $pdf->SetY($id_requests_y);
  282. $pdf->SetFont("Arial", "B", $normal_font_size);
  283. $pdf->Cell(95, $cell_height, "ID Request", 0, 1);
  284. $pdf->SetY($pdf->GetY() + 2);
  285. $pdf->SetFont("Arial");
  286. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  287. $pdf->Cell(30, $cell_height, "Result:", 0, 0);
  288. $pdf->SetX($pdf->GetX() + 5);
  289. $pdf->Cell(60, $cell_height, $test->getPassText(), 0, 1);
  290. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  291. $pdf->Cell(30, $cell_height, "ID Stage:", 0, 0);
  292. $pdf->SetX($pdf->GetX() + 5);
  293. $pdf->Cell(60, $cell_height, $test->challenge_stage . " - " . $test->getChallengeStageText(), 0, 1);
  294. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  295. $pdf->SetY($pdf->GetY() + 2);
  296. $pdf->SetFont("Arial", "", $small_font_size);
  297. $pdf->SetTextColor(0, 128, 0);
  298. $pdf->MultiCell(95, 4, "1: Challenge on entry", 0, 1);
  299. $pdf->SetTextColor(255, 128, 0);
  300. $pdf->MultiCell(95, 4, "2: Challenge while browsing
  301. 3: Challenge during play", 0, 1);
  302. $pdf->SetTextColor(255, 0, 0);
  303. $pdf->MultiCell(95, 4, "4: Challenge on exit
  304. 5: No challenge", 0, 1);
  305. $pdf->SetFont("Arial", "", $normal_font_size);
  306. $pdf->SetTextColor(0, 0, 0);
  307. $pdf->SetY($pdf->GetY() + 2);
  308. $pdf->SetFont("Arial", "", $normal_font_size);
  309. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  310. $pdf->Cell(30, $cell_height, "Eye Contact:", 0, 0);
  311. $pdf->SetX($pdf->GetX() + 5);
  312. $pdf->Cell(60, $cell_height, $test->challenger_eye_contact ? "Y" : "N", 0, 1);
  313. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  314. $pdf->Cell(95, $cell_height, "Description:", 0, 1);
  315. $pdf->SetFont("Arial", "", $small_font_size);
  316. $pdf->MultiCell(90, 4, $test->challenge_description, 0, 1);
  317. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  318. $pdf->SetY($pdf->GetY() + 2);
  319. // Details / Signage
  320. $pdf->SetFont("Arial", "B", $normal_font_size);
  321. $pdf->Cell(95, $cell_height, "Play Details & Signage", 0, 1);
  322. $pdf->SetY($pdf->GetY() + 2);
  323. $pdf->SetFont("Arial");
  324. $field_width = 50;
  325. $value_width = 40;
  326. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  327. $pdf->Cell($field_width, $cell_height, "Machine Played:", 0, 0);
  328. $pdf->SetX($pdf->GetX() + 5);
  329. $pdf->Cell($value_width, $cell_height, $values["play_machine"] ?? "N/A", 0, 1);
  330. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  331. $value = $values["play_jackpot"] ?? "N/A";
  332. if($value != "N/A") $value = "\xa3" . number_format($value);
  333. $pdf->Cell($field_width, $cell_height, "Jackpot Value:", 0, 0);
  334. $pdf->SetX($pdf->GetX() + 5);
  335. $pdf->Cell($value_width, $cell_height, $value, 0, 1);
  336. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  337. $value = $values["play_machine_stake"] ?? "N/A";
  338. if($value != "N/A") $value = "\xa3" . number_format($value, 2);
  339. $pdf->Cell($field_width, $cell_height, "Stake Played:", 0, 0);
  340. $pdf->SetX($pdf->GetX() + 5);
  341. $pdf->Cell($value_width, $cell_height, $value, 0, 1);
  342. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  343. $pdf->Cell($field_width, $cell_height, "Minutes Played:", 0, 0);
  344. $pdf->SetX($pdf->GetX() + 5);
  345. $pdf->Cell($value_width, $cell_height, $values["play_minutes"] ?? "N/A", 0, 1);
  346. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  347. $value = $values["play_spent"] ?? "N/A";
  348. if($value != "N/A") $value = "\xa3" . number_format($value, 2);
  349. $pdf->Cell($field_width, $cell_height, "Amount Spent:", 0, 0);
  350. $pdf->SetX($pdf->GetX() + 5);
  351. $pdf->Cell($value_width, $cell_height, $value, 0, 1);
  352. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  353. $pdf->Cell($field_width, $cell_height, "Think 21/25:", 0, 0);
  354. $pdf->SetX($pdf->GetX() + 5);
  355. $pdf->Cell($value_width, $cell_height, $values["think_21_25"] ?? "N/A", 0, 1);
  356. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  357. $value = $values["citizen_card_brochure_displayed"] ?? "";
  358. if(strlen($value) > 0) $value = $value ? "Yes" : "No";
  359. $pdf->Cell($field_width, $cell_height, "Citizen Card Brochure Displayed:", 0, 0);
  360. $pdf->SetX($pdf->GetX() + 5);
  361. $pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
  362. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  363. $value = $values["think_21_badge"] ?? "";
  364. if(strlen($value) > 0) $value = $value ? "Yes" : "No";
  365. $pdf->Cell($field_width, $cell_height, "Think 21/25 Badge Worn by Staff:", 0, 0);
  366. $pdf->SetX($pdf->GetX() + 5);
  367. $pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
  368. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  369. $value = $values["think_21_poster"] ?? "";
  370. if(strlen($value) > 0) $value = $value ? "Yes" : "No";
  371. $pdf->Cell($field_width, $cell_height, "Think 21/25 Posters Displayed:", 0, 0);
  372. $pdf->SetX($pdf->GetX() + 5);
  373. $pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
  374. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  375. $pdf->Cell($field_width, $cell_height, "Think 21/25 Poster Notes:", 0, 1);
  376. $pdf->SetFont("Arial", "", $small_font_size);
  377. $pdf->MultiCell(95, 4, $values["think_21_poster_notes"] ?? "N/A", 0, 1);
  378. $pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
  379. */
  380. // Output
  381. $pdf->Output();
  382. ?>