Update is_the_information_correct.php
[clinton/MarylandElectronicPetitionSignature.git] / admin / follow_up_success.php
1 <?PHP
2 include_once('../slack.php');
3 include_once('security.php');
4 if ($_COOKIE['level'] == 'user'){
5 slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
6 header('Location: user_home.php');
7 }
8 if ($_COOKIE['level'] == 'manager'){
9 slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
10 header('Location: manager_home.php');
11 }
12 include_once('header.php');
13 $list1 = '';
14 $list2 = '';
15 $list3 = '';
16
17 $q="SELECT * FROM follow_up where status = 'NEW'";
18 $r = $petition->query($q);
19 while($d = mysqli_fetch_array($r)){
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 }
41 }
42
43 $q="SELECT * FROM follow_up where status <> 'NEW' order by id DESC";
44 $r = $petition->query($q);
45 while($d = mysqli_fetch_array($r)){
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 }
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
68 }
69 ob_start();
70 echo "<h1>Outbox</h1>";
71 echo "<ol>";
72 echo $list3;
73 echo "</ol>";
74 $buffer = ob_get_clean();
75 if ($list3 != ''){
76 echo $buffer;
77 }
78 echo "<h1>Signed</h1>";
79 echo "<ol>";
80 echo $list1;
81 echo "</ol>";
82 echo "<h1>Sent</h1>";
83 echo "<ol>";
84 echo $list2;
85 echo "</ol>";
86 include_once('footer.php');