Update follow_up_success.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)){
20 $list3 .= "<li>$d[email] $d[name]</li>";
21}
94f5d5b9 22
7ae2b7fd
PM
23$q="SELECT * FROM follow_up where status <> 'NEW'";
24$r = $petition->query($q);
25while($d = mysqli_fetch_array($r)){
35e7632f
PM
26 $sig = '';
27 if ($d['name'] != ''){
28 $q3 = "SELECT date_time_signed FROM signatures where signed_name_as = '$d[name]'";
29 $r3 = $petition->query($q3);
30 $d3 = mysqli_fetch_array($r3);
31 if ($d3['date_time_signed'] != ''){
32 $sig = "<b>SIGNATURE $d3[date_time_signed]</b>";
33 }
34 }
35 $presig='';
36 $q4="SELECT * FROM presign where email_for_follow_up = '$d[email]' and php_page like '/sign.php%'";
37 $r4 = $petition->query($q4);
38 $d4 = mysqli_fetch_array($r4);
39 if ($d4['action_on']){
40 $presig = "<b>PRESIG $d4[action_on]</b>";
41 }
94f5d5b9
PM
42 if ($presig != '' || $sig != ''){
43 $list1 .= "<li>$d[email] $presig $d[name] $sig</li>";
44 }else{
45 $list2 .= "<li>$d[date_sent] $d[email] $d[name]</li>";
46 }
47
7ae2b7fd 48}
a2b8c54c
PM
49ob_start();
50echo "<h1>Outbox</h1>";
51echo "<ol>";
52echo $list3;
53echo "</ol>";
54$buffer = ob_get_clean();
55if ($list3 != ''){
56 echo $buffer;
57}
94f5d5b9
PM
58echo "<h1>Signed</h1>";
59echo "<ol>";
60echo $list1;
61echo "</ol>";
62echo "<h1>Sent</h1>";
63echo "<ol>";
64echo $list2;
7ae2b7fd
PM
65echo "</ol>";
66include_once('footer.php');