Update is_the_information_correct.php
[clinton/MarylandElectronicPetitionSignature.git] / is_the_information_correct.php
index 390c722..fcba0a4 100644 (file)
@@ -16,6 +16,33 @@ if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' &&
 }else{
   header('Location: warning_incomplete.php');
 }
+
+// V2 API - Remote
+include_once('api/maryland_voter.php');
+$month                         = date('m',strtotime($DOB));
+$day                     = date('d',strtotime($DOB));
+$year                  = date('Y',strtotime($DOB));
+$error = 'Based on what you entered, we were unable to find any information.';
+$sbe_response = md_voter_lookup($web_first_name,$web_last_name,$month,$day,$year,$web_zip_code,'','');
+$pos = strpos($sbe_response, $error);
+if ($pos !== false) {
+   slack_general_admin("Voter API v2 Fail: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error",'md-petition-api');
+   //meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Fail: '.$error);
+}
+$error2 = 'MISSING NAME';
+$pos = strpos($sbe_response, $error2);
+if ($pos !== false) {
+   slack_general_admin("Voter API v2 Fail: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error2",'md-petition-api');
+  // meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Fail: '.$error2);
+}
+$error3 = 'My Voter Registration Record';
+$pos = strpos($sbe_response, $error3);
+if ($pos !== false) {
+   slack_general_admin("Voter API v2 Success: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error3",'md-petition-api');
+  // meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Success: '.$error3);
+}
+
+// V1 API - Local
 $q = "select * from VoterList where LASTNAME = '$web_last_name' and FIRSTNAME = '$web_first_name' and HOUSE_NUMBER = '$web_house_number' and RESIDENTIALZIP5 = '$web_zip_code'";
 $r = $petition->query($q);
 $d = mysqli_fetch_array($r);
@@ -62,7 +89,7 @@ $qX = "select * from website_text where id = '6'";
     <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $dX['text_title'];?></h1><h2><?PHP echo $dX['text_block'];?></h2></div>
 </div>
 <div class='row'>
-  <div class='col-sm-10'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='eligible.php'"><img class='click_me' src="files/click_here.gif">YES</button></div>
+  <div class='col-sm-10'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='eligible.php'"><img alt='Click Here to Continue' class='click_me' src="files/click_here.gif">YES</button></div>
 </div>
 <div class='row'>
   <div class='col-sm-5' style='text-align:right;'><h2>First Name</h2></div>
@@ -101,7 +128,7 @@ $qX = "select * from website_text where id = '6'";
   <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $RESIDENTIALZIP5;?></h2></div>
 </div>
 <div class='row'>
-  <div class='col-sm-10'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='eligible.php'"><img class='click_me' src="files/click_here.gif">YES</button></div>
+  <div class='col-sm-10'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='eligible.php'"><img alt='Click Here to Continue' class='click_me' src="files/click_here.gif">YES</button></div>
 </div>
 <div class='row'>
   <div class='col-sm-10'><button type="button" class="btn btn-danger btn-lg btn-block not_me" onclick="window.location.href='reset.php'">NO</button></div>