Update enter_information_v2.php
authorPatrick McGuire <insidenothing@gmail.com>
Wed, 22 Jul 2020 12:58:52 +0000 (08:58 -0400)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2020 12:58:52 +0000 (08:58 -0400)
enter_information_v2.php

index 244d11d..9e4c9ae 100644 (file)
@@ -11,12 +11,23 @@ if (isset($_POST['web_first_name'])){
     }
   }
    $DOB='';
-  if (isset($_POST['DOB'])){
+  // old DOB form
+   if (isset($_POST['DOB'])){
     if ($_POST['DOB'] != ''){
      $DOB = $_POST['DOB'];
      setcookie("pDOB", $DOB);
     }
   }
+  // new DOB form
+   if (isset($_POST['web_dob_day'])){
+    if ($_POST['web_dob_day'] != ''){
+       $DOB = $_POST['web_dob_year'].'-'.$_POST['web_dob_month'].'-'.$_POST['web_dob_day'];
+       setcookie("pDOB", $DOB);
+       setcookie("web_dob_month", $_POST['web_dob_month']);
+       setcookie("web_dob_year", $_POST['web_dob_year']);
+       setcookie("web_dob_day", $_POST['web_dob_day']);
+    }
+  }
   $web_first_name='';
   if (isset($_POST['web_first_name'])){
     if ($_POST['web_first_name'] != ''){
@@ -97,7 +108,9 @@ slack_general('Enter Information ('.$_COOKIE['invite'].')','md-petition');
      
   <div class='row'>
      <div class='col-sm-3' style='text-align:right;'><h2>Date of Birth</h2></div>
-     <div class='col-sm-6' style='text-align:left;'><input type='number' class="form-control input-lg" name='web_dob_day' required oninvalid="this.setCustomValidity('Please the day you were born.')" oninput="this.setCustomValidity('')"><input type='number' class="form-control input-lg" name='web_dob_month' required oninvalid="this.setCustomValidity('Please enter the month you were born.')" oninput="this.setCustomValidity('')"><input type='number' class="form-control input-lg" name='web_dob_year' required oninvalid="this.setCustomValidity('Please enter the year you were born.')" oninput="this.setCustomValidity('')"></div>
+     <div class='col-sm-2' style='text-align:left;'><input type='number' class="form-control input-lg" name='web_dob_day' required oninvalid="this.setCustomValidity('Please the day you were born.')" oninput="this.setCustomValidity('')"></div>
+     <div class='col-sm-2' style='text-align:left;'><input type='number' class="form-control input-lg" name='web_dob_month' required oninvalid="this.setCustomValidity('Please enter the month you were born.')" oninput="this.setCustomValidity('')"></div>
+     <div class='col-sm-2' style='text-align:left;'><input type='number' class="form-control input-lg" name='web_dob_year' required oninvalid="this.setCustomValidity('Please enter the year you were born.')" oninput="this.setCustomValidity('')"></div>
      <div class='col-sm-1' style='text-align:center;'><button type="submit" class="btn btn-success btn-lg btn-block">↴</button></div>
   </div> 
   <div class='row'>