Update follow_up_success.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
14 $q="SELECT * FROM follow_up where status <> 'NEW'";
15 $r = $petition->query($q);
16 while($d = mysqli_fetch_array($r)){
17 $sig = '';
18 if ($d['name'] != ''){
19 $q3 = "SELECT date_time_signed FROM signatures where signed_name_as = '$d[name]'";
20 $r3 = $petition->query($q3);
21 $d3 = mysqli_fetch_array($r3);
22 if ($d3['date_time_signed'] != ''){
23 $sig = "<b>SIGNATURE $d3[date_time_signed]</b>";
24 }
25 }
26 $presig='';
27 $q4="SELECT * FROM presign where email_for_follow_up = '$d[email]' and php_page like '/sign.php%'";
28 $r4 = $petition->query($q4);
29 $d4 = mysqli_fetch_array($r4);
30 if ($d4['action_on']){
31 $presig = "<b>PRESIG $d4[action_on]</b>";
32 }
33 if ($presig != '' || $sig != ''){
34 $list1 .= "<li>$d[email] $presig $d[name] $sig</li>";
35 }else{
36 $list2 .= "<li>$d[date_sent] $d[email] $d[name]</li>";
37 }
38
39 }
40 echo "<h1>Signed</h1>";
41 echo "<ol>";
42 echo $list1;
43 echo "</ol>";
44 echo "<h1>Sent</h1>";
45 echo "<ol>";
46 echo $list2;
47 echo "</ol>";
48 include_once('footer.php');