Add files via upload
[clinton/MarylandElectronicPetitionSignature.git] / warning_not_found.php
CommitLineData
ffde8170 1<?PHP
064f3eee 2$save_invite = $_COOKIE['invite'];
35aa6c1e
PM
3include_once('email.php');
4
5
6ob_start();
7echo "<pre>";
8print_r($_COOKIE);
9print_r($_SESSION);
10print_r($_GET);
11print_r($_POST);
12print_r($_SERVER);
13echo "</pre>";
14$msg = ob_get_clean();
b74aaa29 15//meps_mail('mdpetition@gmail.com',$msg,'Voter v1 Found Details');
35aa6c1e 16
2b8425bc
PM
17// hopefully no conflicts with the new api
18include_once('api/maryland_voter.php');
19$web_first_name = $_COOKIE['web_first_name'];
20$web_last_name = $_COOKIE['web_last_name'];
21$web_house_number = $_COOKIE['web_house_number'];
22$web_zip_code = $_COOKIE['web_zip_code'];
23$DOB = $_COOKIE['pDOB'];
24$month = date('m',strtotime($DOB));
25$day = date('d',strtotime($DOB));
26$year = date('Y',strtotime($DOB));
b74aaa29
PM
27$error = 'Based on what you entered, we were unable to find any information.';
28$sbe_response = md_voter_lookup($web_first_name,$web_last_name,$month,$day,$year,$web_zip_code,'','');
29$pos = strpos($sbe_response, $error);
80acff69
PM
30if ($pos !== false) {
31 meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Fail: '.$error);
32}
33$error2 = 'MISSING NAME';
34$pos = strpos($sbe_response, $error2);
35if ($pos !== false) {
36 meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Fail: '.$error2);
37}
38$error3 = 'My Voter Registration Record';
39$pos = strpos($sbe_response, $error3);
40if ($pos !== false) {
41 meps_mail('mdpetition@gmail.com',$sbe_response,'Voter API v2 Success: '.$error3);
b74aaa29 42}
35aa6c1e 43
f612f880
PM
44/* delete ALL cookies */
45foreach ( $_COOKIE as $key => $value ){
46 unset($_COOKIE[$key]);
47 setcookie($key, '', time() - 3600, '/');
48}
49// unset cookies
50if (isset($_SERVER['HTTP_COOKIE'])) {
51 $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
52 foreach($cookies as $cookie) {
53 $parts = explode('=', $cookie);
54 $name = trim($parts[0]);
55 setcookie($name, '', time()-1000);
56 setcookie($name, '', time()-1000, '/');
57 }
58}
064f3eee 59setcookie("invite", $save_invite);
ffde8170 60include_once('header.php');
f612f880 61slack_general('Warning Not Found ('.$_COOKIE['invite'].')','md-petition');
ce49cf79 62$qX = "select * from website_text where id = '5'";
ffde8170
PM
63$rX = $petition->query($qX);
64$dX = mysqli_fetch_array($rX);
ce49cf79 65?>
5625b4c2 66<script>document.title = "MEPS - Warning Not Found";</script>
1a946745 67<div class='row'>
833a22d3 68 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $dX['text_title'];?></h1></div>
1a946745
PM
69</div>
70<div class='row'>
833a22d3 71 <div class='col-sm-10' style='text-align:center;'><h2><?PHP echo $dX['text_block'];?></h2></div>
1a946745 72</div>
9cf4b960 73<?PHP include_once('footer.php');