1
0

test_pdf.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <?php
  2. /**
  3. * @var Template $template
  4. * @var Test $test
  5. * @var array $values
  6. * @var string $location_text
  7. * @var Customer $customer
  8. * @var Location $location
  9. * @var User $tester
  10. * @var string $date_start
  11. * @var string $time_start
  12. * @var string $time_end
  13. * @var string $duration_text
  14. */
  15. $pass_image = $test->pass ? "pass.png" : "fail.png";
  16. // COVID-19
  17. $covid_19 = in_array("COVID-19", $template->getKeys());
  18. ?>
  19. <h3 class="section">Test Result</h3>
  20. <div align="center" style="margin: auto; width: 75%;">
  21. <img src="/img/<?=htmlspecialchars($pass_image)?>" alt="" />
  22. </div>
  23. <div style="float: left; width: 70%; position: relative;">
  24. <h3 class="section"><?=htmlspecialchars($location_text)?></h3>
  25. <div class="bl">
  26. <div class="field"><?=htmlspecialchars($customer->region_field_name)?> / <?=htmlspecialchars($customer->area_manager_field_name)?>:</div>
  27. <div class="value">
  28. <?=TestPDF::getValueHtml($location->region)?> / <?=TestPDF::getValueHtml($location->area_manager)?>
  29. </div>
  30. </div>
  31. <div class="bl">
  32. <div class="field">Address:</div>
  33. <div class="value">
  34. <?=htmlspecialchars($location->address_1)?><br />
  35. <?php
  36. if($location->address_2) {
  37. ?>
  38. <?=htmlspecialchars($location->address_2)?><br />
  39. <?php
  40. }
  41. ?>
  42. <?=htmlspecialchars($location->city)?>
  43. </div>
  44. </div>
  45. <div class="bl">
  46. <div class="field">Postcode:</div>
  47. <div class="value"><?=htmlspecialchars($location->postal_code)?></div>
  48. </div>
  49. <div class="bl">
  50. <div class="field">Shop Name - Left:</div>
  51. <div class="value"><?=htmlspecialchars($test->shop_left)?></div>
  52. </div>
  53. <div class="bl">
  54. <div class="field">Shop Name - Right:</div>
  55. <div class="value"><?=htmlspecialchars($test->shop_right)?></div>
  56. </div>
  57. <div>
  58. <div class="field">Door Sensor:</div>
  59. <div class="value"><?=TestPDF::getBooleanHtml($values["door_sensor_alert"] ?? false)?></div>
  60. </div>
  61. </div>
  62. <div style="float: right; width: 29%">
  63. <h3 class="section">Tester</h3>
  64. <div class="bl">
  65. <div class="field">Gender:</div>
  66. <div class="value"><?=htmlspecialchars($tester->getGenderText())?></div>
  67. </div>
  68. <div>
  69. <strong>Attire:</strong><br />
  70. <?=htmlspecialchars($test->attire)?>
  71. </div>
  72. </div>
  73. <div style="clear: both;"></div>
  74. <h3 class="section">Test Details</h3>
  75. <div class="wide-field-names" style="float: left; width: 49.5%">
  76. <div class="subheader">
  77. <strong>Date &amp; Time</strong>
  78. </div>
  79. <div style="float: left; width: 24%">
  80. <strong>Date:</strong><br />
  81. <?=htmlspecialchars($date_start)?>
  82. </div>
  83. <div style="float: left; width: 24%">
  84. <strong>Entry:</strong><br />
  85. <?=htmlspecialchars($time_start)?>
  86. </div>
  87. <div style="float: left; width: 24%">
  88. <strong>Exit:</strong><br />
  89. <?=htmlspecialchars($time_end)?>
  90. </div>
  91. <div style="float: left; width: 24%">
  92. <strong>Duration:</strong><br />
  93. <?=htmlspecialchars($duration_text)?>
  94. </div>
  95. <div style="clear: both;"></div><br />
  96. <?php
  97. if($covid_19) {
  98. ?>
  99. <div class="subheader">
  100. <strong>COVID-19</strong>
  101. </div>
  102. <div class="bl">
  103. <div class="field">Social Distancing Signage:</div>
  104. <div class="value"><?=TestPDF::getBooleanHtml($values["social_distancing_signage"] ?? false)?></div>
  105. </div>
  106. <div class="bl">
  107. <div class="field">Entrance Hand Sanitiser:</div>
  108. <div class="value"><?=TestPDF::getBooleanHtml($values["entrance_hand_sanitiser"] ?? false)?></div>
  109. </div>
  110. <div>
  111. <div class="field">Social Distancing Measures:</div>
  112. <div class="value"><?=TestPDF::getBooleanHtml($values["social_distancing_measures"] ?? false)?></div>
  113. </div>
  114. <?php
  115. }
  116. ?>
  117. <div style="clear: both;"></div><br />
  118. <div class="subheader">
  119. <strong>Staff</strong>
  120. </div>
  121. <div class="bl">
  122. <div class="field">Name:</div>
  123. <div class="value"><?=TestPDF::getValueHtml($test->challenger_name)?></div>
  124. </div>
  125. <div class="bl">
  126. <div class="field">Gender:</div>
  127. <div class="value"><?=TestPDF::getValueHtml(Util::getGenderText($test->challenger_gender))?></div>
  128. </div>
  129. <strong>Description:</strong><br />
  130. <?=TestPDF::getValueHtml($test->challenger_description)?><br />
  131. </div>
  132. <div style="float: right; width: 49.5%">
  133. <div class="subheader">
  134. <strong>ID Request</strong>
  135. </div>
  136. <?php
  137. $pass_colour = $test->pass ? "green" : "red";
  138. switch($test->challenge_stage) {
  139. case 1:
  140. $challenge_colour = "green";
  141. break;
  142. case 2:
  143. case 3:
  144. $challenge_colour = "orange";
  145. break;
  146. case 4:
  147. case 5:
  148. default:
  149. $challenge_colour = "red";
  150. break;
  151. }
  152. ?>
  153. <div class="bl">
  154. <div class="field">Result:</div>
  155. <div class="value" style="color: <?=$pass_colour?>">
  156. <strong><?=htmlspecialchars($test->getPassText())?></strong>
  157. </div>
  158. </div>
  159. <div>
  160. <div class="field">ID Stage:</div>
  161. <div class="value" style="color: <?=$challenge_colour?>">
  162. <strong><?=htmlspecialchars($test->challenge_stage . " - " . $test->getChallengeStageText())?></strong>
  163. </div>
  164. </div>
  165. <br />
  166. <div>
  167. <div style="color: green;">1: Challenge on entry</div>
  168. <div style="color: orange;">2: Challenge while browsing</div>
  169. <div style="color: orange;">3: Challenge during play</div>
  170. <div style="color: red;">4: Challenge on exit</div>
  171. <div style="color: red;">5: No challenge</div>
  172. </div>
  173. <br />
  174. <div class="bl">
  175. <div class="field">Eye Contact:</div>
  176. <div class="value"><?=($test->challenger_eye_contact ? "Yes" : "No")?></div>
  177. </div>
  178. <div>
  179. <strong>Description:</strong><br />
  180. <?=TestPDF::getValueHtml($test->challenge_description)?>
  181. </div>
  182. </div>
  183. <div class="clear"></div>
  184. <br />
  185. <div style="float: left; width: 49.5%">
  186. <div class="subheader">
  187. <strong>Play Details</strong>
  188. </div>
  189. <div class="wide-field-names">
  190. <div class="bl">
  191. <div class="field">Machine Played:</div>
  192. <div class="value"><?=TestPDF::getValueHtml($values["play_machine"] ?? "")?></div>
  193. </div>
  194. <?php
  195. $play_jackpot = $values["play_jackpot"] ?? "";
  196. if(!empty($play_jackpot)) {
  197. $play_jackpot = "£" . number_format($play_jackpot, 2);
  198. }
  199. ?>
  200. <div class="bl">
  201. <div class="field">Jackpot Value:</div>
  202. <div class="value"><?=TestPDF::getValueHtml($play_jackpot)?></div>
  203. </div>
  204. <?php
  205. $play_machine_stake = $values["play_machine_stake"] ?? "";
  206. if(!empty($play_machine_stake)) {
  207. $play_machine_stake = "£" . number_format($play_machine_stake, 2);
  208. }
  209. ?>
  210. <div class="bl">
  211. <div class="field">Stake Played:</div>
  212. <div class="value"><?=TestPDF::getValueHtml($play_machine_stake)?></div>
  213. </div>
  214. <div class="bl">
  215. <div class="field">Minutes Played:</div>
  216. <div class="value"><?=TestPDF::getValueHtml($values["play_minutes"] ?? "")?></div>
  217. </div>
  218. <?php
  219. $play_spent = $values["play_spent"] ?? "";
  220. if(!empty($play_spent)) $play_spent = "£" . number_format($play_spent, 2);
  221. ?>
  222. <div>
  223. <div class="field">Amount Spent:</div>
  224. <div class="value"><?=TestPDF::getValueHtml($play_spent)?></div>
  225. </div>
  226. </div>
  227. </div>
  228. <div style="float: right; width: 49.5%">
  229. <div class="subheader">
  230. <strong>Signage</strong>
  231. </div>
  232. <div class="wide-field-names">
  233. <div class="bl">
  234. <div class="field">Think 21/25:</div>
  235. <div class="value"><?=TestPDF::getValueHtml($values["think_21_25"] ?? "")?></div>
  236. </div>
  237. <?php
  238. $value = $values["citizen_card_brochure_displayed"] ?? "";
  239. if(strlen($value)) $value = $value ? "Yes" : "No";
  240. ?>
  241. <div class="bl">
  242. <div class="field">Citizen Card Brochure Displayed:</div>
  243. <div class="value"><?=TestPDF::getValueHtml($value)?></div>
  244. </div>
  245. <?php
  246. $value = $values["think_21_badge"] ?? "";
  247. if(strlen($value)) $value = $value ? "Yes" : "No";
  248. ?>
  249. <div class="bl">
  250. <div class="field">Think 21/25 Badge Worn by Staff:</div>
  251. <div class="value"><?=TestPDF::getValueHtml($value)?></div>
  252. </div>
  253. <?php
  254. $value = $values["think_21_poster"] ?? "";
  255. if(strlen($value)) $value = $value ? "Yes" : "No";
  256. ?>
  257. <div class="bl">
  258. <div class="field">Think 21/25 Posters Displayed:</div>
  259. <div class="value"><?=TestPDF::getValueHtml($value)?></div>
  260. </div>
  261. <strong>Think 21/25 Poster Notes:</strong><br />
  262. <?=TestPDF::getValueHtml($values["think_21_poster_notes"] ?? "")?>
  263. </div>
  264. </div>
  265. <div class="clear"></div>
  266. <br />
  267. <div>
  268. <div class="subheader">
  269. <strong>Additional Notes</strong>
  270. </div>
  271. <?=TestPDF::getValueHtml($test->additional_notes)?>
  272. </div>