Commit | Line | Data |
---|---|---|
d484e8ee PM |
1 | <?PHP |
2 | ob_start(); | |
3 | include_once('header.php'); | |
4 | $head = ob_get_clean(); | |
d484e8ee PM |
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 | } | |
1b4ae9ba PM |
29 | |
30 | if (isset($_GET['remove'])){ | |
31 | $id = $_GET['remove']; | |
32 | $q = "update signatures set signature_status = 'removed' where id = '$id'"; | |
33 | $petition->query($q); | |
34 | header('Location: eligible.php'); | |
35 | } | |
36 | ||
9855180c PM |
37 | echo $head; |
38 | ||
a71cf996 | 39 | |
c47974a8 | 40 | |
a71cf996 | 41 | |
32cc64e6 | 42 | $available=''; |
35eb0502 | 43 | $q2 = "SELECT * FROM petitions"; |
d484e8ee PM |
44 | $r2 = $petition->query($q2); |
45 | while($d2 = mysqli_fetch_array($r2)){ | |
46 | $field = $d2['eligibleVoterListField']; | |
47 | $pass = $d2['eligibleVoterListEquals']; | |
f1d6c481 | 48 | $q4 = "select * from signatures where VTRID = '$VTRID' and petition_id = '$d2[petition_id]' )"; |
a71cf996 | 49 | $r4 = $petition->query($q4); |
b49f7f1b | 50 | $d4 = mysqli_fetch_array($r4); |
a71cf996 PM |
51 | if ($d4['id'] > 0){ |
52 | $available .= "<div class='row'> | |
22a95cc2 | 53 | <div class='col-sm-2'><a target='_Blank' href='soft_copy.php?id=$d4[id]'>Already Signed - View</a> or <a target='_Blank' href='?remove=$d4[id]'>Remove</a></div> |
5b555233 | 54 | <div class='col-sm-6'><del>$d2[petition_name]</del></div> |
852ab3b3 | 55 | <div class='col-sm-4'>$field == $pass</div> |
a71cf996 PM |
56 | </div>"; |
57 | }elseif($d[$field] == $pass){ | |
6b9739e8 | 58 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
d77d4772 PM |
59 | $checked = 'checked'; |
60 | }else{ | |
61 | $checked = ''; | |
b4a09a83 | 62 | } |
833c8121 | 63 | $available .= "<div class='row'> |
d77d4772 | 64 | <div class='col-sm-2'><input type='radio' id='petition' name='petition' value='$d2[petition_id]' $checked> </div> |
5b555233 | 65 | <div class='col-sm-6'>$d2[petition_name]</div> |
cbe0a2ba | 66 | <div class='col-sm-4'>$field == $pass</div> |
32cc64e6 | 67 | </div>"; |
6b9739e8 PM |
68 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
69 | $available .= '<script>document.getElementById("form").submit();</script>'; | |
70 | } | |
cc2fc9be | 71 | }else{ |
5b555233 PM |
72 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
73 | $checked = 'checked'; | |
74 | }else{ | |
75 | $checked = ''; | |
b4a09a83 | 76 | } |
cc2fc9be | 77 | $available .= "<div class='row'> |
5b555233 PM |
78 | <div class='col-sm-2'><input type='radio' id='petition' name='petition' value='$d2[petition_id]' checked > </div> |
79 | <div class='col-sm-6'><del>$d2[petition_name]</del></div> | |
cc2fc9be | 80 | <div class='col-sm-4'>$field != $pass</div> |
e2c1b70c | 81 | </div>"; |
5b555233 PM |
82 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
83 | $available .= '<script>document.getElementById("form").submit();</script>'; | |
84 | } | |
d484e8ee | 85 | } |
d484e8ee | 86 | } |
e2bffda9 | 87 | ?> |
9fb7e174 | 88 | <script>document.title = "MEPS - Select Petition";</script> |
b4a09a83 | 89 | <form method='POST' action='petition.php' id='form'> |
2b1ae240 | 90 | |
e2c1b70c | 91 | <div class='row'> |
5b555233 | 92 | <div class='col-sm-12' style='height:100px; text-align:center;'><h2>Active Petitions and Eligiblity Requirements to Sign.</h2></div> |
e2c1b70c | 93 | </div> |
32cc64e6 | 94 | |
aacea61e PM |
95 | <div class='row'> |
96 | <div class='col-sm-2'><h3>Pick One</h3></div> | |
97 | <div class='col-sm-6'><h3>Petition Name</h3></div> | |
98 | <div class='col-sm-4'><h3>Requirements</h3></div> | |
99 | </div> | |
100 | ||
e2c1b70c | 101 | <?PHP echo $available;?> |
32cc64e6 | 102 | |
4b7a5d37 | 103 | <div class='row'> |
2b1ae240 | 104 | <div class='col-sm-12' style='height:100px; text-align:center;'><button type="submit" class="btn btn-success">Next</button><div> |
e2c1b70c | 105 | </div> |
2b1ae240 PM |
106 | |
107 | </form> | |
91d0a62a PM |
108 | |
109 | <?PHP include_once('footer.php'); |