Add files via upload
[clinton/MarylandElectronicPetitionSignature.git] / index.php
CommitLineData
f32310b2 1<?PHP
f32310b2
PM
2if (isset($_GET['invite'])){
3 setcookie("invite", $_GET['invite']);
feaa6e5f 4 header('Location: index.php');
f32310b2 5}
bab8daf2
PM
6$title = 'MEPS - Are you Registered?';
7if ($_COOKIE['invite'] != ''){
5534ce2d 8 $title = 'MEPS ('.strtoupper($_COOKIE['invite']).') - Are you Registered?';
bab8daf2 9}
feaa6e5f 10include_once('header.php');
2875b9d0 11slack_general('Home Page Loaded ('.$_COOKIE['invite'].')','md-petition');
a0b7fc69
PM
12 $q = "select * from website_text where id = '1'";
13 $r = $petition->query($q);
14 $d = mysqli_fetch_array($r);
f32310b2 15?>
b7072979
PM
16<script>document.title = "<?PHP echo $title;?>";</script>
17<div class='row'>
5747852d 18 <div class='col-sm-10' style='text-align:center;'><h1><?PHP echo $d['text_title'];?></h1><h2><?PHP echo $d['text_block'];?></h2></div>
b7072979
PM
19 </div>
20<div class='row'>
d3f93ecf 21 <div class='col-sm-5' style='text-align:center;'><button type="button" class="btn btn-success btn-lg btn-block" onclick="window.location.href='enter_information.php'"><img class='click_me' src="files/click_here.gif">YES - CLICK HERE TO BEGIN</button></div>
47e467c4 22 <div class='col-sm-5' style='text-align:center;'><button type="button" class="btn btn-danger btn-lg btn-block not_me" onclick="window.location.href='not_a_registered_voter.php'">NO</button></div>
b7072979 23 </div>
205df2bf
PM
24
25<div class='row'>
1de4a5c3 26 <div class='col-sm-10' style='text-align:center;'><br><br><br><h3>We are hosting the following petitions: </h3>
205df2bf 27 <?PHP
1de4a5c3 28 $q2 = "SELECT * FROM petitions where admin_status = 'approved' order by RAND()";
205df2bf
PM
29 $r2 = $petition->query($q2);
30 while($d2 = mysqli_fetch_array($r2)){
31 $link = "?invite=$d2[web_short_name]";
32 if ($d2['landing_page'] != ''){
33 $link = $d2['landing_page'];
34 }
b5e88d92 35 echo " <button class='$d2[web_short_name]' style='color:$d2[web_color_text]; background-color:$d2[web_color]; border: solid 1px black; padding:5px;'>$d2[petition_name]</button>
d9265840
PM
36 <script>
37 $('.$d2[web_short_name]').click(function() {
38 location.href = 'https://www.md-petition.com/$link';
39 });
40 </script>";
205df2bf
PM
41 }
42 ?>
43 </div>
44</div>
45
3a445767
PM
46<?PHP
47include_once('footer.php');