getProcessingFilePath($processing_file); // Get fields $config = json_decode($this->getJSON()); $fields = array_merge($config->beforeTest, $config->duringTest); $fields = array_filter($fields, function($field) { if(!isset($field->name)) return false; if($field->type == "file") return false; return true; }); // Output header("Content-Type: text/plain"); header("Content-Disposition: attachment; filename=\"export.csv\""); header("Cache-Control: private, max-age=0, must-revalidate"); header("Pragma: public"); $handle = fopen("php://output", "w"); require $processing_file_path; fclose($handle); } public function getJSON() { $json_path = ROOT_DIR . "/json/" . $this->json_file; if(!empty($this->json_file) && file_exists($json_path)) { return file_get_contents($json_path); } return $this->json; } public function getCustomer() { return Customer::get($this->customer_id); } public function getProcessingFilePath($file) { if(!$this->folder) throw new Exception("Template processing folder not set."); $folder_path = ROOT_DIR . "/template_processing/" . $this->folder; if(!file_exists($folder_path)) throw new Exception("Template processing folder does not exist."); $file_path = $folder_path . "/" . $file; if(!file_exists($file_path)) { $file_path = ROOT_DIR . "/template_processing/_common/{$file}"; if(!file_exists($file_path)) throw new Exception("Template processing file \"$file\" does not exist."); } return $file_path; } public function getURL() { return "/account/templates/" . $this->id; } public function getFields() { $fields = []; $json = json_decode($this->getJSON()); $before_fields = $json->beforeTest; $during_fields = $json->duringTest; $all_fields = array_merge($before_fields, $during_fields); foreach($all_fields as $field) { if(empty($field->name)) continue; $fields[$field->name] = $field; } return $fields; } public function getTesterInvoiceFields() { $json = json_decode($this->getJSON()); if(!$json) throw new Exception("Failed to decode template JSON."); return $json->testerInvoiceFields ?? []; } public function getCustomerInvoiceFields() { $json = json_decode($this->getJSON()); if(!$json) throw new Exception("Failed to decode template JSON."); return $json->customerInvoiceFields ?? []; } public function getTesterInvoiceCosts($values = []) { $costs = 0; $invoice_fields = $this->getTesterInvoiceFields(); foreach($invoice_fields as $field) { $costs += (float) $values[$field->name] ?? 0; } return $costs; } public function setOverrides($overrides) { $this->overrides = $overrides; } public function applyOverridesToField($field) { foreach($this->overrides as $override) { if(empty($field->name)) continue; if($override->field == $field->name) { switch($override->element) { case "label": $field->label = $override->value; break; } } } return $field; } public function renderBeforeTestForm() { $json = json_decode($this->getJSON()); $fields = $json->beforeTest; ?>
Answer as clearly and accurately as you can otherwise you may be contacted after the test for clarification and/or verification purposes.
applyOverridesToField($field); Form::renderField($field); } ?> " /> Please note that it may take a while for photos to upload. Please do not refresh the page when it is uploading.
getJSON()); $fields = $json->duringTest; ?>
Answer as clearly and accurately as you can otherwise you may be contacted after the test for clarification and/or verification purposes.
applyOverridesToField($field); Form::renderField($field); } ?>

Entry/Exit Times

Please confirm your entry and exit times below. Please try to be as accurate as possible.

" /> No Internet Connectivity
Please check your Internet connectivity and try again.
pass_stage; } public function hasPassFail() { return !is_null($this->pass_stage); } }