Commit | Line | Data |
---|---|---|
e3599ddc PM |
1 | <?PHP |
2 | include_once('security.php'); | |
3d88cafe PM |
3 | include_once('/var/www/secure.php'); //outside webserver |
4 | if (isset($_GET['override'])){ | |
5 | $id = $_GET['override']; | |
6 | $petition->query("update signatures set signature_status = 'verified' where id = '$id' "); | |
7 | header('Location: report.php'); | |
8 | } | |
9 | if (isset($_GET['delete'])){ | |
10 | $id = $_GET['delete']; | |
11 | $petition->query("update signatures set signature_status = 'deleted' where id = '$id' "); | |
12 | header('Location: report.php'); | |
13 | } | |
dddebd21 PM |
14 | if (isset($_GET['review'])){ |
15 | $id = $_GET['review']; | |
16 | $petition->query("update signatures set signature_status = 'review_requested' where id = '$id' "); | |
17 | header('Location: report.php'); | |
18 | } | |
e3599ddc | 19 | include_once('header.php'); |
9970efb3 | 20 | slack_general('ADMIN: Reports Loaded ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition'); |
f1f9b284 | 21 | $group_id = $_COOKIE['group_id']; |
3f627365 PM |
22 | ?> |
23 | <script> | |
24 | function checkAll(formname, checktoggle) | |
25 | { | |
26 | var checkboxes = new Array(); | |
27 | checkboxes = document[formname].getElementsByTagName('input'); | |
28 | ||
29 | for (var i=0; i<checkboxes.length; i++) { | |
30 | if (checkboxes[i].type == 'checkbox') { | |
31 | checkboxes[i].checked = checktoggle; | |
32 | } | |
33 | } | |
34 | } | |
35 | </script> | |
a8545882 PM |
36 | <style> |
37 | body { background-color:lightgrey; } | |
3f6d2be7 PM |
38 | fieldset{ border: solid 1px lightblue; background-color:white; margin:10px; padding:10px; } |
39 | legend{ border: solid 1px blue; background-color:white; margin:10px; padding:10px; } | |
a8545882 | 40 | </style> |
79f261d4 | 41 | <form id='form3' name='form3' method='POST' action='printer.php'> |
3f627365 | 42 | <?PHP |
214e6829 | 43 | if($_COOKIE['level'] == 'admin'){ |
feef9b7e | 44 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
214e6829 | 45 | }else{ |
feef9b7e | 46 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved'"; |
80b72550 PM |
47 | } |
48 | $r = $petition->query($q); | |
49 | while($d = mysqli_fetch_array($r)){ | |
6b1f3680 | 50 | echo "<fieldset style='background-color:$d[web_color];'><legend style='background-color:white;'>$d[petition_name] - Unprinted</legend> |
9a5ee71a PM |
51 | <a onclick=\"javascript:checkAll('form3', true);\" href=\"javascript:void();\">Check All</a> |
52 | <a onclick=\"javascript:checkAll('form3', false);\" href=\"javascript:void();\">Uncheck All</a> | |
53 | <input type='submit' value='PRINT'>"; | |
80b72550 PM |
54 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; |
55 | unset($hide); | |
56 | $hide = array(); | |
57 | $pID = $d['petition_id']; | |
0c13e2c5 | 58 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status = '' and signature_status <> 'deleted' order by signature_status, id desc"; |
80b72550 PM |
59 | $r2 = $petition->query($q2); |
60 | while($d2 = mysqli_fetch_array($r2)){ | |
6a911fb1 | 61 | if ($d2['signature_status'] == 'verified'){ |
96e91f82 | 62 | echo "<tr><td><input type='checkbox' name='print[".$d2[id]."]'></td><td>$d2[ip_address]</td><td>$d2[date_time_signed]</td><td>$d2[signed_name_as]</td><td>$d2[signed_name_as_circulator]</td><td>$d2[contact_phone]</td><td>$d2[signature_status]-<a href='?review=$d2[id]'>Flag for Review</a></td><td>$d2[printed_status]</td></tr>"; |
8452f380 PM |
63 | }else{ |
64 | echo "<tr><td><a href='?override=$d2[id]'>Override</a> or <a href='?delete=$d2[id]'>Delete</a></td><td>$d2[ip_address]</td><td>$d2[date_time_signed]</td><td>$d2[signed_name_as]</td><td>$d2[signed_name_as_circulator]</td><td>$d2[contact_phone]</td><td>$d2[signature_status]</td><td>$d2[printed_status]</td></tr>"; | |
65 | } | |
80b72550 | 66 | } |
22e166b5 | 67 | echo '</table></fieldset>'; |
80b72550 | 68 | } |
22e166b5 | 69 | ?> |
80b72550 PM |
70 | </form> |
71 | ||
72 | <form id='form2' name='form2' method='POST' action='printer.php'> | |
8452f380 | 73 | |
80b72550 PM |
74 | <?PHP |
75 | if($_COOKIE['level'] == 'admin'){ | |
feef9b7e | 76 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
80b72550 | 77 | }else{ |
feef9b7e | 78 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved' "; |
214e6829 PM |
79 | } |
80 | $r = $petition->query($q); | |
f1f9b284 | 81 | while($d = mysqli_fetch_array($r)){ |
6b1f3680 | 82 | echo "<fieldset style='background-color:$d[web_color];'><legend style='background-color:white;'>$d[petition_name] - Printed</legend> |
8452f380 PM |
83 | <a onclick=\"javascript:checkAll('form2', true);\" href=\"javascript:void();\">Check All</a> |
84 | <a onclick=\"javascript:checkAll('form2', false);\" href=\"javascript:void();\">Uncheck All</a> | |
85 | <input type='submit' value='PRINT'>"; | |
b4906349 | 86 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; |
d07e2f50 PM |
87 | unset($hide); |
88 | $hide = array(); | |
66c9275f | 89 | $pID = $d['petition_id']; |
04bc440c | 90 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status <> '' and signature_status <> 'deleted' order by signature_status, id desc"; |
f1f9b284 PM |
91 | $r2 = $petition->query($q2); |
92 | while($d2 = mysqli_fetch_array($r2)){ | |
6a911fb1 | 93 | if ($d2['signature_status'] == 'verified'){ |
96e91f82 | 94 | echo "<tr><td><input type='checkbox' name='print[".$d2[id]."]'></td><td>$d2[ip_address]</td><td>$d2[date_time_signed]</td><td>$d2[signed_name_as]</td><td>$d2[signed_name_as_circulator]</td><td>$d2[contact_phone]</td><td>$d2[signature_status]-<a href='?review=$d2[id]'>Flag for Review</a></td><td>$d2[printed_status]</td></tr>"; |
3d88cafe PM |
95 | }else{ |
96 | echo "<tr><td><a href='?override=$d2[id]'>Override</a> or <a href='?delete=$d2[id]'>Delete</a></td><td>$d2[ip_address]</td><td>$d2[date_time_signed]</td><td>$d2[signed_name_as]</td><td>$d2[signed_name_as_circulator]</td><td>$d2[contact_phone]</td><td>$d2[signature_status]</td><td>$d2[printed_status]</td></tr>"; | |
97 | } | |
f1f9b284 | 98 | } |
3f6d2be7 | 99 | echo '</table></fieldset>'; |
f1f9b284 | 100 | } |
ef5d85f4 | 101 | ?> |
3f627365 | 102 | </form> |
f8ab31d6 | 103 | |
3f627365 | 104 | <?PHP |
e3599ddc PM |
105 | include_once('footer.php'); |
106 | ?> |