Update is_the_information_correct.php
[clinton/MarylandElectronicPetitionSignature.git] / is_the_information_correct.php
CommitLineData
712c1004
PM
1<?PHP
2$web_first_name = $_COOKIE['web_first_name'];
3$web_last_name = $_COOKIE['web_last_name'];
4$web_house_number = $_COOKIE['web_house_number'];
5$web_zip_code = $_COOKIE['web_zip_code'];
8b1d1510 6$DOB = $_COOKIE['pDOB'];
6066e71a 7$PHONE = $_COOKIE['pPHONE'];
712c1004 8if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' && $web_zip_code != ''){
2d2d233d
PM
9 include_once('header.php');
10 $web_first_name = $petition->real_escape_string($web_first_name);
11 $web_last_name = $petition->real_escape_string($web_last_name);
12 $web_house_number = $petition->real_escape_string($web_house_number);
13 $web_zip_code = $petition->real_escape_string($web_zip_code);
14 $DOB = $petition->real_escape_string($DOB);
15 $PHONE = $petition->real_escape_string($PHONE);
712c1004 16}else{
a2fa54c8 17 header('Location: warning_incomplete.php');
712c1004 18}
9d20c80d
PM
19
20// V2 API - Remote
21include_once('api/maryland_voter.php');
5c5b10ac
PM
22$month = date('m',strtotime($DOB));
23$day = date('d',strtotime($DOB));
24$year = date('Y',strtotime($DOB));
9d20c80d 25$error = 'Based on what you entered, we were unable to find any information.';
9d20c80d 26$error2 = 'MISSING NAME';
9d20c80d 27$error3 = 'My Voter Registration Record';
53cc37f4 28$error4 = 'Your search cannot be processed at this time';
15174325
PM
29$sbe_response = md_voter_lookup($web_first_name,$web_last_name,$month,$day,$year,$web_zip_code,'','');
30$pos = strpos($sbe_response, $error4);
9d20c80d 31if ($pos !== false) {
15174325
PM
32 slack_general_admin("Voter API v2 Block: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error4",'md-petition-api');
33}else{
34 $pos = strpos($sbe_response, $error);
35 if ($pos !== false) {
36 slack_general_admin("Voter API v2 Fail: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error",'md-petition-api');
37 }
38 $pos = strpos($sbe_response, $error2);
39 if ($pos !== false) {
40 slack_general_admin("Voter API v2 Fail: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error2",'md-petition-api');
41 }
42 $pos = strpos($sbe_response, $error3);
43 if ($pos !== false) {
44 slack_general_admin("Voter API v2 Success: $web_first_name,$web_last_name,$month,$day,$year,$web_zip_code $error3",'md-petition-api');
45 }
9d20c80d 46}
09f65f58
PM
47
48// v3 update to VoterList
49
50$q = "select * from VoterList2 where LASTNAME = '$web_last_name' and FIRSTNAME = '$web_first_name' and HOUSE_NUMBER = '$web_house_number' and RESIDENTIALZIP5 = '$web_zip_code'";
51$r = $petition->query($q);
52$d = mysqli_fetch_array($r);
53if ($d['VTRID'] != ''){
54 slack_general_admin("VoterList2 Search Found",'md-petition-api');
55}else{
56 slack_general_admin("VoterList2 Search Not Found",'md-petition-api');
57}
58
59
9d20c80d 60// V1 API - Local
a2fa54c8 61$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'";
712c1004
PM
62$r = $petition->query($q);
63$d = mysqli_fetch_array($r);
a8cce358 64if ($d['VTRID'] != ''){
a2fa54c8
PM
65 $VTRID = $d['VTRID'];
66 $FIRSTNAME = $d['FIRSTNAME'];
67 $MIDDLENAME = $d['MIDDLENAME'];
d3ac6faa
PM
68 if ($MIDDLENAME == ''){
69 slack_general_admin("WARN: Blank Middle Name Detected",'md-petition-signed');
70 }
a2fa54c8 71 $LASTNAME = $d['LASTNAME'];
d3ac6faa
PM
72 $pos = strpos($LASTNAME, '-');
73 if ($pos !== false) {
74 slack_general_admin("WARN: Hyphen in Last Name Detected",'md-petition-signed');
75 }
a2fa54c8
PM
76 $ADDRESS = $d['ADDRESS'];
77 $RESIDENTIALCITY = $d['RESIDENTIALCITY'];
78 $COUNTY = $d['COUNTY'];
79 $RESIDENTIALZIP5 = $d['RESIDENTIALZIP5'];
8b1d1510
PM
80 // set cookies for hard_copy.php
81 setcookie("pCOUNTY", $COUNTY);
04efcb75
PM
82 if ($MIDDLENAME == ''){
83 setcookie("pNAME", "$FIRSTNAME $LASTNAME");
84 }else{
85 setcookie("pNAME", "$FIRSTNAME $MIDDLENAME $LASTNAME");
86 }
8b1d1510 87 setcookie("pADDRESS", "$ADDRESS $RESIDENTIALCITY $RESIDENTIALZIP5");
05a04f80
PM
88 setcookie("pADDRESS1", "$ADDRESS");
89 setcookie("pADDRESS2", "$RESIDENTIALCITY MD $RESIDENTIALZIP5");
577a0b79 90 setcookie("pVTRID", $VTRID);
867b0c86 91 setcookie("signature_status", 'verified');
5c5b10ac 92 slack_general('MATCH: Is the information correct ('.$FIRSTNAME.' '.$LASTNAME.' '.$RESIDENTIALCITY.') ('.$_COOKIE['invite'].')','md-petition');
712c1004 93}else{
5c5b10ac 94 slack_general('MISS: Is the information correct ('.$web_first_name.' '.$web_last_name.' '.$PHONE.') ('.$_COOKIE['invite'].')','md-petition');
867b0c86 95 setcookie("signature_status", 'notfound');
a2fa54c8 96 header('Location: warning_not_found.php');
712c1004 97}
9185e8d3 98$qX = "select * from website_text where id = '6'";
cd5f7892
PM
99 $rX = $petition->query($qX);
100 $dX = mysqli_fetch_array($rX);
712c1004 101?>
724701a4 102<script>document.title = "MEPS - Confirm information";</script>
6066e71a 103<div class='row'>
65433c55 104 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $dX['text_title'];?></h1><h2><?PHP echo $dX['text_block'];?></h2></div>
6066e71a 105</div>
71abcb6c 106<div class='row'>
93e9e8d8 107 <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>
71abcb6c 108</div>
6066e71a 109<div class='row'>
bda3f5d8
PM
110 <div class='col-sm-5' style='text-align:right;'><h2>First Name</h2></div>
111 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $FIRSTNAME;?></h2></div>
8cf8dc22 112</div>
6066e71a 113<div class='row'>
bda3f5d8
PM
114 <div class='col-sm-5' style='text-align:right;'><h2>Middle Name</h2></div>
115 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $MIDDLENAME;?><h2></div>
8cf8dc22 116</div>
6066e71a 117<div class='row'>
bda3f5d8
PM
118 <div class='col-sm-5' style='text-align:right;'><h2>Last Name</h2></div>
119 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $LASTNAME;?></h2></div>
8b1d1510 120</div>
6066e71a 121<div class='row'>
bda3f5d8
PM
122 <div class='col-sm-5' style='text-align:right;'><h2>Date of Birth</h2></div>
123 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $DOB;?></h2></div>
8cf8dc22 124</div>
6066e71a 125<div class='row'>
bda3f5d8
PM
126 <div class='col-sm-5' style='text-align:right;'><h2>Full Addresss</h2></div>
127 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $ADDRESS;?></h2></div>
8cf8dc22 128</div>
6066e71a 129<div class='row'>
bda3f5d8
PM
130 <div class='col-sm-5' style='text-align:right;'><h2>Phone</h2></div>
131 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $PHONE;?></h2></div>
6066e71a
PM
132</div>
133<div class='row'>
bda3f5d8
PM
134 <div class='col-sm-5' style='text-align:right;'><h2>City</h2></div>
135 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $RESIDENTIALCITY;?></h2></div>
136</div>
137<div class='row'>
138 <div class='col-sm-5' style='text-align:right;'><h2>County</h2></div>
139 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $COUNTY;?></h2></div>
140</div>
141<div class='row'>
142 <div class='col-sm-5' style='text-align:right;'><h2>Zip</h2></div>
143 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $RESIDENTIALZIP5;?></h2></div>
8cf8dc22
PM
144</div>
145<div class='row'>
93e9e8d8 146 <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>
71abcb6c
PM
147</div>
148<div class='row'>
149 <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>
8cf8dc22 150</div>
b7349fe7 151
b7349fe7 152<?PHP include_once('footer.php');