Update header.php
[clinton/MarylandElectronicPetitionSignature.git] / admin / abuse.php
index 8177650..f561ff5 100644 (file)
@@ -7,6 +7,16 @@ if ($_COOKIE['level'] == 'user'){
   slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
   header('Location: user_home.php');
 }
+if (isset($_GET['clear_php_session_id'])){
+  $id = $_GET['clear_php_session_id'];
+  $petition->query("update presign set presign_status = 'DONE' where php_session_id = '$id' ");
+  header('Location: abuse.php');
+}
+if (isset($_GET['sign_php_session_id'])){
+  $id = $_GET['sign_php_session_id'];
+  $petition->query("update presign set presign_status = 'SIGNED' where php_session_id = '$id' ");
+  header('Location: abuse.php');
+}
 if ($_COOKIE['level'] == 'manager'){
   slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
   header('Location: manager_home.php');
@@ -77,6 +87,33 @@ if (isset($_GET['ip_address'])){
     </tr>"; 
   }
   echo "</table>";
+}elseif(isset($_GET['php_session_id'])){ 
+  $php_session_id = $_GET['php_session_id']; 
+  echo "<h1>Review $php_session_id</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";    
+  $q = "SELECT * FROM presign where php_session_id = '$php_session_id' order by id desc ";
+  $r = $petition->query($q);
+  while($d = mysqli_fetch_array($r)){
+    $color = 'white';
+    $test = date('Y-m-d',strtotime($d['action_on']));
+    $pos = strpos($test, date('Y-m-d'));
+    if ($pos !== false) {
+        $color= 'yellow';
+    } 
+    echo "<tr style='background-color:$color;'>
+      <td style='white-space:pre;'><b>$d[action_on]</b></td>
+      <td style='white-space:pre;'>$d[php_page]</td>
+      <td style='white-space:pre;'>".id2petition($d['petition'])."</td>
+      <td style='white-space:pre;'>$d[invite]</td>
+      <td style='white-space:pre;'>$d[invite_error]</td>
+      <td style='white-space:pre;'>$d[name]</td>
+      <td style='white-space:pre;'>$d[email_for_follow_up]</td>
+      <td style='white-space:pre;'>$d[phone_for_validation]</td>
+      <td style='white-space:pre;'>$d[presign_status]</td>
+      <td style='white-space:pre;'>$d[ip_address]</td>
+      <td style='white-space:pre;'>$d[browser_string]</td>
+    </tr>"; 
+  }
+  echo "</table><a href='?clear_php_session_id=$php_session_id'>CLEAR ALERT</a> - <a href='?sign_php_session_id=$php_session_id'>SIGNATURE FOUND</a>";
 }elseif (isset($_GET['VTRID'])){ 
   $VTRID = $_GET['VTRID'];
   echo "<h1>Review $VTRID</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";   
@@ -110,10 +147,37 @@ if (isset($_GET['ip_address'])){
 }
 ?>
 
-<h1>Abuses</h1>
-
+<h1>Signature Quality Control</h1>
+<h2>NEVER NEVER NEVER CALL OR TEXT ANYONE - ONLY EMAIL!!!</h2>
 <table><tr>
+<tr>
+<td valign="top">
+<h2>Pre-Sign</h2>
+<div>Follow up requested - never signed.</div><ol>
+<?PHP
+$q="SELECT distinct php_session_id FROM presign where presign_status = 'NEW' and email_for_follow_up <> '' order by id desc";
+$r = $petition->query($q);
+while($d = mysqli_fetch_array($r)){ 
+  $q2="SELECT * FROM presign where php_session_id = '$d[php_session_id]' order by id desc";
+  $r2 = $petition->query($q2);
+  $d2 = mysqli_fetch_array($r2);
+    echo "<li><a href='?php_session_id=$d2[php_session_id]'>$d2[name] $d2[email_for_follow_up] ".id2petition($d2['petition'])." $d2[invite]</a></li>"; 
+}
+?></ol>
+  </td>
+<td valign="top">
+<h2>Signature</h2>
+<div>Last 10</div><ol>
+<?PHP
+$q="SELECT * FROM signatures where signature_status = 'verified' order by id desc limit 0, 10";
+$r = $petition->query($q);
+while($d = mysqli_fetch_array($r)){ 
+    echo "<li>$d[date_time_signed] ".id2petition($d['petition_id'])." $d[signed_name_as]</li>"; 
+}
+?></ol>
+  </td>
 
+  </tr>
   <td valign="top">
 <h2>IP Address</h2>
 <div>Watch for duplicates.</div><ol>
@@ -184,31 +248,7 @@ while($d = mysqli_fetch_array($r)){
 
 
 </tr>
-<tr>
-<td valign="top">
-<h2>latest</h2>
-<div>last 0-10</div><ol>
-<?PHP
-$q="SELECT * FROM signatures order by id desc limit 0, 10";
-$r = $petition->query($q);
-while($d = mysqli_fetch_array($r)){ 
-    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> ".id2petition($d['petition_id'])." $d[signed_name_as]</li>"; 
-}
-?></ol>
-  </td>
-<td valign="top">
-<h2>latest</h2>
-<div>last 10-20</div><ol>
-<?PHP
-$q="SELECT * FROM signatures order by id desc limit 10, 10";
-$r = $petition->query($q);
-while($d = mysqli_fetch_array($r)){ 
-    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> ".id2petition($d['petition_id'])." $d[signed_name_as]</li>"; 
-}
-?></ol>
-  </td>
 
-  </tr>
 </table>