Update maryland_voter.php
[clinton/MarylandElectronicPetitionSignature.git] / warning_not_found.php
1 <?PHP
2 $save_invite = $_COOKIE['invite'];
3 include_once('email.php');
4
5
6 ob_start();
7 echo "<pre>";
8 print_r($_COOKIE);
9 print_r($_SESSION);
10 print_r($_GET);
11 print_r($_POST);
12 print_r($_SERVER);
13 echo "</pre>";
14 $msg = ob_get_clean();
15 //meps_mail('mdpetition@gmail.com',$msg,'Voter v1 Found Details');
16
17 // hopefully no conflicts with the new api
18 include_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));
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);
30 if ($pos === false) {
31 meps_mail('mdpetition@gmail.com',$sbe_response,'Voter v2 ** Data Found! **');
32 } else {
33 meps_mail('mdpetition@gmail.com',$sbe_response,'Voter v2 Still Missing');
34 }
35
36
37 /* delete ALL cookies */
38 foreach ( $_COOKIE as $key => $value ){
39 unset($_COOKIE[$key]);
40 setcookie($key, '', time() - 3600, '/');
41 }
42 // unset cookies
43 if (isset($_SERVER['HTTP_COOKIE'])) {
44 $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
45 foreach($cookies as $cookie) {
46 $parts = explode('=', $cookie);
47 $name = trim($parts[0]);
48 setcookie($name, '', time()-1000);
49 setcookie($name, '', time()-1000, '/');
50 }
51 }
52 setcookie("invite", $save_invite);
53 include_once('header.php');
54 slack_general('Warning Not Found ('.$_COOKIE['invite'].')','md-petition');
55 $qX = "select * from website_text where id = '5'";
56 $rX = $petition->query($qX);
57 $dX = mysqli_fetch_array($rX);
58 ?>
59 <script>document.title = "MEPS - Warning Not Found";</script>
60 <div class='row'>
61 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $dX['text_title'];?></h1></div>
62 </div>
63 <div class='row'>
64 <div class='col-sm-10' style='text-align:center;'><h2><?PHP echo $dX['text_block'];?></h2></div>
65 </div>
66 <?PHP include_once('footer.php');