| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <?php
- // Values
- $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;
- }
- $staff_badge_worn = $values["staff_badge_worn"] ?? "";
- if(strlen($staff_badge_worn) == 0) $staff_badge_worn = "Don't know/Not approached";
- else $staff_badge_worn = ($staff_badge_worn == 0) ? "No" : "Yes";
- $staff_offered_drink = $values["staff_offered_drink"] ?? "";
- $staff_offered_drink = $staff_offered_drink ? "Yes" : "No";
- $staff_offered_promotion = $values["staff_offered_promotion"] ?? "";
- $staff_offered_promotion = $staff_offered_promotion ? "Yes" : "No";
- $staff_help = $values["staff_help"] ?? "";
- $staff_help = $staff_help ? "Yes" : "No";
- $staff_behaviour = $values["staff_behaviour"] ?? 0;
- switch($staff_behaviour) {
- case 1: $staff_behaviour = "Rude"; break;
- case 2: $staff_behaviour = "Slightly rude"; break;
- case 3: $staff_behaviour = "Neither rude or polite"; break;
- case 4: $staff_behaviour = "Polite and friendly"; break;
- case 5: $staff_behaviour = "Very polite and friendly"; break;
- default: $staff_behaviour = ""; break;
- }
- $staff_uniform = $values["staff_uniform"] ?? "";
- $staff_uniform = $staff_uniform ? "Yes" : "No";
- // Location Photo
- $location_photo_path = $test->getDirectory() . "/location_photo.jpg";
- if(!file_exists($location_photo_path)) {
- $location_photo_path = "public/img/no_image_4_3.png";
- }
- $size = getimagesize($location_photo_path);
- list($image_width, $image_height) = $size;
- $width = "";
- $height = "";
- if($image_height > $image_width) {
- $height = "8cm";
- }
- else {
- $width = "100%";
- }
- $mpdf->imageVars["location_photo"] = file_get_contents($location_photo_path);
- ?>
- <div style="float: left; width: 70%; position: relative;">
- <h3 class="section"><?=htmlspecialchars($location_text)?></h3>
- <div class="bl">
- <div class="field"><?=htmlspecialchars($customer->region_field_name)?> / <?=htmlspecialchars($customer->area_manager_field_name)?>:</div>
- <div class="value">
- <?=TestPDF::getValueHtml($location->region)?> / <?=TestPDF::getValueHtml($location->area_manager)?>
- </div>
- </div>
- <div class="bl">
- <div class="field">Address:</div>
- <div class="value">
- <?=htmlspecialchars($location->address_1)?><br />
- <?php
- if($location->address_2) {
- ?>
- <?=htmlspecialchars($location->address_2)?><br />
- <?php
- }
- ?>
- <?=htmlspecialchars($location->city)?>
- </div>
- </div>
- <div class="bl">
- <div class="field">Postcode:</div>
- <div class="value"><?=htmlspecialchars($location->postal_code)?></div>
- </div>
- <div class="bl">
- <div class="field">Shop Name - Left:</div>
- <div class="value"><?=htmlspecialchars($test->shop_left)?></div>
- </div>
- <div>
- <div class="field">Shop Name - Right:</div>
- <div class="value"><?=htmlspecialchars($test->shop_right)?></div>
- </div>
- </div>
- <div style="float: right; width: 29%">
- <h3 class="section">Tester</h3>
- <div class="bl">
- <div class="field">Gender:</div>
- <div class="value"><?=htmlspecialchars($tester->getGenderText())?></div>
- </div>
- <div>
- <strong>Attire:</strong><br />
- <?=htmlspecialchars($test->attire)?>
- </div>
- </div>
- <div style="clear: both;"></div>
- <h3 class="section">Test Details</h3>
- <div style="float: left; width: 49.5%">
- <div class="subheader">
- <strong>Date & Time</strong>
- </div>
- <div style="float: left; width: 24%">
- <strong>Date:</strong><br />
- <?=htmlspecialchars($date_start)?>
- </div>
- <div style="float: left; width: 24%">
- <strong>Entry:</strong><br />
- <?=htmlspecialchars($time_start)?>
- </div>
- <div style="float: left; width: 24%">
- <strong>Exit:</strong><br />
- <?=htmlspecialchars($time_end)?>
- </div>
- <div style="float: left; width: 24%">
- <strong>Duration:</strong><br />
- <?=htmlspecialchars($duration_text)?>
- </div>
- <div style="clear: both;"></div><br />
- <div class="subheader">
- <strong>Venue</strong>
- </div>
- <div>
- <div class="field">Cleanliness:</div>
- <div class="value"><?=TestPDF::getValueHtml($cleanliness)?></div>
- </div>
- <br />
- <div class="subheader">
- <strong>Tester's Notes</strong>
- </div>
- <?=TestPDF::getValueHtml($test->additional_notes)?><br />
- <br />
- <div class="subheader">
- <strong>Location Photo</strong>
- </div>
- <img src="var:location_photo" width="<?=$width?>" height="<?=$height?>" />
- </div>
- <div style="float: right; width: 49.5%">
- <div class="wide-field-names">
- <div class="subheader">
- <strong>Staff Details</strong>
- </div>
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_badge_worn"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_badge_worn)?></div>
- </div>
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_name"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($values["staff_name"] ?? "")?></div>
- </div>
- <br />
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_offered_drink"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_offered_drink)?></div>
- </div>
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_offered_drink_name"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($values["staff_offered_drink_name"] ?? "")?></div>
- </div>
- <br />
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_offered_promotion"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_offered_promotion)?></div>
- </div>
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_offered_promotion_name"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($values["staff_offered_promotion_name"] ?? "")?></div>
- </div>
- <br />
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_help"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_help)?></div>
- </div>
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_behaviour"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_behaviour)?></div>
- </div>
- <br />
- <div>
- <div class="field"><?=htmlspecialchars($field_name_label_map["staff_uniform"])?>:</div>
- <div class="value"><?=TestPDF::getValueHtml($staff_uniform)?></div>
- </div>
- </div>
- <strong><?=htmlspecialchars($field_name_label_map["staff_uniform_description"])?>:</strong><br />
- <?=TestPDF::getValueHtml($values["staff_uniform_description"] ?? "")?>
- </div>
|