| 1 | <?PHP |
| 2 | ob_start(); |
| 3 | include_once('header.php'); |
| 4 | $head = ob_get_clean(); |
| 5 | $web_first_name = $_COOKIE['web_first_name']; |
| 6 | $web_last_name = $_COOKIE['web_last_name']; |
| 7 | $web_house_number = $_COOKIE['web_house_number']; |
| 8 | $web_zip_code = $_COOKIE['web_zip_code']; |
| 9 | if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' && $web_zip_code != ''){ |
| 10 | // ok to check for records |
| 11 | }else{ |
| 12 | header('Location: warning_incomplete.php'); |
| 13 | } |
| 14 | $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'"; |
| 15 | $r = $petition->query($q); |
| 16 | $d = mysqli_fetch_array($r); |
| 17 | if ($d['VTRID'] != ''){ |
| 18 | $VTRID = $d['VTRID']; |
| 19 | $FIRSTNAME = $d['FIRSTNAME']; |
| 20 | $MIDDLENAME = $d['MIDDLENAME']; |
| 21 | $LASTNAME = $d['LASTNAME']; |
| 22 | $ADDRESS = $d['ADDRESS']; |
| 23 | $RESIDENTIALCITY = $d['RESIDENTIALCITY']; |
| 24 | $COUNTY = $d['COUNTY']; |
| 25 | $RESIDENTIALZIP5 = $d['RESIDENTIALZIP5']; |
| 26 | }else{ |
| 27 | header('Location: warning_not_found.php'); |
| 28 | } |
| 29 | echo $head; |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | $available=''; |
| 35 | $q2 = "SELECT * FROM petitions"; |
| 36 | $r2 = $petition->query($q2); |
| 37 | while($d2 = mysqli_fetch_array($r2)){ |
| 38 | $field = $d2['eligibleVoterListField']; |
| 39 | $pass = $d2['eligibleVoterListEquals']; |
| 40 | $q4 = "select * from signatures where VTRID = '$VTRID' and petition_id = '$d2[petition_id]' "; |
| 41 | $r4 = $petition->query($q4); |
| 42 | $d4 = mysqli_fetch_array($r4); |
| 43 | if ($d4['id'] > 0){ |
| 44 | $available .= "<div class='row'> |
| 45 | <div class='col-sm-2'><a target='_Blank' href='soft_copy.php?id=$d4[id]'>Already Signed - View</a></div> |
| 46 | <div class='col-sm-6'><del>$d2[petition_name]</del></div> |
| 47 | <div class='col-sm-4'>$field == $pass</div> |
| 48 | </div>"; |
| 49 | }elseif($d[$field] == $pass){ |
| 50 | $available .= "<div class='row'> |
| 51 | <div class='col-sm-2'><input type='radio' id='petition' name='petition' value='$d2[petition_id]'> </div> |
| 52 | <div class='col-sm-6'>$d2[petition_name]</div> |
| 53 | <div class='col-sm-4'>$field == $pass</div> |
| 54 | </div>"; |
| 55 | }else{ |
| 56 | $available .= "<div class='row'> |
| 57 | <div class='col-sm-2'> </div> |
| 58 | <div class='col-sm-6'><del>$d2[petition_name]</del></div> |
| 59 | <div class='col-sm-4'>$field != $pass</div> |
| 60 | </div>"; |
| 61 | } |
| 62 | } |
| 63 | ?> |
| 64 | <form method='POST' action='petition.php'> |
| 65 | |
| 66 | <div class='row'> |
| 67 | <div class='col-sm-12' style='height:100px; text-align:center;'><h2>Active Petitions and Eligiblity Requirements to Sign.</h2></div> |
| 68 | </div> |
| 69 | |
| 70 | <div class='row'> |
| 71 | <div class='col-sm-2'><h3>Pick One</h3></div> |
| 72 | <div class='col-sm-6'><h3>Petition Name</h3></div> |
| 73 | <div class='col-sm-4'><h3>Requirements</h3></div> |
| 74 | </div> |
| 75 | |
| 76 | <?PHP echo $available;?> |
| 77 | |
| 78 | <div class='row'> |
| 79 | <div class='col-sm-12' style='height:100px; text-align:center;'><button type="submit" class="btn btn-success">Next</button><div> |
| 80 | </div> |
| 81 | |
| 82 | </form> |
| 83 | |
| 84 | <?PHP include_once('footer.php'); |