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