Add files via upload
[clinton/MarylandElectronicPetitionSignature.git] / petition.php
... / ...
CommitLineData
1<?PHP
2include_once('header.php');
3if (isset($_POST['petition'])){
4 $id = $_POST['petition'];
5 setcookie("pID", $id);
6 $q = "select * from petitions where petition_id = '$id'";
7 $r = $petition->query($q);
8 $d = mysqli_fetch_array($r);
9}elseif($_COOKIE['pID'] != ''){
10 $id = $_COOKIE['pID'];
11 $q = "select * from petitions where petition_id = '$id'";
12 $r = $petition->query($q);
13 $d = mysqli_fetch_array($r);
14}else{
15 slack_general('MAJOR ERROR: petition.php ('.$_COOKIE['invite'].')','md-petition');
16 header('Location: reset.php');
17 die('Error #15');
18}
19setcookie("pJPG", $d['petition_jpg']);
20?>
21<script>document.title = "MEPS - Sign <?PHP echo $d['petition_name'];?>";</script>
22<style>
23@font-face {
24 font-family: "myFirstFont";
25 src: url("files/Claston Script.ttf");
26}
27.sig {
28 font-family: "myFirstFont";
29 font-size: 60px;
30}
31</style>
32<?PHP
33if (isset($_POST['signed_name_as'])){
34?>
35<script>
36 window.scrollTo(0,document.body.scrollHeight);
37 $(document).ready(function(){
38 window.scrollTo(0,document.body.scrollHeight);
39 $('#exampleModalLower').modal('show');
40 });
41 function addTextb()
42 {
43 document.getElementById('text2b').innerHTML = document.getElementById('myTextb').value;
44 }
45</script>
46<?PHP
47}else{
48?>
49<script>
50 $(document).ready(function(){
51 $('#exampleModalCenter').modal('show');
52 });
53 function addText()
54 {
55 document.getElementById('text2').innerHTML = document.getElementById('myText').value;
56 }
57</script>
58<?PHP
59}
60?>
61
62<!-- TOP Modal -->
63<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
64 <div class="modal-dialog" role="document">
65 <div class="modal-content">
66 <div class="modal-header">
67 <h1 class="modal-title" id="exampleModalLongTitle">Type Your Signature to Sign <?PHP echo $d['petition_name'];?></h1>
68 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
69 <span aria-hidden="true">&times;</span>
70 </button>
71 </div>
72 <form action='petition.php' method='POST'>
73 <div class="modal-body">
74 <h2><?PHP echo $d['petition_sign_text_box'];?></h2>
75 <input class="form-control input-lg" name="signed_name_as" type="text" id="myText" onkeyup="addText()" required>
76 <h1 id="text2" class="sig"></h1>
77 </div>
78 <div class="modal-footer">
79 <button type="submit" class="btn btn-primary btn-lg btn-block">Sign and Next</button>
80 </div>
81 </form>
82 </div>
83 </div>
84</div>
85
86<!-- Lower Modal -->
87<div class="modal fade" id="exampleModalLower" tabindex="-1" role="dialog" aria-labelledby="exampleModalLowerTitle" aria-hidden="true">
88 <div class="modal-dialog modal-dialog-centered" role="document">
89 <div class="modal-content">
90 <div class="modal-header">
91 <h1 class="modal-title" id="exampleModalLongTitleLower">Type Your Signature to Sign as Circulator</h1>
92 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
93 <span aria-hidden="true">&times;</span>
94 </button>
95 </div>
96 <form action='sign.php' method='POST'><input type='hidden' value='<?PHP echo $_POST['signed_name_as'];?>' name='signed_name_as'>
97 <div class="modal-body">
98 <h2><?PHP echo $d['petition_circulator_text_box'];?></h2>
99 <input class="form-control input-lg" name="signed_name_as_circulator" type="text" id="myTextb" onkeyup="addTextb()" required>
100 <h1 id="text2b" class="sig"></h1>
101 </div>
102 <div class="modal-footer">
103 <button type="submit" class="btn btn-primary btn-lg btn-block">Sign and Submit</button>
104 </div>
105 </form>
106 </div>
107 </div>
108</div>
109
110<div class='col-sm-12'><img class="img-responsive" src='hard_copy.php'></div>
111
112
113<?PHP
114if(isset($_POST['signed_name_as'])){
115 slack_general('petition.php ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');
116}else{
117 slack_general('petition.php ('.$d['petition_name'].') ('.$_COOKIE['invite'].')','md-petition');
118}
119include_once('footer.php');