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