"", "lastname" => "", "address" => "", "zip" => "", "phone1" => "", "phone2" => "", "email" => "", "unit" => "", "shirt" => "", "sex" => ""]; switch ($type) { case "camper": $personinfo["parentname"] = ""; $personinfo["rank"] = ""; break; case "youth": $personinfo["parentname"] = ""; $personinfo["days"] = ""; $personinfo["position"] = ""; break; case "adult": $personinfo["days"] = ""; $personinfo["position"] = ""; $personinfo["child_care"] = ""; break; } foreach ($_GET as $key => $val) { if (array_key_exists($key, $personinfo)) { $personinfo[$key] = htmlentities($val); } } if (isset($personid) && $database->has('people', ['personid' => $personid])) { $personinfo = $database->get('people', '*', ['personid' => $personid]); } else { do { $personid = mt_rand(0, 9999999999); } while ($database->has('people', ['personid' => $personid])); } ?>
Remove
"First Name", "name" => "firstname", "maxlength" => 255, "width" => 6, "value" => $personinfo["firstname"], "error" => "Enter the person's first name." ], [ "label" => "Last Name", "name" => "lastname", "width" => 6, "maxlength" => 255, "value" => $personinfo["lastname"], "error" => "Enter the person's last name." ] ]; if ($type == "camper") { $textboxes = array_merge($textboxes, [ [ "label" => "Parent/Guardian Name", "name" => "parentname", "width" => 12, "maxlength" => 255, "value" => $personinfo["parentname"], "error" => "Enter the parent or guardian's full name." ] ]); } $textboxes = array_merge($textboxes, [ [ "label" => "Address", "name" => "address", "maxlength" => 500, "width" => 8, "value" => $personinfo["address"], "error" => "Enter the person's home address." ], [ "label" => "ZIP Code", "name" => "zip", "maxlength" => 10, "width" => 4, "value" => $personinfo["zip"], "pattern" => "[0-9]{5}(-?[0-9]{4})?", "error" => "Enter a valid 5 or 9 digit ZIP code." ], [ "label" => "Phone Number", "name" => "phone1", "type" => "tel", "maxlength" => 20, "width" => 3, "value" => $personinfo["phone1"], "pattern" => "[0-9]{10}", "error" => "Enter a 10-digit phone number (numbers only)." ] ]); if ($type == "camper") { $textboxes = array_merge($textboxes, [ [ "label" => "Alt. Phone Number", "name" => "phone2", "type" => "tel", "maxlength" => 20, "width" => 3, "optional" => true, "value" => $personinfo["phone2"], "pattern" => "[0-9]{10}", "error" => "Enter a 10-digit phone number (numbers only)." ] ]); } $textboxes = array_merge($textboxes, [ [ "label" => "Email", "name" => "email", "maxlength" => 255, "width" => 5, "type" => "email", "value" => $personinfo["email"], "error" => "Enter your email address." ] ]); if ($type == "camper") { $textboxes = array_merge($textboxes, [ [ "label" => "Pack #", "name" => "unit", "width" => 2, "maxlength" => 4, "pattern" => "[0-9]{3,4}", "value" => $personinfo["unit"], "error" => "Enter the pack number." ], [ "label" => "Rank (as of June " . date("Y") . ")", "name" => "rank", "type" => "select", "width" => 2, "value" => $personinfo["rank"], "options" => [ "" => "Choose...", "Tiger" => "Tiger", "Wolf" => "Wolf", "Bear" => "Bear", "Webelos" => "Webelos", "Arrow of Light" => "Arrow of Light", ], "error" => "Choose a rank." ] ]); } if ($type == "youth") { $textboxes = array_merge($textboxes, [ [ "label" => "Parent Name", "name" => "parentname", "width" => 4, "maxlength" => 255, "value" => $personinfo["parentname"], "error" => "Enter the parent or guardian's full name." ], [ "label" => "Parent Phone", "name" => "phone2", "type" => "tel", "maxlength" => 20, "width" => 3, "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") { if ($type == "adult") { $positions = [ "None" => "No Preference", "Den Walker" => "Den Walker", "Station Leader" => "Station Leader", "Tot Lot" => "Tot Lot", "First Aid" => "First Aid", "Floater" => "Floater" ]; } else { $positions = [ "None" => "No Preference", "Den Chief" => "Den Chief", "Station" => "Station", "Tot Lot" => "Tot Lot", "Floater" => "Floater" ]; } $textboxes = array_merge($textboxes, [ [ "label" => "Available Days", "name" => "days", "type" => "checkboxes", "options" => $SETTINGS["camp_days"], "error" => "Choose at least one day." ], [ "label" => "Preferred Position", "name" => "position", "type" => "select", "width" => 5, "options" => $positions, "error" => "Choose a position." ], [ "label" => "Shirt Size", "name" => "shirt", "type" => "select", "value" => $personinfo["shirt"], "options" => [ "" => "Choose...", "NO" => "No Shirt", "YS" => "Youth Small", "YM" => "Youth Medium", "YL" => "Youth Large", "AS" => "Adult Small", "AM" => "Adult Medium", "AL" => "Adult Large", "AX" => "Adult Extra Large", "A2" => "Adult 2X Large", "A3" => "Adult 3X Large" ], "error" => "Choose a shirt size." ] ]); } else { $textboxes = array_merge($textboxes, [ [ "label" => "Shirt Size", "name" => "shirt", "type" => "select", "value" => $personinfo["shirt"], "options" => [ "" => "Choose...", "YS" => "Youth Small", "YM" => "Youth Medium", "YL" => "Youth Large", "AS" => "Adult Small", "AM" => "Adult Medium", "AL" => "Adult Large", "AX" => "Adult Extra Large", "A2" => "Adult 2X Large", "A3" => "Adult 3X Large" ], "error" => "Choose a shirt size." ] ]); } $textboxes = array_merge($textboxes, [ [ "label" => "Gender", "name" => "sex", "type" => "select", "width" => 3, "value" => $personinfo["sex"], "options" => [ "" => "Choose...", "M" => "Male", "F" => "Female" ], "error" => "Choose a gender." ], ]); if ($type == "adult") { $textboxes = array_merge($textboxes, [ [ "label" => "If you need child care for younger children, type their ages here", "name" => "child_care", "optional" => true, "width" => 12, "value" => $personinfo["child_care"] ], ]); } foreach ($textboxes as $item) { ?>
">
" name="people[][]" data-name="" class="form-control" placeholder="" aria-label="" maxlength="" pattern="" value="" />
$label) { ?>
Tigers (boys entering the first grade in the Fall) must be accompanied by a parent or guardian.