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