Update analytics.php
[clinton/MarylandElectronicPetitionSignature.git] / admin / follow_up_success.php
CommitLineData
7ae2b7fd
PM
1<?PHP
2include_once('../slack.php');
3include_once('security.php');
4if ($_COOKIE['level'] == 'user'){
5 slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
6 header('Location: user_home.php');
7}
8if ($_COOKIE['level'] == 'manager'){
9 slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
10 header('Location: manager_home.php');
11}
12include_once('header.php');
a2b8c54c
PM
13$list1 = '';
14$list2 = '';
15$list3 = '';
16
17$q="SELECT * FROM follow_up where status = 'NEW'";
18$r = $petition->query($q);
19while($d = mysqli_fetch_array($r)){
86a3c888
PM
20 $sig = '';
21 if ($d['name'] != ''){
22 $q3 = "SELECT date_time_signed FROM signatures where signed_name_as = '$d[name]'";
23 $r3 = $petition->query($q3);
24 $d3 = mysqli_fetch_array($r3);
25 if ($d3['date_time_signed'] != ''){
26 $sig = "<b>SIGNATURE $d3[date_time_signed]</b>";
27 }
28 }
29 $presig='';
30 $q4="SELECT * FROM presign where email_for_follow_up = '$d[email]' and php_page like '/sign.php%'";
31 $r4 = $petition->query($q4);
32 $d4 = mysqli_fetch_array($r4);
33 if ($d4['action_on']){
34 $presig = "<b>PRESIG $d4[action_on]</b>";
35 }
36 if ($presig != '' || $sig != ''){
37 $list3 .= "<li>$d[email] $presig $d[name] $sig</li>";
38 }else{
39 $list3 .= "<li>$d[date_sent] $d[email] $d[name]</li>";
40 }
a2b8c54c 41}
94f5d5b9 42
821b2850 43$q="SELECT * FROM follow_up where status <> 'NEW' order by id DESC";
7ae2b7fd
PM
44$r = $petition->query($q);
45while($d = mysqli_fetch_array($r)){
35e7632f
PM
46 $sig = '';
47 if ($d['name'] != ''){
48 $q3 = "SELECT date_time_signed FROM signatures where signed_name_as = '$d[name]'";
49 $r3 = $petition->query($q3);
50 $d3 = mysqli_fetch_array($r3);
51 if ($d3['date_time_signed'] != ''){
52 $sig = "<b>SIGNATURE $d3[date_time_signed]</b>";
53 }
54 }
55 $presig='';
56 $q4="SELECT * FROM presign where email_for_follow_up = '$d[email]' and php_page like '/sign.php%'";
57 $r4 = $petition->query($q4);
58 $d4 = mysqli_fetch_array($r4);
59 if ($d4['action_on']){
60 $presig = "<b>PRESIG $d4[action_on]</b>";
61 }
94f5d5b9
PM
62 if ($presig != '' || $sig != ''){
63 $list1 .= "<li>$d[email] $presig $d[name] $sig</li>";
64 }else{
65 $list2 .= "<li>$d[date_sent] $d[email] $d[name]</li>";
66 }
67
7ae2b7fd 68}
a2b8c54c
PM
69ob_start();
70echo "<h1>Outbox</h1>";
71echo "<ol>";
72echo $list3;
73echo "</ol>";
74$buffer = ob_get_clean();
75if ($list3 != ''){
76 echo $buffer;
77}
94f5d5b9
PM
78echo "<h1>Signed</h1>";
79echo "<ol>";
80echo $list1;
81echo "</ol>";
82echo "<h1>Sent</h1>";
83echo "<ol>";
84echo $list2;
7ae2b7fd
PM
85echo "</ol>";
86include_once('footer.php');