Update status.php
[clinton/MarylandElectronicPetitionSignature.git] / is_the_information_correct.php
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'];
6 $DOB = $_COOKIE['pDOB'];
7 $PHONE = $_COOKIE['pPHONE'];
8 if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' && $web_zip_code != ''){
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);
16 }else{
17 header('Location: warning_incomplete.php');
18 }
19
20 // V2 API - Remote
21 include_once('api/maryland_voter.php');
22 $month = date('m',strtotime($DOB));
23 $day = date('d',strtotime($DOB));
24 $year = date('Y',strtotime($DOB));
25 $error = 'Based on what you entered, we were unable to find any information.';
26 $error2 = 'MISSING NAME';
27 $error3 = 'My Voter Registration Record';
28 $error4 = 'Your search cannot be processed at this time';
29 $sbe_response = md_voter_lookup($web_first_name,$web_last_name,$month,$day,$year,$web_zip_code,'','');
30 $pos = strpos($sbe_response, $error4);
31 if ($pos !== false) {
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 }
46 }
47 // V1 API - Local
48 $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'";
49 $r = $petition->query($q);
50 $d = mysqli_fetch_array($r);
51 if ($d['VTRID'] != ''){
52 $VTRID = $d['VTRID'];
53 $FIRSTNAME = $d['FIRSTNAME'];
54 $MIDDLENAME = $d['MIDDLENAME'];
55 if ($MIDDLENAME == ''){
56 slack_general_admin("WARN: Blank Middle Name Detected",'md-petition-signed');
57 }
58 $LASTNAME = $d['LASTNAME'];
59 $pos = strpos($LASTNAME, '-');
60 if ($pos !== false) {
61 slack_general_admin("WARN: Hyphen in Last Name Detected",'md-petition-signed');
62 }
63 $ADDRESS = $d['ADDRESS'];
64 $RESIDENTIALCITY = $d['RESIDENTIALCITY'];
65 $COUNTY = $d['COUNTY'];
66 $RESIDENTIALZIP5 = $d['RESIDENTIALZIP5'];
67 // set cookies for hard_copy.php
68 setcookie("pCOUNTY", $COUNTY);
69 if ($MIDDLENAME == ''){
70 setcookie("pNAME", "$FIRSTNAME $LASTNAME");
71 }else{
72 setcookie("pNAME", "$FIRSTNAME $MIDDLENAME $LASTNAME");
73 }
74 setcookie("pADDRESS", "$ADDRESS $RESIDENTIALCITY $RESIDENTIALZIP5");
75 setcookie("pADDRESS1", "$ADDRESS");
76 setcookie("pADDRESS2", "$RESIDENTIALCITY MD $RESIDENTIALZIP5");
77 setcookie("pVTRID", $VTRID);
78 setcookie("signature_status", 'verified');
79 slack_general('MATCH: Is the information correct ('.$FIRSTNAME.' '.$LASTNAME.' '.$RESIDENTIALCITY.') ('.$_COOKIE['invite'].')','md-petition');
80 }else{
81 slack_general('MISS: Is the information correct ('.$web_first_name.' '.$web_last_name.' '.$PHONE.') ('.$_COOKIE['invite'].')','md-petition');
82 setcookie("signature_status", 'notfound');
83 header('Location: warning_not_found.php');
84 }
85 $qX = "select * from website_text where id = '6'";
86 $rX = $petition->query($qX);
87 $dX = mysqli_fetch_array($rX);
88 ?>
89 <script>document.title = "MEPS - Confirm information";</script>
90 <div class='row'>
91 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $dX['text_title'];?></h1><h2><?PHP echo $dX['text_block'];?></h2></div>
92 </div>
93 <div class='row'>
94 <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>
95 </div>
96 <div class='row'>
97 <div class='col-sm-5' style='text-align:right;'><h2>First Name</h2></div>
98 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $FIRSTNAME;?></h2></div>
99 </div>
100 <div class='row'>
101 <div class='col-sm-5' style='text-align:right;'><h2>Middle Name</h2></div>
102 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $MIDDLENAME;?><h2></div>
103 </div>
104 <div class='row'>
105 <div class='col-sm-5' style='text-align:right;'><h2>Last Name</h2></div>
106 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $LASTNAME;?></h2></div>
107 </div>
108 <div class='row'>
109 <div class='col-sm-5' style='text-align:right;'><h2>Date of Birth</h2></div>
110 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $DOB;?></h2></div>
111 </div>
112 <div class='row'>
113 <div class='col-sm-5' style='text-align:right;'><h2>Full Addresss</h2></div>
114 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $ADDRESS;?></h2></div>
115 </div>
116 <div class='row'>
117 <div class='col-sm-5' style='text-align:right;'><h2>Phone</h2></div>
118 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $PHONE;?></h2></div>
119 </div>
120 <div class='row'>
121 <div class='col-sm-5' style='text-align:right;'><h2>City</h2></div>
122 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $RESIDENTIALCITY;?></h2></div>
123 </div>
124 <div class='row'>
125 <div class='col-sm-5' style='text-align:right;'><h2>County</h2></div>
126 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $COUNTY;?></h2></div>
127 </div>
128 <div class='row'>
129 <div class='col-sm-5' style='text-align:right;'><h2>Zip</h2></div>
130 <div class='col-sm-5' style='text-align:left;'><h2><?PHP echo $RESIDENTIALZIP5;?></h2></div>
131 </div>
132 <div class='row'>
133 <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>
134 </div>
135 <div class='row'>
136 <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>
137 </div>
138
139 <?PHP include_once('footer.php');