Create enter_information_v3.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 if (isset($_GET['form_version'])){
14 if ($_GET['form_version'] == '2'){
15 setcookie("form_version", '2');
16 }
17 }
18 global $time_on_site;
19 if (empty($_COOKIE['start_time'])){
20 setcookie("start_time", time());
21 $time_on_site = 0;
22 }else{
23 $now = time();
24 $time_on_site = $now - $_COOKIE['start_time'];
25 }
26 ?>
27 <!DOCTYPE html>
28 <html lang="en">
29 <head>
30 <meta property="og:url" content="https://www.md-petition.com/index.php" />
31 <meta property="og:type" content="website" />
32 <meta property="og:title" content="Maryland Electronic Petition Software" />
33 <meta property="og:description" content="Socially Distant Petitions" />
34 <meta property="fb:app_id" content="3170466243046869" />
35 <meta property="og:image" content="http://www.md-petition.com/files/maryland-flag-graphic.png" />
36 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
37 <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
38 <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
39 <link rel="manifest" href="/site.webmanifest">
40
41 <script>
42 window.fbAsyncInit = function() {
43 FB.init({
44 appId : '3170466243046869',
45 cookie : true,
46 xfbml : true,
47 version : 'v7.0'
48 });
49
50 FB.AppEvents.logPageView();
51
52 };
53
54 (function(d, s, id){
55 var js, fjs = d.getElementsByTagName(s)[0];
56 if (d.getElementById(id)) {return;}
57 js = d.createElement(s); js.id = id;
58 js.src = "https://connect.facebook.net/en_US/sdk.js";
59 fjs.parentNode.insertBefore(js, fjs);
60 }(document, 'script', 'facebook-jssdk'));
61 </script>
62
63 <!-- Global site tag (gtag.js) - Google Analytics -->
64 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-165887820-1"></script>
65 <script>
66 window.dataLayer = window.dataLayer || [];
67 function gtag(){dataLayer.push(arguments);}
68 gtag('js', new Date());
69
70 gtag('config', 'UA-165887820-1');
71 </script>
72 <?PHP
73 include_once('/var/www/secure.php'); //outside webserver
74 presign(); // requires db connection
75 include_once('slack.php');
76 ?>
77 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
78 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
79 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
80 <title>MEPS - Maryland Eletronic Petition Software</title>
81 <style>
82 input:focus {
83 background-color: lightblue;
84 }
85 .click_me{
86 height:50px;
87 width:100px;
88 }
89 .not_me{
90 height:72px;
91 }
92 </style>
93 </head>
94 <body>
95 <div class="container-fluid">
96 <?PHP
97 if ($_COOKIE['invite'] != ''){
98 $invite = $petition->real_escape_string($_COOKIE['invite']);
99 $q = "select * from petitions where web_short_name = '$invite'";
100 $r = $petition->query($q);
101 $d = mysqli_fetch_array($r);
102 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>";
103 if ($d['social_phone'] != ''){
104 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>";
105 }
106 if ($d['social_email'] != '' && $d['social_phone'] == ''){
107 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>";
108 }
109 }
110 ?>