Update status.php
[clinton/MarylandElectronicPetitionSignature.git] / header.php
1 <?PHP
2 include_once('session.php');
3 if (isset($_GET['debug'])){
4 if ($_GET['debug'] == 'on'){
5 setcookie("debug", 'on');
6 header('Location: index.php');
7 }
8 if ($_GET['debug'] == 'off'){
9 setcookie("debug", 'off');
10 header('Location: index.php');
11 }
12 }
13 global $time_on_site;
14 if (empty($_COOKIE['start_time'])){
15 setcookie("start_time", time());
16 $time_on_site = 0;
17 }else{
18 $now = time();
19 $time_on_site = $now - $_COOKIE['start_time'];
20 }
21 ?>
22 <!DOCTYPE html>
23 <html lang="en">
24 <head>
25 <meta property="og:url" content="http://md-petition.com/index.php" />
26 <meta property="og:type" content="website" />
27 <meta property="og:title" content="Maryland Electronic Petition Software" />
28 <meta property="og:description" content="Socially Distant Petitions" />
29 <meta property="og:image" content="http://md-petition.com/files/maryland-flag-graphic.png" />
30 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
31 <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
32 <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
33 <link rel="manifest" href="/site.webmanifest">
34 <!-- Global site tag (gtag.js) - Google Analytics -->
35 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-165887820-1"></script>
36 <script>
37 window.dataLayer = window.dataLayer || [];
38 function gtag(){dataLayer.push(arguments);}
39 gtag('js', new Date());
40
41 gtag('config', 'UA-165887820-1');
42 </script>
43 <?PHP
44 include_once('/var/www/secure.php'); //outside webserver
45 presign(); // requires db connection
46 include_once('slack.php');
47 ?>
48 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
49 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
50 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
51 <title>MEPS - Maryland Eletronic Petition Software</title>
52 <style>
53 input:focus {
54 background-color: lightblue;
55 }
56 .click_me{
57 height:50px;
58 width:100px;
59 }
60 .not_me{
61 height:72px;
62 }
63 </style>
64 </head>
65 <body>
66 <div class="container-fluid">
67 <?PHP
68 if ($_COOKIE['invite'] != ''){
69 $invite = $petition->real_escape_string($_COOKIE['invite']);
70 $q = "select * from petitions where web_short_name = '$invite'";
71 $r = $petition->query($q);
72 $d = mysqli_fetch_array($r);
73 echo "<div class='row'><div class='col-sm-10' style='text-align:center;'><h1 style='text-align:center; color:$d[web_color_text]; background-color:$d[web_color];'>$d[petition_name]</h1></div></div>";
74 if ($d['social_phone'] != ''){
75 echo "<div class='row'><div class='col-sm-10' style='text-align:center;'><h3 style='text-align:center; color:$d[web_color_text]; background-color:$d[web_color];'>Support: <a style='color:$d[web_color_text];' href='tel:".$d['social_phone']."'>".$d['social_phone']."</a> <a style='color:$d[web_color_text];' href='mailto:".$d['social_email']."'>".$d['social_email']."</a></h3></div></div>";
76 }
77 if ($d['social_email'] != '' && $d['social_phone'] == ''){
78 echo "<div class='row'><div class='col-sm-10' style='text-align:center;'><h3 style='text-align:center; color:$d[web_color_text]; background-color:$d[web_color];'>Support: <a style='color:$d[web_color_text];' href='mailto:".$d['social_email']."'>".$d['social_email']."</a></h3></div></div>";
79 }
80 }
81 ?>