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