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