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> | |
f8ab31d6 | 20 | |
79f261d4 | 21 | <form id='form3' name='form3' method='POST' action='printer.php'> |
3f627365 PM |
22 | <a onclick="javascript:checkAll('form3', true);" href="javascript:void();">check all</a> |
23 | <a onclick="javascript:checkAll('form3', false);" href="javascript:void();">uncheck all</a> | |
79f261d4 | 24 | <input type='submit' value='PRINT'> |
3f627365 | 25 | <?PHP |
214e6829 | 26 | if($_COOKIE['level'] == 'admin'){ |
feef9b7e | 27 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
214e6829 | 28 | }else{ |
feef9b7e | 29 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved'"; |
80b72550 PM |
30 | } |
31 | $r = $petition->query($q); | |
32 | while($d = mysqli_fetch_array($r)){ | |
33 | echo "<h1>$d[petition_name]</h1>"; | |
34 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; | |
35 | unset($hide); | |
36 | $hide = array(); | |
37 | $pID = $d['petition_id']; | |
feef9b7e | 38 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status = '' order by id desc"; |
80b72550 PM |
39 | $r2 = $petition->query($q2); |
40 | while($d2 = mysqli_fetch_array($r2)){ | |
f8ab31d6 PM |
41 | // if (!in_array($d2['VTRID'], $hide)) { |
42 | //$hide[] = $d2['VTRID']; | |
80b72550 | 43 | 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 | 44 | //} |
80b72550 PM |
45 | } |
46 | echo '</table>'; | |
47 | } | |
48 | ?> | |
49 | </form> | |
50 | ||
51 | <form id='form2' name='form2' method='POST' action='printer.php'> | |
52 | <a onclick="javascript:checkAll('form2', true);" href="javascript:void();">check all</a> | |
53 | <a onclick="javascript:checkAll('form2', false);" href="javascript:void();">uncheck all</a> | |
54 | <input type='submit' value='PRINT'> | |
55 | <?PHP | |
56 | if($_COOKIE['level'] == 'admin'){ | |
feef9b7e | 57 | $q="SELECT * FROM petitions where admin_status = 'approved' "; |
80b72550 | 58 | }else{ |
feef9b7e | 59 | $q="SELECT * FROM petitions where group_id = '$group_id' and admin_status = 'approved' "; |
214e6829 PM |
60 | } |
61 | $r = $petition->query($q); | |
f1f9b284 | 62 | while($d = mysqli_fetch_array($r)){ |
f8ab31d6 | 63 | echo "<h1>$d[petition_name] - Printed</h1>"; |
b4906349 | 64 | echo "<table border='1' cellpadding='0' cellspacing='5'>"; |
d07e2f50 PM |
65 | unset($hide); |
66 | $hide = array(); | |
66c9275f | 67 | $pID = $d['petition_id']; |
feef9b7e | 68 | $q2="SELECT * FROM signatures where petition_id = '$pID' and printed_status <> '' order by id desc"; |
f1f9b284 PM |
69 | $r2 = $petition->query($q2); |
70 | while($d2 = mysqli_fetch_array($r2)){ | |
f8ab31d6 PM |
71 | //if (!in_array($d2['VTRID'], $hide)) { |
72 | //$hide[] = $d2['VTRID']; | |
3f627365 | 73 | 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 | 74 | //} |
f1f9b284 | 75 | } |
71c08090 | 76 | echo '</table>'; |
f1f9b284 | 77 | } |
ef5d85f4 | 78 | ?> |
3f627365 | 79 | </form> |
f8ab31d6 | 80 | |
3f627365 | 81 | <?PHP |
e3599ddc PM |
82 | include_once('footer.php'); |
83 | ?> |