Update petitions.php
[clinton/MarylandElectronicPetitionSignature.git] / invite / mgp.php
CommitLineData
2ed049b9 1<?PHP
40ad64bc 2setcookie("invite", "mgp", time()+3600, "/"); // we use this later
1b157720
PM
3?>
4<!DOCTYPE html>
5<html lang="en">
6<head>
7 <!-- Global site tag (gtag.js) - Google Analytics -->
8 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-165887820-1"></script>
9 <script>
10 window.dataLayer = window.dataLayer || [];
11 function gtag(){dataLayer.push(arguments);}
12 gtag('js', new Date());
13
14 gtag('config', 'UA-165887820-1');
15 </script>
16 <?PHP
17 include_once('/var/www/secure.php'); //outside webserver
18 $q = "select * from petitions where petition_id = '1'";
19 $r = $petition->query($q);
20 $d = mysqli_fetch_array($r);
10f8df8c 21 include_once('../slack.php');
1b157720
PM
22 ?>
23 <meta property="og:url" content="http://md-petition.com/invite/mgp.php" />
24 <meta property="og:type" content="website" />
25 <meta property="og:title" content="<?PHP echo $d['tab_name'];?>" />
26 <meta property="og:description" content="Maryland Electronic Petition Software - Socially Distant Petitions" />
27 <meta property="og:image" content="<?PHP echo $d['logo_url'];?>" />
28 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
29 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
30 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
31 <title><?PHP echo $d['tab_name'];?></title>
32</head>
10f8df8c 33<body style='background-color:<?PHP echo $d['web_color'];?>;'>
1b157720
PM
34<div class="container-fluid">
35<?PHP
2ed049b9 36slack_general('MGP Home Page Loaded ('.$_COOKIE['invite'].')','md-petition');
2ed049b9 37?>
1b157720 38
2ed049b9
PM
39<div class='row'>
40 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $d['text_title'];?></h1><h2><?PHP echo $d['text_block'];?></h2></div>
41 </div>
42<div class='row'>
46ca7ade 43 <div class='col-sm-10' style='text-align:center;'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='../enter_information.php'">SIGN <?PHP echo $d['petition_name'];?></button></div>
2ed049b9 44 </div>
10f8df8c
PM
45
46 <div class='row'>
47 <div class='col-sm-10' style='text-align:center;'> <img class="img-responsive" alt="<?PHP echo $d['text_title'];?>" src="<?PHP echo $d['logo_url'];?>"></div>
48 </div>
49
2ed049b9
PM
50<div id="fb-root"></div>
51 <script>(function(d, s, id) {
52 var js, fjs = d.getElementsByTagName(s)[0];
53 if (d.getElementById(id)) return;
54 js = d.createElement(s); js.id = id;
55 js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
56 fjs.parentNode.insertBefore(js, fjs);
57 }(document, 'script', 'facebook-jssdk'));</script>
58
c441ee62
PM
59 <script>
60 function myFunction(short_code) {
61 /* Get the text field */
62 var copyText = document.getElementById(short_code);
63
64 /* Select the text field */
65 copyText.select();
66 copyText.setSelectionRange(0, 99999); /*For mobile devices*/
67
68 /* Copy the text inside the text field */
69 document.execCommand("copy");
70
71 /* Alert the copied text */
72 alert("Copied the Link: " + copyText.value);
73}
74</script>
75
2ed049b9
PM
76 <center>
77 <table border="1" cellpadding="2" cellspacing="0">
78 <?PHP
79 $q2 = "SELECT * FROM petitions where web_short_name = 'mgp'";
80 $r2 = $petition->query($q2);
81 while($d2 = mysqli_fetch_array($r2)){
82 echo "<tr>
83 <td align='center'><small>$d2[petition_name]<small></td>
84 <td><div class=\"fb-share-button\"
85 data-href=\"http://md-petition.com/invite/mgp.php\"
86 data-layout=\"box_count\" data-size=\"large\">
87 </div></td>
88 <td><input type='text' size='50' value='http://md-petition.com/invite/mgp.php' id='$d2[web_short_name]'><button onclick='myFunction(\"$d2[web_short_name]\")'>Copy Link</button></td>
89 </tr>";
90 }
91 ?>
92 </table>
93</center>
94
95
96
97<?PHP
98$copy = '&copy; 2020 Patrick McGuire';
2ed049b9
PM
99?>
100<div class='row'>
101 <div class='col-sm-10' style='text-align:center;'><?PHP echo $copy;?></div>
102</div>
557d2041
PM
103
104 <div class='row'>
105 <div class='col-sm-10' style='text-align:center;'>
106 <?PHP if($_COOKIE['debug'] == 'on'){ ?>
107 <pre><?PHP print_r($_GET); ?></pre>
108 <pre><?PHP print_r($_POST); ?></pre>
109 <pre><?PHP print_r($_COOKIE); ?></pre>
110 <?PHP } ?>
111 </div>
112</div>
113