Commit | Line | Data |
---|---|---|
de92e95d PM |
1 | <?PHP |
2 | include_once('header.php'); | |
3 | if (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); | |
d006306a | 9 | //slack_general('OK POST (invite:'.$_COOKIE['invite'].')','md-petition'); |
beb29022 PM |
10 | }elseif($_COOKIE['pID'] != ''){ |
11 | $id = $_COOKIE['pID']; | |
12 | $q = "select * from petitions where petition_id = '$id'"; | |
13 | $r = $petition->query($q); | |
14 | $d = mysqli_fetch_array($r); | |
d006306a | 15 | //slack_general('OK COOKIE (invite:'.$_COOKIE['invite'].')','md-petition'); |
beb29022 | 16 | }else{ |
d006306a | 17 | slack_general('MAJOR ERROR (invite:'.$_COOKIE['invite'].')','md-petition'); |
63a18eab PM |
18 | header('Location: reset.php'); |
19 | die('Error #15'); | |
de92e95d | 20 | } |
58e477ae | 21 | setcookie("pJPG", $d['petition_jpg']); |
de92e95d | 22 | ?> |
98ce83b3 PM |
23 | <script> |
24 | document.title = "MEPS - Sign <?PHP echo $d['petition_name'];?>"; | |
55a06d6a PM |
25 | $(document).ready(function() { |
26 | $('#myText').keypress(function(event){ | |
27 | if (event.keyCode == 10 || event.keyCode == 13) | |
28 | event.preventDefault(); | |
29 | }); | |
30 | $('#myTextb').keypress(function(event){ | |
31 | if (event.keyCode == 10 || event.keyCode == 13) | |
32 | event.preventDefault(); | |
33 | }); | |
98ce83b3 | 34 | }); |
98ce83b3 | 35 | </script> |
9545d56d PM |
36 | <style> |
37 | @font-face { | |
38 | font-family: "myFirstFont"; | |
32286a4c | 39 | src: url("files/Claston Script.ttf"); |
9545d56d PM |
40 | } |
41 | .sig { | |
42 | font-family: "myFirstFont"; | |
e483b372 | 43 | font-size: 60px; |
9545d56d PM |
44 | } |
45 | </style> | |
beb29022 PM |
46 | <?PHP |
47 | if (isset($_POST['signed_name_as'])){ | |
48 | ?> | |
49 | <script> | |
bff61df6 | 50 | window.scrollTo(0,document.body.scrollHeight); |
b3bdd4cc PM |
51 | $(document).ready(function(){ |
52 | window.scrollTo(0,document.body.scrollHeight); | |
53 | $('#exampleModalLower').modal('show'); | |
beb29022 | 54 | }); |
532fd909 | 55 | function addTextb() |
beb29022 | 56 | { |
532fd909 | 57 | document.getElementById('text2b').innerHTML = document.getElementById('myTextb').value; |
a83d8a01 | 58 | var string = document.getElementById('myTextb').value; |
5b588998 | 59 | var string = string.replace(/ +(?= )/g,''); |
3c9412ec | 60 | var res = string.toUpperCase(); |
5b588998 | 61 | var res = res.replace(/ +(?= )/g,''); |
3c9412ec | 62 | var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); |
a83d8a01 | 63 | if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){ |
82d16fd5 | 64 | document.getElementById("b2").style.display = "block"; |
1b3af1ab | 65 | document.getElementById("b2warn").style.display = "none"; |
cf52aee3 | 66 | document.getElementById("click_me2").style.display = "none"; |
93abfb49 | 67 | document.getElementById("form2").submit(); |
82d16fd5 | 68 | //alert("Confirmed : " + result); |
35fe03d7 PM |
69 | }else{ |
70 | document.getElementById("b2").style.display = "none"; | |
42117833 | 71 | document.getElementById("b2warn").style.display = "block"; |
cf52aee3 | 72 | document.getElementById("click_me2").style.display = "block"; |
a83d8a01 | 73 | } |
beb29022 PM |
74 | } |
75 | </script> | |
76 | <?PHP | |
77 | }else{ | |
78 | ?> | |
56b829ee | 79 | <script> |
3ffbb5c9 PM |
80 | $(document).ready(function(){ |
81 | $('#exampleModalCenter').modal('show'); | |
82 | }); | |
398ca4df PM |
83 | function addText() |
84 | { | |
85 | document.getElementById('text2').innerHTML = document.getElementById('myText').value; | |
a83d8a01 | 86 | var string = document.getElementById('myText').value; |
5b588998 | 87 | var string = string.replace(/ +(?= )/g,''); |
3c9412ec | 88 | var res = string.toUpperCase(); |
5b588998 | 89 | var res = res.replace(/ +(?= )/g,''); |
3c9412ec | 90 | var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); |
a83d8a01 | 91 | if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){ |
82d16fd5 | 92 | document.getElementById("b1").style.display = "block"; |
1b3af1ab | 93 | document.getElementById("b1warn").style.display = "none"; |
cf52aee3 | 94 | document.getElementById("click_me1").style.display = "none"; |
93abfb49 | 95 | document.getElementById("form1").submit(); |
82d16fd5 | 96 | //alert("Confirmed : " + result); |
35fe03d7 PM |
97 | }else{ |
98 | document.getElementById("b1").style.display = "none"; | |
1b3af1ab | 99 | document.getElementById("b1warn").style.display = "block"; |
cf52aee3 | 100 | document.getElementById("click_me1").style.display = "block"; |
a83d8a01 | 101 | } |
398ca4df | 102 | } |
56b829ee | 103 | </script> |
beb29022 PM |
104 | <?PHP |
105 | } | |
106 | ?> | |
162b6ce2 | 107 | |
beb29022 | 108 | <!-- TOP Modal --> |
56b829ee | 109 | <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> |
7f3ed8d1 | 110 | <div class="modal-dialog" role="document"> |
56b829ee PM |
111 | <div class="modal-content"> |
112 | <div class="modal-header"> | |
9632553d | 113 | <h1 class="modal-title" id="exampleModalLongTitle">Type Your Signature to Sign <?PHP echo $d['petition_name'];?></h1> |
beb29022 PM |
114 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
115 | <span aria-hidden="true">×</span> | |
116 | </button> | |
117 | </div> | |
93abfb49 | 118 | <form action='petition.php' method='POST' name='form1' id='form1'> |
beb29022 | 119 | <div class="modal-body"> |
9632553d | 120 | <h2><?PHP echo $d['petition_sign_text_box'];?></h2> |
a759c471 | 121 | <h3><?PHP echo $_COOKIE['pNAME'];?>, Please Sign Here</h3> |
e9c7f2f2 | 122 | |
beb29022 PM |
123 | </div> |
124 | <div class="modal-footer"> | |
e9c7f2f2 | 125 | <h1 id="text2" class="sig"></h1> |
91f3c191 | 126 | <button style='display:none;' id='b1' name='b1' type="submit" class="btn btn-primary btn-lg btn-block"><img class='click_me' src="files/click_here.gif">Sign and Next</button> |
6183a905 | 127 | <button style='display:block;' id='b1warn' name='b1warn' class="btn btn-warning btn-lg btn-block disabled" onclick="alert('Please Type Your Name Exactly as Above');">Please Type Your Name Exactly as Above</button> |
abe8079b | 128 | <table><tr><td><img id='click_me1' name='click_me1' class='click_me' src="files/click_here.gif"></td><td><input class="form-control input-lg" name="signed_name_as" type="text" id="myText" onkeyup="addText()" required autofocus></td></tr></table> |
beb29022 PM |
129 | </div> |
130 | </form> | |
131 | </div> | |
132 | </div> | |
133 | </div> | |
134 | ||
f56ddbd7 | 135 | <!-- Lower Modal --> |
beb29022 | 136 | <div class="modal fade" id="exampleModalLower" tabindex="-1" role="dialog" aria-labelledby="exampleModalLowerTitle" aria-hidden="true"> |
7f3ed8d1 | 137 | <div class="modal-dialog modal-dialog-centered" role="document"> |
beb29022 PM |
138 | <div class="modal-content"> |
139 | <div class="modal-header"> | |
9632553d | 140 | <h1 class="modal-title" id="exampleModalLongTitleLower">Type Your Signature to Sign as Circulator</h1> |
56b829ee PM |
141 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
142 | <span aria-hidden="true">×</span> | |
143 | </button> | |
144 | </div> | |
5257a853 | 145 | <form action='presign.php' method='POST' name='form2' id='form2'><input type='hidden' value='<?PHP echo $_POST['signed_name_as'];?>' name='signed_name_as'> |
dab6c4a9 | 146 | <div class="modal-body"> |
9632553d | 147 | <h2><?PHP echo $d['petition_circulator_text_box'];?></h2> |
a759c471 | 148 | <h3><?PHP echo $_COOKIE['pNAME'];?>, Please Sign Here</h3> |
dab6c4a9 PM |
149 | </div> |
150 | <div class="modal-footer"> | |
cbae90ff | 151 | <h1 id="text2b" class="sig"></h1> |
91f3c191 | 152 | <button style='display:none;' id='b2' name='b2' type="submit" class="btn btn-primary btn-lg btn-block"><img class='click_me' src="files/click_here.gif">Sign and Submit</button> |
6183a905 | 153 | <button style='display:block;' id='b2warn' name='b1warn' class="btn btn-warning btn-lg btn-block disabled" onclick="alert('Please Type Your Name Exactly as Above');">Please Type Your Name Exactly as Above</button> |
abe8079b | 154 | <table><tr><td><img id='click_me2' name='click_me2' class='click_me' src="files/click_here.gif"></td><td><input class="form-control input-lg" name="signed_name_as_circulator" type="text" id="myTextb" onkeyup="addTextb()" required autofocus></td></tr></table> |
dab6c4a9 PM |
155 | </div> |
156 | </form> | |
56b829ee PM |
157 | </div> |
158 | </div> | |
159 | </div> | |
beb29022 | 160 | |
5f7975e1 | 161 | <div class='col-sm-12'><img class="img-responsive" src='hard_copy.php'></div> |
36529d15 PM |
162 | <?PHP if ($d['petition_jpg_page2'] != ''){ ?> |
163 | <div class='col-sm-12'><img class="img-responsive" src='<?PHP echo $d['petition_jpg_page2'];?>'></div> | |
164 | <?PHP } ?> | |
63a18eab PM |
165 | <?PHP |
166 | if(isset($_POST['signed_name_as'])){ | |
d006306a | 167 | slack_general('*Step 2* ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition'); |
4140020b | 168 | }else{ |
d006306a | 169 | slack_general('*Step 1* ('.$d['petition_name'].') ('.$_COOKIE['invite'].')','md-petition'); |
63a18eab PM |
170 | } |
171 | include_once('footer.php'); |