From 49c3404e9948e51933720fe8774293732b677b0b Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 21 Jul 2020 20:09:52 -0400 Subject: [PATCH] Create is_the_information_correct_v2.php --- is_the_information_correct_v2.php | 137 ++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 is_the_information_correct_v2.php diff --git a/is_the_information_correct_v2.php b/is_the_information_correct_v2.php new file mode 100644 index 0000000..da13aba --- /dev/null +++ b/is_the_information_correct_v2.php @@ -0,0 +1,137 @@ +real_escape_string($web_first_name); + $web_last_name = $petition->real_escape_string($web_last_name); + $web_house_number = $petition->real_escape_string($web_house_number); + $web_zip_code = $petition->real_escape_string($web_zip_code); + $DOB = $petition->real_escape_string($DOB); + $PHONE = $petition->real_escape_string($PHONE); +}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: $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: $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: $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); +if ($d['VTRID'] != ''){ + $VTRID = $d['VTRID']; + $FIRSTNAME = $d['FIRSTNAME']; + $MIDDLENAME = $d['MIDDLENAME']; + if ($MIDDLENAME == ''){ + slack_general_admin("WARN: Blank Middle Name Detected",'md-petition-signed'); + } + $LASTNAME = $d['LASTNAME']; + $pos = strpos($LASTNAME, '-'); + if ($pos !== false) { + slack_general_admin("WARN: Hyphen in Last Name Detected",'md-petition-signed'); + } + $ADDRESS = $d['ADDRESS']; + $RESIDENTIALCITY = $d['RESIDENTIALCITY']; + $COUNTY = $d['COUNTY']; + $RESIDENTIALZIP5 = $d['RESIDENTIALZIP5']; + // set cookies for hard_copy.php + setcookie("pCOUNTY", $COUNTY); + if ($MIDDLENAME == ''){ + setcookie("pNAME", "$FIRSTNAME $LASTNAME"); + }else{ + setcookie("pNAME", "$FIRSTNAME $MIDDLENAME $LASTNAME"); + } + setcookie("pADDRESS", "$ADDRESS $RESIDENTIALCITY $RESIDENTIALZIP5"); + setcookie("pADDRESS1", "$ADDRESS"); + setcookie("pADDRESS2", "$RESIDENTIALCITY MD $RESIDENTIALZIP5"); + setcookie("pVTRID", $VTRID); + setcookie("signature_status", 'verified'); + slack_general('MATCH: Is the information correct ('.$FIRSTNAME.' '.$LASTNAME.' '.$RESIDENTIALCITY.') ('.$_COOKIE['invite'].')','md-petition'); +}else{ + slack_general('MISS: Is the information correct ('.$web_first_name.' '.$web_last_name.' '.$PHONE.') ('.$_COOKIE['invite'].')','md-petition'); + setcookie("signature_status", 'notfound'); + header('Location: warning_not_found.php'); +} +$qX = "select * from website_text where id = '6'"; + $rX = $petition->query($qX); + $dX = mysqli_fetch_array($rX); +?> + +
+

+
+
+
+
+
+

First Name

+

+
+
+

Middle Name

+

+
+
+

Last Name

+

+
+
+

Date of Birth

+

+
+
+

Full Addresss

+

+
+
+

Phone

+

+
+
+

City

+

+
+
+

County

+

+
+
+

Zip

+

+
+
+
+
+
+
+
+ +