| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php /** @noinspection PhpUnhandledExceptionInspection */
- /**
- * @controller test.php
- *
- * @var Test $test
- * @var Location $location
- * @var Project $project
- * @var Template $template
- */
- ?>
- <div class="container mt-3 py-4">
- <?php
- if($test->isConfirmed()) {
- $template->renderBeforeTestForm();
- }
- else if($test->hasStarted()) {
- $template->renderDuringTestForm();
- }
- else if($test->isPendingVerification()) {
- $json = json_decode($template->getJSON());
- $fields = $json->duringTest;
- $values = $test->getValues(true);
- ?>
- <div class="alert alert-info">
- <i class="fal fa-fw fa-info-circle"></i>
- <?=htmlspecialchars(__("Answer as clearly and accurately as you can otherwise you may be contacted after the test for clarification and/or verification purposes."))?>
- </div>
- <form method="post" id="test-form">
- <?php
- foreach($fields as $field) {
- $name = $field->name ?? false;
- if($name) {
- if(isset($test->$name)) $field->value = $test->$name;
- if(isset($values[$name])) $field->value = $values[$name];
- }
- $field->template = $template;
- Form::renderField($field);
- }
- ?>
- <input type="hidden" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>" />
- <input type="hidden" name="void" id="void" value="0" />
- <div class="form-group">
- <button class="btn btn-block btn-success" type="submit" id="test-submit-button">
- <?=htmlspecialchars(__("Submit Test Results"))?>
- </button>
- </div>
- <p><?=htmlspecialchars(__("If the venue was closed, please enter notes and then click the button below."))?></p>
- <div class="form-group">
- <label for="void-notes"><?=htmlspecialchars(__("Venue Closed Notes"))?></label>
- <textarea class="form-control" type="text" name="void_notes" id="void-notes" rows="4" placeholder="<?=htmlspecialchars(__("Enter venue closed notes"))?>"></textarea>
- </div>
- <div class="form-group">
- <button class="btn btn-block btn-secondary" type="submit" id="test-void-button">
- <?=htmlspecialchars(__("Venue Was Closed"))?>
- </button>
- </div>
- <div class="text-center">
- <small class="form-text text-muted d-none" id="test-no-internet-text">
- <span class="text-danger"><?=htmlspecialchars(__("No Internet Connectivity"))?></span><br />
- <?=htmlspecialchars(__("Please check your Internet connectivity and try again."))?>
- </small>
- <small id="test-submit-status">
- </small>
- </div>
- </form>
- <?php
- }
- else {
- ?>
- <h2><?=htmlspecialchars(__("Test Completed"))?></h2>
- <div class="alert alert-success">
- <?=sprintf(htmlspecialchars(__("This test is now completed. %sClick here%s to return to the Account page.")), '<a href="/account">', '</a>')?>
- </div>
- <?php
- }
- ?>
- </div>
|