From d6a78aa59d287bb13393f865550ebd582e80abf1 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Thu, 11 Apr 2019 11:25:58 -0600 Subject: [PATCH] Add optional unit number to youth --- pages/editperson.php | 10 ++++++++++ public/parts/template_person.php | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pages/editperson.php b/pages/editperson.php index f66d218..0e023bf 100644 --- a/pages/editperson.php +++ b/pages/editperson.php @@ -267,6 +267,16 @@ if (!empty($VARS['id']) && $database->has('people', ['personid' => $VARS['id']]) "value" => $data["phone2"], "pattern" => "[0-9]{10}", "error" => "Enter a 10-digit phone number (numbers only)." + ], + [ + "label" => "Unit #", + "name" => "unit", + "width" => 2, + "maxlength" => 4, + "pattern" => "[0-9]{3,4}", + "value" => $data["unit"], + "optional" => true, + "error" => "Enter the unit number." ] ]); } diff --git a/public/parts/template_person.php b/public/parts/template_person.php index 180c154..96af316 100644 --- a/public/parts/template_person.php +++ b/public/parts/template_person.php @@ -189,7 +189,17 @@ if (isset($personid) && $database->has('people', ['personid' => $personid])) { "value" => $personinfo["phone2"], "pattern" => "[0-9]{10}", "error" => "Enter a 10-digit phone number (numbers only)." - ] + ], + [ + "label" => "Unit #", + "name" => "unit", + "width" => 2, + "maxlength" => 4, + "pattern" => "[0-9]{3,4}", + "value" => $personinfo["unit"], + "optional" => true, + "error" => "Enter the unit number." + ], ]); } if ($type == "adult" || $type == "youth") {