Update slack.php
[clinton/MarylandElectronicPetitionSignature.git] / admin / analytics.php
CommitLineData
5623205d 1<?PHP
2bfe8168 2
8e673460
PM
3if (empty($_GET['run'])){
4 if ($_COOKIE['name'] == ''){
5 die('no name');
6 }
7 include_once('bots.php');
8 include_once('../slack.php');
9 include_once('security.php');
10 include_once('/var/www/secure.php'); //outside webserver
11 include_once('functions.php');
12}else{
13 include_once('../slack.php');
14 include_once('/var/www/secure.php'); //outside webserver
15 include_once('functions.php');
16}
994a5546 17ob_start();
bcdaa662
PM
18
19$sign_email = $_COOKIE['sign_email'];
763e8859 20if (isset($_GET['sign_email'])){
ac81b5cd 21 // here we use it, if it shows up next run, we block
763e8859 22 $sign_email = $_GET['sign_email'];
bcdaa662 23 $_COOKIE['sign_email'] = $sign_email;
01130aac 24 setcookie("sign_email", $sign_email);
cdad190e 25
763e8859
PM
26}
27
d08d331f 28function js_redirect($page){ // now header - prep for full auto
2bfe8168 29 $base = 'https://www.md-petition.com/admin/';
880fe255 30 $url = $base.$page.'&run=1';
01130aac 31 $pos = strpos($page, $_COOKIE['sign_email']);
763e8859
PM
32 if ($pos === false) {
33 // email not found - good to redirect
d08d331f 34 //echo "<script>window.location.href = \"$url\";</script>";
9b593232 35 slack_general('js_redirect('.$page.')','automation');
b3e04c2f 36 header('Location: '.$url);
d08d331f 37 //slack_general('CHECK COOKIE ('.$_COOKIE['sign_email'].') PAGE ('.$page.')','md-petition-admin');
763e8859
PM
38 die();
39 } else {
cdad190e 40 slack_general('Loop Detected for '.$_COOKIE['sign_email'],'automation');
763e8859
PM
41 echo "<h1>Automated Loop Detected - Skip</h1>";
42 }
43
2bfe8168
PM
44}
45
5623205d
PM
46if ($_COOKIE['level'] == 'user'){
47 slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
48 header('Location: user_home.php');
49}
28de89d0
PM
50if (isset($_GET['clear_php_session_id'])){
51 $id = $_GET['clear_php_session_id'];
52 $petition->query("update presign set presign_status = 'DONE' where php_session_id = '$id' ");
cdaa5f15 53 header('Location: analytics.php');
28de89d0 54}
53ff5c98
PM
55if (isset($_GET['clear_email'])){
56 $email = $_GET['clear_email'];
5afbd813 57 $petition->query("update presign set presign_status = 'DONE' where email_for_follow_up = '$email' ");
53ff5c98
PM
58 header('Location: analytics.php');
59}
980cb9f6
PM
60if (isset($_GET['sign_email'])){
61 $email = $_GET['sign_email'];
5afbd813 62 $petition->query("update presign set presign_status = 'SIGNED' where email_for_follow_up = '$email' ");
980cb9f6
PM
63 header('Location: analytics.php');
64}
9e6d5e27
PM
65if (isset($_GET['sign_php_session_id'])){
66 $id = $_GET['sign_php_session_id'];
67 $petition->query("update presign set presign_status = 'SIGNED' where php_session_id = '$id' ");
cdaa5f15 68 header('Location: analytics.php');
9e6d5e27 69}
5623205d
PM
70if ($_COOKIE['level'] == 'manager'){
71 slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
72 header('Location: manager_home.php');
73}
73a94d3f 74if (isset($_GET['flag_invalid_signature'])){
68e387b9 75 $id = $_GET['flag_invalid_signature'];
73a94d3f 76 $petition->query("update signatures set signature_status = 'flag_invalid_signature' where id = '$id' ");
cdaa5f15 77 header('Location: analytics.php');
73a94d3f 78}
68e387b9
PM
79if (isset($_GET['flag_duplicate'])){
80 $id = $_GET['flag_duplicate'];
81 $petition->query("update signatures set signature_status = 'flag_duplicate' where id = '$id' ");
cdaa5f15 82 header('Location: analytics.php');
68e387b9
PM
83}
84if (isset($_GET['flag_ip_address'])){
85 $ip = $_GET['flag_ip_address'];
86 $petition->query("update signatures set signature_status = 'flag_ip_address' where ip_address = '$ip' ");
cdaa5f15 87 header('Location: analytics.php');
68e387b9 88}
dcc3fc26
PM
89if (isset($_GET['resign_requested'])){
90 $id = $_GET['resign_requested'];
91 $petition->query("update signatures set signature_status = 'resign_requested' where id = '$id' ");
cdaa5f15 92 header('Location: analytics.php');
dcc3fc26 93}
3f8c226b
PM
94if (isset($_GET['bot'])){
95 $id = $_GET['bot'];
96 $petition->query("update signatures set signature_status = 'bot' where id = '$id' ");
cdaa5f15 97 header('Location: analytics.php');
3f8c226b 98}
68e387b9
PM
99if (isset($_GET['flag_VTRID'])){
100 $VTRID = $_GET['flag_VTRID'];
101 $petition->query("update signatures set signature_status = 'flag_VTRID' where VTRID = '$VTRID' ");
cdaa5f15 102 header('Location: analytics.php');
68e387b9 103}
587d1da3
PM
104if (isset($_GET['flag_phone'])){
105 $flag_phone = $_GET['flag_phone'];
106 $petition->query("update signatures set signature_status = 'flag_phone' where contact_phone = '$flag_phone' ");
cdaa5f15 107 header('Location: analytics.php');
587d1da3 108}
c7d45ac6 109include_once('header.php');
f49d1b19
PM
110if (isset($_GET['ip_address'])){
111 $ip = $_GET['ip_address'];
2a00571e 112 $petition_id = $_GET['petition_id'];
68e387b9 113 echo "<h1>Review $ip</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
2a00571e 114 $q = "SELECT * FROM signatures where ip_address = '$ip' and signature_status = 'verified' and petition_id = '$petition_id' order by signature_status desc ";
45bc6a1e 115 $r = $petition->query($q);
7ce3d9ec 116 while($d = mysqli_fetch_array($r)){
4fca24b9
PM
117 $color = 'white';
118 $pos = strpos($d['date_time_signed'], date('Y-m-d'));
119 if ($pos !== false) {
120 $color= 'yellow';
121 }
122 echo "<tr style='background-color:$color;'>
68e387b9
PM
123 <td><b>$d[date_time_signed]</b></td>
124 <td><a href='?VTRID=$d[VTRID]'>$d[VTRID]</a></td>
6c9432fc 125 <td>".id2petition($d['petition_id'])."</td>
68e387b9
PM
126 <td>$d[signed_name_as]</td>
127 <td>$d[signed_name_as_circulator]</td>
128 <td>$d[contact_phone]</td>
68e387b9 129 <td>$d[printed_status]</td>
dcc3fc26
PM
130 <td><a href='?flag_invalid_signature=$d[id]'>flag invalid signature</a></td>
131 <td><a href='?flag_VTRID=$d[VTRID]'>flag VTRID</a></td>
132 <td><a href='?flag_ip_address=$d[ip_address]'>flag ip address</a></td>
133 <td><a href='?flag_duplicate=$d[id]'>flag duplicate</a></td>
134 <td><a href='?flag_phone=$d[contact_phone]'>contact phone</a></td>
ff3013b8 135 <td><a href='?resign_requested=$d[id]'>resign requested</a></td>
3f8c226b 136 <td><a href='?bot=$d[id]'>bot</a></td>
68e387b9 137 </tr>";
7ce3d9ec 138 }
3a0177c8 139 echo "</table>";
d6495122
PM
140}elseif(isset($_GET['email'])){
141 $email = $_GET['email'];
142 echo "<h1>Review $email</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
143 $q = "SELECT * FROM presign where email_for_follow_up = '$email' order by id desc ";
144 $r = $petition->query($q);
145 while($d = mysqli_fetch_array($r)){
146 $color = 'white';
147 $test = date('Y-m-d',strtotime($d['action_on']));
148 $pos = strpos($test, date('Y-m-d'));
149 if ($pos !== false) {
150 $color= 'yellow';
151 }
152 echo "<tr style='background-color:$color;'>
153 <td style='white-space:pre;'><b>$d[action_on]</b></td>
617b4302 154 <td style='white-space:pre;'><a href='?php_session_id=$d[php_session_id]'>$d[php_session_id]</a></td>
d6495122
PM
155 <td style='white-space:pre;'>$d[php_page]</td>
156 <td style='white-space:pre;'>".id2petition($d['petition'])."</td>
157 <td style='white-space:pre;'>$d[invite]</td>
158 <td style='white-space:pre;'>$d[invite_error]</td>
159 <td style='white-space:pre;'>$d[name]</td>
160 <td style='white-space:pre;'>$d[email_for_follow_up]</td>
161 <td style='white-space:pre;'>$d[phone_for_validation]</td>
162 <td style='white-space:pre;'>$d[presign_status]</td>
163 <td style='white-space:pre;'>$d[ip_address]</td>
164 <td style='white-space:pre;'>$d[browser_string]</td>
165 </tr>";
166 }
980cb9f6 167 echo "</table><a href='?clear_email=$email'>CLEAR EMAIL</a> - <a href='?sign_email=$email'>SIGNATURE FOUND</a>";
971585e7 168}elseif(isset($_GET['php_session_id']) && empty($_GET['follow_up'])){
b331a809
PM
169 $php_session_id = $_GET['php_session_id'];
170 echo "<h1>Review $php_session_id</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
171 $q = "SELECT * FROM presign where php_session_id = '$php_session_id' order by id desc ";
172 $r = $petition->query($q);
173 while($d = mysqli_fetch_array($r)){
174 $color = 'white';
eea234c3
PM
175 $test = date('Y-m-d',strtotime($d['action_on']));
176 $pos = strpos($test, date('Y-m-d'));
b331a809
PM
177 if ($pos !== false) {
178 $color= 'yellow';
179 }
180 echo "<tr style='background-color:$color;'>
eea234c3
PM
181 <td style='white-space:pre;'><b>$d[action_on]</b></td>
182 <td style='white-space:pre;'>$d[php_page]</td>
183 <td style='white-space:pre;'>".id2petition($d['petition'])."</td>
184 <td style='white-space:pre;'>$d[invite]</td>
973dd966 185 <td style='white-space:pre;'>$d[invite_error]</td>
eea234c3 186 <td style='white-space:pre;'>$d[name]</td>
d6495122 187 <td style='white-space:pre;'><a href='?email=$d[email_for_follow_up]'>$d[email_for_follow_up]</a></td>
eea234c3
PM
188 <td style='white-space:pre;'>$d[phone_for_validation]</td>
189 <td style='white-space:pre;'>$d[presign_status]</td>
190 <td style='white-space:pre;'>$d[ip_address]</td>
191 <td style='white-space:pre;'>$d[browser_string]</td>
971585e7
PM
192 </tr>";
193 }
980cb9f6 194 echo "</table><a href='?clear_php_session_id=$php_session_id'>CLEAR SESSION</a> -
707c5a7b 195 <a href='?sign_php_session_id=$php_session_id'>SIGNATURE FOUND</a><br>
7cdb2650 196 - <a href='?php_session_id=$php_session_id&follow_up=X'>ADD TO FOLLOW UP LIST Maryland General</a><br>
707c5a7b
PM
197 - <a href='?php_session_id=$php_session_id&follow_up=1'>ADD TO FOLLOW UP LIST MGP</a><br>
198 - <a href='?php_session_id=$php_session_id&follow_up=2'>ADD TO FOLLOW UP LIST MLP</a><br>
199 - <a href='?php_session_id=$php_session_id&follow_up=3'>ADD TO FOLLOW UP LIST BTEC</a><br>
200 - <a href='?php_session_id=$php_session_id&follow_up=7'>ADD TO FOLLOW UP LIST PG</a><br>
e511d315
PM
201 - <a href='?php_session_id=$php_session_id&follow_up=8'>ADD TO FOLLOW UP LIST Ivey</a>
202 ";
971585e7
PM
203}elseif(isset($_GET['php_session_id']) && isset($_GET['follow_up'])){
204 $php_session_id = $_GET['php_session_id'];
205 echo "<h1>Adding Follow up for $php_session_id to $_GET[follow_up]</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
206 $q = "SELECT * FROM presign where php_session_id = '$php_session_id' order by id desc ";
207 $r = $petition->query($q);
971585e7 208 while($d = mysqli_fetch_array($r)){
f8753855 209
971585e7
PM
210 $color = 'white';
211 $test = date('Y-m-d',strtotime($d['action_on']));
212 $pos = strpos($test, date('Y-m-d'));
213 if ($pos !== false) {
214 $color= 'yellow';
215 }
f8753855
PM
216if ($d[name] != ''){
217 $name = $d[name];
218}
219if ($d[email_for_follow_up] != ''){
220 $email = $d[email_for_follow_up];
221}
971585e7
PM
222 echo "<tr style='background-color:$color;'>
223 <td style='white-space:pre;'><b>$d[action_on]</b></td>
224 <td style='white-space:pre;'>$d[php_page]</td>
225 <td style='white-space:pre;'>".id2petition($d['petition'])."</td>
226 <td style='white-space:pre;'>$d[invite]</td>
227 <td style='white-space:pre;'>$d[invite_error]</td>
228 <td style='white-space:pre;'>$d[name]</td>
229 <td style='white-space:pre;'>$d[email_for_follow_up]</td>
230 <td style='white-space:pre;'>$d[phone_for_validation]</td>
231 <td style='white-space:pre;'>$d[presign_status]</td>
232 <td style='white-space:pre;'>$d[ip_address]</td>
233 <td style='white-space:pre;'>$d[browser_string]</td>
b331a809
PM
234 </tr>";
235 }
ef2c1da5 236 $petition->query("insert into follow_up (name, email, php_session, petition_id, date_sent) values ('$name','$email','$php_session_id','$_GET[follow_up]','".date('Y-m-d')."') ");
b739e778 237 $petition->query("update presign set presign_status = 'DONE' where php_session_id = '$php_session_id' ");
d75dee31 238 $petition->query("update presign set presign_status = 'DONE' where email_for_follow_up = '$email' ");
1f0c4bd2 239 echo "</table>";
f49d1b19
PM
240}elseif (isset($_GET['VTRID'])){
241 $VTRID = $_GET['VTRID'];
2a00571e 242 $petition_id = $_GET['petition_id'];
68e387b9 243 echo "<h1>Review $VTRID</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
2a00571e 244 $q = "SELECT * FROM signatures where VTRID = '$VTRID' and signature_status = 'verified' and petition_id = '$petition_id' order by petition_id, id DESC ";
45bc6a1e 245 $r = $petition->query($q);
6ecdab3a 246 $i=0;
7ce3d9ec 247 while($d = mysqli_fetch_array($r)){
4fca24b9
PM
248 $color = 'white';
249 $pos = strpos($d['date_time_signed'], date('Y-m-d'));
250 if ($pos !== false) {
251 $color= 'yellow';
252 }
253 echo "<tr style='background-color:$color;'>
68e387b9
PM
254 <td><b>$d[date_time_signed]</b></td>
255 <td><a href='?ip_address=$d[ip_address]'>$d[ip_address]</a></td>
b6545efe 256 <td>".id2petition($d['petition_id'])."</td>
68e387b9
PM
257 <td>$d[signed_name_as]</td>
258 <td>$d[signed_name_as_circulator]</td>
259 <td>$d[contact_phone]</td>
68e387b9 260 <td>$d[printed_status]</td>
dcc3fc26
PM
261 <td><a href='?flag_invalid_signature=$d[id]'>flag invalid signature</a></td>
262 <td><a href='?flag_VTRID=$d[VTRID]'>flag VTRID</a></td>
263 <td><a href='?flag_ip_address=$d[ip_address]'>flag ip address</a></td>
264 <td><a href='?flag_duplicate=$d[id]'>flag duplicate</a></td>
265 <td><a href='?flag_phone=$d[contact_phone]'>contact phone</a></td>
ff3013b8 266 <td><a href='?resign_requested=$d[id]'>resign requested</a></td>
3f8c226b 267 <td><a href='?bot=$d[id]'>bot</a></td>
6ecdab3a
PM
268 </tr>";
269 if ($i == 0){
270 js_redirect("analytics.php?flag_duplicate=$d[id]");
271 }
272 $i++;
7ce3d9ec 273 }
3a0177c8 274 echo "</table>";
2bfe8168 275 die();
f49d1b19 276}
5623205d 277?>
4b205268 278
025fe4dd 279<h1>Signature Analytics - Server Clock: <?PHP echo date('r');?></h1>
d5dffc27 280<h2>NEVER NEVER NEVER CALL OR TEXT ANYONE - ONLY EMAIL!!!</h2>
cdaa5f15 281<h3>SysOp Says: Transparency = Trust</h3>
a0b1579f
PM
282<table>
283
284 <tr>
1f8109a1 285 <td valign="top" colspan='2'><?PHP /*
a0b1579f
PM
286<h2>IP Address</h2>
287<div>Watching for duplicates.</div><ol>
288<?PHP
289$q="SELECT ip_address, petition_id,VTRID, COUNT(*) as count FROM signatures where signature_status = 'verified' group by ip_address, petition_id, VTRID";
290$r = $petition->query($q);
291while($d = mysqli_fetch_array($r)){
292 if ($d['count'] > 1){
293 echo "<li><a href='?ip_address=$d[ip_address]&petition_id=$d[petition_id]'>$d[ip_address]</a> ".id2petition($d['petition_id'])." <b>$d[count]</b> $d[signed_name_as]</li>";
294 }
295}
1f8109a1
PM
296?></ol>
297 </td><td valign="top"> */ ?>
a0b1579f
PM
298<h2>VTRID</h2>
299<div>Watching for duplicates.</div><ol>
300<?PHP
301$q="SELECT VTRID, petition_id, COUNT(*) as count FROM signatures where signature_status = 'verified' group by VTRID, petition_id";
302$r = $petition->query($q);
c948926c 303$i=0;
a0b1579f
PM
304while($d = mysqli_fetch_array($r)){
305 if ($d['count'] > 1){
306 echo "<li><a href='?VTRID=$d[VTRID]&petition_id=$d[petition_id]'>$d[VTRID]</a> ".id2petition($d['petition_id'])." <b>$d[count]</b> $d[signed_name_as]</li>";
c948926c
PM
307 if ($i == 0){
308 js_redirect("analytics.php?VTRID=$d[VTRID]&petition_id=$d[petition_id]");
309 }
310 $i++;
a0b1579f 311 }
c948926c 312
a0b1579f
PM
313}
314 ?></ol>
315 </td></tr>
316
317
d1dcf736 318<tr>
fcb27806 319<td valign="top" colspan='2'>
d1dcf736 320<h2>Pre-Sign</h2>
617b4302 321<div>Follow up requested - never signed.</div>
1f8109a1 322<form method='GET'><input name='email'><input type='submit' value='SEARCH E-MAIL'></form><table>
d1dcf736 323<?PHP
6792c2dd 324$q="SELECT distinct php_session_id FROM presign where presign_status = 'NEW' and email_for_follow_up <> '' order by id";
d1dcf736
PM
325$r = $petition->query($q);
326while($d = mysqli_fetch_array($r)){
327 $q2="SELECT * FROM presign where php_session_id = '$d[php_session_id]' order by id desc";
328 $r2 = $petition->query($q2);
329 $d2 = mysqli_fetch_array($r2);
bfa39749
PM
330 $sig = '';
331 if ($d2['name'] != ''){
332 $q3 = "SELECT date_time_signed FROM signatures where signed_name_as = '$d2[name]'";
333 $r3 = $petition->query($q3);
334 $d3 = mysqli_fetch_array($r3);
020ef085 335 if ($d3['date_time_signed'] != ''){
b82d1c75 336 $sig = "<b><a href='?sign_email=$d2[email_for_follow_up]'>SIGNATURE $d3[date_time_signed]</a></b><br>";
b61373ea 337 js_redirect("analytics.php?sign_email=$d2[email_for_follow_up]");
020ef085 338 }
bfa39749 339 }
3bfc2070 340 $presig='';
c22e5d57 341 $q4="SELECT * FROM presign where email_for_follow_up = '$d2[email_for_follow_up]' and php_page like '/sign.php%'";
3bfc2070
PM
342 $r4 = $petition->query($q4);
343 $d4 = mysqli_fetch_array($r4);
18be5f6c 344 if ($d4['action_on']){
b82d1c75 345 $presig = "<b><a href='?sign_email=$d2[email_for_follow_up]'>PRESIG $d4[action_on]</a></b><br>";
b61373ea 346 js_redirect("analytics.php?sign_email=$d2[email_for_follow_up]");
3bfc2070 347 }
18be5f6c
PM
348 $invite_error='';
349 $q4="SELECT * FROM presign where email_for_follow_up = '$d2[email_for_follow_up]' and invite_error <> '' ";
350 $r4 = $petition->query($q4);
351 $d4 = mysqli_fetch_array($r4);
352 if ($d4['invite_error'] != ''){
b82d1c75 353 $invite_error = "<b><a href='?clear_email=$d2[email_for_follow_up]'>$d4[invite_error]</a></b><br>";
b61373ea 354 js_redirect("analytics.php?clear_email=$d2[email_for_follow_up]");
18be5f6c 355 }
ef385212 356 $php_session_id = $d2['php_session_id'];
4619b9ca
PM
357 echo "<tr><td><a href='?php_session_id=$php_session_id'>$d2[action_on]</a></td><td>$presig $sig $invite_error</td>
358 <td>$d2[name]</td><td><a href='?email=$d2[email_for_follow_up]'>$d2[email_for_follow_up]</a></td>
359 <td>".id2petition($d2['petition'])."</td><td>$d2[invite]</td>
ef385212
PM
360 <td><a href='?php_session_id=$php_session_id&follow_up=X'>General</a>
361 - <a href='?php_session_id=$php_session_id&follow_up=1'>MGP</a>
362 - <a href='?php_session_id=$php_session_id&follow_up=2'>MLP</a>
363 - <a href='?php_session_id=$php_session_id&follow_up=3'>BTEC</a>
364 - <a href='?php_session_id=$php_session_id&follow_up=7'>PG</a>
365 - <a href='?php_session_id=$php_session_id&follow_up=8'>Ivey</a></td></tr>";
4619b9ca
PM
366 if( $presig == '' && $invite_error == '' && $sig == '' ){
367 if ($d2['invite'] == 'Ivey'){
368 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=8");
a2313c2b 369 die();
4619b9ca 370 }
205eb53b
PM
371 if ($d2['invite'] == 'mlp'){
372 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=2");
a2313c2b 373 die();
205eb53b
PM
374 }
375 if ($d2['invite'] == 'BTEC'){
376 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=3");
a2313c2b 377 die();
205eb53b
PM
378 }
379 if ($d2['invite'] == 'RestorePGTermLimits'){
380 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=7");
a2313c2b 381 die();
d08d331f
PM
382 }
383 if (id2petition($d2['petition']) == 'RESTORE TWO TERM (8 YEAR) TERM LIMITS IN PRINCE GEORGE'){
384 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=7");
a2313c2b 385 die();
205eb53b 386 }
508a8904
PM
387 if ($d2['invite'] == 'mgp'){
388 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=1");
a2313c2b 389 die();
508a8904 390 }
a2313c2b 391 js_redirect("analytics.php?php_session_id=$php_session_id&follow_up=X"); // no invite found no petition found - send general follow/up
4619b9ca 392 }
d1dcf736 393}
1f8109a1 394?></table>
d1dcf736 395 </td>
fcb27806
PM
396 </tr>
397 <tr>
398<td valign="top" colspan='2'>
cdaa5f15 399<h2>Signatures</h2>
d1dcf736
PM
400<div>Last 10</div><ol>
401<?PHP
402$q="SELECT * FROM signatures where signature_status = 'verified' order by id desc limit 0, 10";
403$r = $petition->query($q);
404while($d = mysqli_fetch_array($r)){
405 echo "<li>$d[date_time_signed] ".id2petition($d['petition_id'])." $d[signed_name_as]</li>";
406}
0b1ed2a4 407?></ol>
7f0c66a3 408
d1dcf736 409 </td>
797efc8e 410
d1dcf736 411 </tr>
a0b1579f 412 <tr><td valign="top">
cdaa5f15
PM
413<h2>VTRID Bugs</h2>
414<div>Watching for 0</div><ol>
e0bd2eda 415<?PHP
e8d1541d 416$q="SELECT * FROM signatures where VTRID = '0' and signature_status <> 'bot' and signature_status <> 'flag_invalid_signature' and signature_status <> 'resign_requested'";
e0bd2eda
PM
417$r = $petition->query($q);
418while($d = mysqli_fetch_array($r)){
55fd7459 419 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> $d[petition_id] $d[signed_name_as]</li>";
9b75965d 420}
cc84dbb5 421?></ol>
797efc8e 422 </td><td valign="top">
cdaa5f15
PM
423<h2>Petition ID Bugs</h2>
424<div>Watching for 0</div><ol>
9b75965d 425<?PHP
e8d1541d 426$q="SELECT * FROM signatures where (petition_id = '0' or petition_id = '') and signature_status <> 'bot' and signature_status <> 'flag_invalid_signature' and signature_status <> 'resign_requested'";
9b75965d 427$r = $petition->query($q);
4931af50 428while($d = mysqli_fetch_array($r)){
55fd7459 429 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> $d[petition_id] $d[signed_name_as]</li>";
4931af50
PM
430}
431?></ol>
e8d1541d 432 </td></tr><tr><td valign="top">
cdaa5f15 433 <?PHP ob_start(); ?>
4931af50 434<h2>resign_requested</h2>
3f8c226b 435<div>These are most likely from early bugs</div><ol>
4931af50 436<?PHP
68fde5b1 437$q="SELECT * FROM signatures where signature_status = 'resign_requested' order by ip_address";
4931af50 438$r = $petition->query($q);
cdaa5f15 439 $show = 0;
9b75965d 440while($d = mysqli_fetch_array($r)){
cdaa5f15 441 $show = 1;
55fd7459 442 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] $d[signed_name_as]</li>";
e0bd2eda 443}
3f8c226b 444?></ol>
cdaa5f15 445 <?PHP $html = ob_get_clean(); if ( $show == 1 ){ echo $html; } ?>
3f8c226b
PM
446 </td>
447
448 <td valign="top">
cdaa5f15 449 <?PHP ob_start(); ?>
3f8c226b
PM
450<h2>bots</h2>
451<div>These are bots on the site.</div><ol>
452<?PHP
68fde5b1 453$q="SELECT * FROM signatures where signature_status = 'bot' order by ip_address";
3f8c226b 454$r = $petition->query($q);
cdaa5f15 455$show = 0;
3f8c226b 456while($d = mysqli_fetch_array($r)){
cdaa5f15 457 $show = 1;
ab89bfc5 458 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] $d[signed_name_as]</li>";
3f8c226b 459}
cc84dbb5 460?></ol>
cdaa5f15
PM
461 <?PHP $html = ob_get_clean(); if ( $show == 1 ){ echo $html; } ?>
462
797efc8e 463 </td>
5623205d 464
9b75965d 465
05fddd22 466</tr>
05fddd22 467
05fddd22 468</table>
9b75965d
PM
469
470
5623205d 471<?PHP
994a5546
PM
472// allow headers to be sent...
473$html = ob_get_clean();
474echo $html; // run javascript
475
5623205d
PM
476include_once('footer.php');
477?>