diff --git a/src/controllers/Register.php b/src/controllers/Register.php index 56562c96..95d86fdc 100644 --- a/src/controllers/Register.php +++ b/src/controllers/Register.php @@ -33,6 +33,7 @@ public function __construct() $this->view_data['defaultConfirmPassword'] = ""; $this->view_data['errors'] = []; $this->view_data['editMode'] = false; + $this->view_data['form_submitted'] = false; // get list of districts to be displayed on form $this->view_data['districts'] = District::getAll(); @@ -72,6 +73,7 @@ public function getFormData(): array private function handleFormSubmission(): void { + $this->view_data['form_submitted'] = true; $form_data = $this->getFormData(); // create a new client object @@ -115,7 +117,7 @@ private function handleFormSubmission(): void Utility::redirect('login'); } - (new Error())->index("An error occurred while processing your registration. Please try again later."); + (new Error())->handleUnknownError(); die(); } else { $this->loadDataToForm($form_data); @@ -148,7 +150,7 @@ private function validateURL(): bool private function handleInvalidURL(): void { if (!$this->validateURL()) { - (new Error())->index("Page not found"); + (new Error())->handlePageNotFoundError(); die(); } }