Update petition.php
[clinton/MarylandElectronicPetitionSignature.git] / petition.php
CommitLineData
de92e95d
PM
1<?PHP
2include_once('header.php');
3if (isset($_POST['petition'])){
4 $id = $_POST['petition'];
70e2de61 5 setcookie("pID", $id);
de92e95d
PM
6 $q = "select * from petitions where petition_id = '$id'";
7 $r = $petition->query($q);
8 $d = mysqli_fetch_array($r);
beb29022
PM
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 die('Error #15');
de92e95d
PM
16}
17?>
9545d56d
PM
18<style>
19@font-face {
20 font-family: "myFirstFont";
32286a4c 21 src: url("files/Claston Script.ttf");
9545d56d
PM
22}
23.sig {
24 font-family: "myFirstFont";
8e6694a5 25 font-size: 40px;
9545d56d
PM
26}
27</style>
beb29022
PM
28<?PHP
29if (isset($_POST['signed_name_as'])){
30?>
31<script>
32 $(document).ready(function(){
33 $('#exampleModalLower').modal('show');
34 });
35 function addText()
36 {
37 document.getElementById('text2').innerHTML = document.getElementById('myText').value;
38 }
39</script>
40<?PHP
41}else{
42?>
56b829ee 43<script>
3ffbb5c9
PM
44 $(document).ready(function(){
45 $('#exampleModalCenter').modal('show');
46 });
398ca4df
PM
47 function addText()
48 {
49 document.getElementById('text2').innerHTML = document.getElementById('myText').value;
50 }
56b829ee 51</script>
beb29022
PM
52<?PHP
53}
54?>
162b6ce2 55
beb29022 56<!-- TOP Modal -->
56b829ee
PM
57<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
58 <div class="modal-dialog modal-dialog-centered" role="document">
59 <div class="modal-content">
60 <div class="modal-header">
beb29022
PM
61 <h5 class="modal-title" id="exampleModalLongTitle">Type Your Signature to Sign Petition</h5>
62 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
63 <span aria-hidden="true">&times;</span>
64 </button>
65 </div>
66 <form action='petition.php' method='POST'>
67 <div class="modal-body">
68 <input name="signed_name_as" type="text" id="myText" onkeyup="addText()">
69 <div id="text2" class="sig"></div>
70 </div>
71 <div class="modal-footer">
72 <button type="submit" class="btn btn-primary">Sign and Next</button>
73 </div>
74 </form>
75 </div>
76 </div>
77</div>
78
79<!-- TOP Modal -->
80<div class="modal fade" id="exampleModalLower" tabindex="-1" role="dialog" aria-labelledby="exampleModalLowerTitle" aria-hidden="true">
81 <div class="modal-dialog" role="document">
82 <div class="modal-content">
83 <div class="modal-header">
84 <h5 class="modal-title" id="exampleModalLongTitle">Type Your Signature to Sign as Circulator</h5>
56b829ee
PM
85 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
86 <span aria-hidden="true">&times;</span>
87 </button>
88 </div>
dab6c4a9
PM
89 <form action='sign.php' method='POST'>
90 <div class="modal-body">
f84ade02 91 <input name="signed_name_as" type="text" id="myText" onkeyup="addText()">
dab6c4a9
PM
92 <div id="text2" class="sig"></div>
93 </div>
94 <div class="modal-footer">
95 <button type="submit" class="btn btn-primary">Sign and Submit</button>
96 </div>
97 </form>
56b829ee
PM
98 </div>
99 </div>
100</div>
beb29022 101
5f7975e1 102<div class='col-sm-12'><img class="img-responsive" src='hard_copy.php'></div>
162b6ce2 103
162b6ce2 104
1fb7899f 105<?PHP include_once('footer.php');