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 | |
32cc64e6 | 40 | $available=''; |
35eb0502 | 41 | $q2 = "SELECT * FROM petitions"; |
d484e8ee PM |
42 | $r2 = $petition->query($q2); |
43 | while($d2 = mysqli_fetch_array($r2)){ | |
da47274f | 44 | $checked = ''; |
d484e8ee PM |
45 | $field = $d2['eligibleVoterListField']; |
46 | $pass = $d2['eligibleVoterListEquals']; | |
66e03a53 | 47 | $q4 = "select * from signatures where VTRID = '$VTRID' and petition_id = '$d2[petition_id]' and signature_status <> 'removed' "; |
a71cf996 | 48 | $r4 = $petition->query($q4); |
b49f7f1b | 49 | $d4 = mysqli_fetch_array($r4); |
97ae499d | 50 | if ($d4['id'] > 0){ |
ed5123d6 | 51 | $available .= "<div class='row' style='background-color:lightyellow;'> |
148009e1 | 52 | <div class='col-sm-3'>Already Signed, <a target='_Blank' href='soft_copy.php?id=$d4[id]'>View</a> or <a href='?remove=$d4[id]'>Remove</a></div> |
bd380a87 | 53 | <div class='col-sm-6'>$d2[petition_name]</div> |
d9e19f51 | 54 | <div class='col-sm-3'>$field == $pass</div> |
a71cf996 PM |
55 | </div>"; |
56 | }elseif($d[$field] == $pass){ | |
bd380a87 PM |
57 | $checked = ''; |
58 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ | |
d77d4772 PM |
59 | $checked = 'checked'; |
60 | }else{ | |
61 | $checked = ''; | |
b4a09a83 | 62 | } |
ed5123d6 | 63 | $available .= "<div class='row' style='background-color:lightgreen;'> |
4fec112a | 64 | <div class='col-sm-3'><input type='radio' id='petition' name='petition' value='$d2[petition_id]' $checked > </div> |
5b555233 | 65 | <div class='col-sm-6'>$d2[petition_name]</div> |
d9e19f51 | 66 | <div class='col-sm-3'>$field == $pass</div> |
32cc64e6 | 67 | </div>"; |
4fec112a | 68 | |
6b9739e8 PM |
69 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
70 | $available .= '<script>document.getElementById("form").submit();</script>'; | |
71 | } | |
330a7a16 PM |
72 | }else{ |
73 | $checked = ''; | |
74 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ | |
75 | $checked = 'checked'; | |
76 | }else{ | |
77 | $checked = ''; | |
78 | } | |
90ab22ed | 79 | $available .= "<div class='row' style='background-color:#ffcccb;'> |
ed31e82f | 80 | <div class='col-sm-3'>"; if ($d2['eligibleVoterListEnforce'] == 'NO'){ $available .="<input type='radio' id='petition' name='petition' value='$d2[petition_id]' $checked >"; }else{ $available .= "Constituents Only"; } $available .= "</div> |
bd380a87 | 81 | <div class='col-sm-6'>$d2[petition_name]</div> |
d9e19f51 | 82 | <div class='col-sm-3'>$field != $pass</div> |
e2c1b70c | 83 | </div>"; |
5b555233 PM |
84 | if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ |
85 | $available .= '<script>document.getElementById("form").submit();</script>'; | |
86 | } | |
d484e8ee | 87 | } |
d484e8ee | 88 | } |
e2bffda9 | 89 | ?> |
9fb7e174 | 90 | <script>document.title = "MEPS - Select Petition";</script> |
b4a09a83 | 91 | <form method='POST' action='petition.php' id='form'> |
462019be PM |
92 | <?PHP |
93 | $q = "select * from website_text where id = '7'"; | |
94 | $r = $petition->query($q); | |
95 | $d = mysqli_fetch_array($r); | |
96 | ?> | |
e2c1b70c | 97 | <div class='row'> |
462019be | 98 | <div class='col-sm-12' style='height:100px; text-align:center;'><h2><?PHP echo $d['text_title'];?></h2><p><?PHP echo $d['text_block'];?></p></div> |
e2c1b70c | 99 | </div> |
32cc64e6 | 100 | |
aacea61e | 101 | <div class='row'> |
ae471fe7 | 102 | <div class='col-sm-3'><h3>Pick One</h3></div> |
aacea61e | 103 | <div class='col-sm-6'><h3>Petition Name</h3></div> |
ae471fe7 | 104 | <div class='col-sm-3'><h3>Requirements</h3></div> |
aacea61e PM |
105 | </div> |
106 | ||
e2c1b70c | 107 | <?PHP echo $available;?> |
32cc64e6 | 108 | |
4b7a5d37 | 109 | <div class='row'> |
3a794d59 | 110 | <div class='col-sm-12' style='height:100px; text-align:center;'><button type="submit" class="btn btn-success btn-lg btn-block">Next</button><div> |
e2c1b70c | 111 | </div> |
2b1ae240 | 112 | |
ed31e82f | 113 | |
97ae499d | 114 | |
2b1ae240 | 115 | </form> |
91d0a62a PM |
116 | |
117 | <?PHP include_once('footer.php'); |