Commit | Line | Data |
---|---|---|
e3599ddc PM |
1 | <?PHP |
2 | include_once('security.php'); | |
3 | include_once('header.php'); | |
9970efb3 | 4 | slack_general('ADMIN: Reports Loaded ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition'); |
f1f9b284 | 5 | $group_id = $_COOKIE['group_id']; |
3f627365 PM |
6 | ?> |
7 | <script> | |
8 | function checkAll(formname, checktoggle) | |
9 | { | |
10 | var checkboxes = new Array(); | |
11 | checkboxes = document[formname].getElementsByTagName('input'); | |
12 | ||
13 | for (var i=0; i<checkboxes.length; i++) { | |
14 | if (checkboxes[i].type == 'checkbox') { | |
15 | checkboxes[i].checked = checktoggle; | |
16 | } | |
17 | } | |
18 | } | |
19 | </script> | |
a8545882 PM |
20 | <style> |
21 | body { background-color:lightgrey; } | |
3f6d2be7 PM |
22 | fieldset{ border: solid 1px lightblue; background-color:white; margin:10px; padding:10px; } |
23 | legend{ border: solid 1px blue; background-color:white; margin:10px; padding:10px; } | |
a8545882 | 24 | </style> |
79f261d4 | 25 | <form id='form3' name='form3' method='POST' action='printer.php'> |
22e166b5 | 26 | |
3f627365 PM |
27 | <a onclick="javascript:checkAll('form3', true);" href="javascript:void();">check all</a> |
28 | <a onclick="javascript:checkAll('form3', false);" href="javascript:void();">uncheck all</a> | |
79f261d4 | 29 | <input type='submit' value='PRINT'> |
3f627365 | 30 | <?PHP |
214e6829 | 31 | if($_COOKIE['level'] == 'admin'){ |
feef9b7e | 32 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
214e6829 | 33 | }else{ |
feef9b7e | 34 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved'"; |
80b72550 PM |
35 | } |
36 | $r = $petition->query($q); | |
37 | while($d = mysqli_fetch_array($r)){ | |
22e166b5 | 38 | echo "<fieldset><legend>$d[petition_name] - Unprinted</legend>"; |
80b72550 PM |
39 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; |
40 | unset($hide); | |
41 | $hide = array(); | |
42 | $pID = $d['petition_id']; | |
feef9b7e | 43 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status = '' order by id desc"; |
80b72550 PM |
44 | $r2 = $petition->query($q2); |
45 | while($d2 = mysqli_fetch_array($r2)){ | |
f8ab31d6 PM |
46 | // if (!in_array($d2['VTRID'], $hide)) { |
47 | //$hide[] = $d2['VTRID']; | |
80b72550 | 48 | 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]</td><td>$d2[printed_status]</td></tr>"; |
f8ab31d6 | 49 | //} |
80b72550 | 50 | } |
22e166b5 | 51 | echo '</table></fieldset>'; |
80b72550 | 52 | } |
22e166b5 | 53 | ?> |
80b72550 PM |
54 | </form> |
55 | ||
56 | <form id='form2' name='form2' method='POST' action='printer.php'> | |
57 | <a onclick="javascript:checkAll('form2', true);" href="javascript:void();">check all</a> | |
58 | <a onclick="javascript:checkAll('form2', false);" href="javascript:void();">uncheck all</a> | |
59 | <input type='submit' value='PRINT'> | |
60 | <?PHP | |
61 | if($_COOKIE['level'] == 'admin'){ | |
feef9b7e | 62 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
80b72550 | 63 | }else{ |
feef9b7e | 64 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved' "; |
214e6829 PM |
65 | } |
66 | $r = $petition->query($q); | |
f1f9b284 | 67 | while($d = mysqli_fetch_array($r)){ |
22e166b5 | 68 | echo "<fieldset><legend>$d[petition_name] - Printed</legend>"; |
b4906349 | 69 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; |
d07e2f50 PM |
70 | unset($hide); |
71 | $hide = array(); | |
66c9275f | 72 | $pID = $d['petition_id']; |
feef9b7e | 73 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status <> '' order by id desc"; |
f1f9b284 PM |
74 | $r2 = $petition->query($q2); |
75 | while($d2 = mysqli_fetch_array($r2)){ | |
f8ab31d6 PM |
76 | //if (!in_array($d2['VTRID'], $hide)) { |
77 | //$hide[] = $d2['VTRID']; | |
3f627365 | 78 | 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]</td><td>$d2[printed_status]</td></tr>"; |
f8ab31d6 | 79 | //} |
f1f9b284 | 80 | } |
3f6d2be7 | 81 | echo '</table></fieldset>'; |
f1f9b284 | 82 | } |
ef5d85f4 | 83 | ?> |
3f627365 | 84 | </form> |
f8ab31d6 | 85 | |
3f627365 | 86 | <?PHP |
e3599ddc PM |
87 | include_once('footer.php'); |
88 | ?> |