Update eligible.php
[clinton/MarylandElectronicPetitionSignature.git] / petition.php
index effa0c5..06cbc08 100644 (file)
@@ -20,7 +20,19 @@ if (isset($_POST['petition'])){
 }
 setcookie("pJPG", $d['petition_jpg']);
 ?>
-<script>document.title = "MEPS - Sign <?PHP echo $d['petition_name'];?>";</script>
+<script>
+  document.title = "MEPS - Sign <?PHP echo $d['petition_name'];?>";
+$(document).ready(function() {
+  $('#myText').keypress(function(event){
+    if (event.keyCode == 10 || event.keyCode == 13) 
+        event.preventDefault();
+  });
+  $('#myTextb').keypress(function(event){
+    if (event.keyCode == 10 || event.keyCode == 13) 
+        event.preventDefault();
+  });
+});
+</script>
 <style>
 @font-face {
     font-family: "myFirstFont";
@@ -48,9 +60,13 @@ if (isset($_POST['signed_name_as'])){
       var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); 
       if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){
             document.getElementById("b2").style.display = "block";
+            document.getElementById("b2warn").style.display = "none";
+            document.getElementById("click_me2").style.display = "none";
             //alert("Confirmed : " + result); 
       }else{
             document.getElementById("b2").style.display = "none";
+            document.getElementById("b2warn").style.display = "block";
+            document.getElementById("click_me2").style.display = "block";
       }
   }
 </script>
@@ -69,9 +85,13 @@ if (isset($_POST['signed_name_as'])){
       var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i);
       if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){
             document.getElementById("b1").style.display = "block";
+            document.getElementById("b1warn").style.display = "none";
+            document.getElementById("click_me1").style.display = "none";
             //alert("Confirmed : " + result); 
       }else{
             document.getElementById("b1").style.display = "none";
+            document.getElementById("b1warn").style.display = "block";
+            document.getElementById("click_me1").style.display = "block";
       }
   }
 </script>
@@ -97,8 +117,9 @@ if (isset($_POST['signed_name_as'])){
         </div>
         <div class="modal-footer">
           <h1 id="text2" class="sig"></h1>
-          <button <?PHP if ($d['eligibleVoterSigMatch'] == 'YES' ){ echo "style='display:none;'"; } ?> id='b1' name='b1' type="submit" class="btn btn-primary btn-lg btn-block">Sign and Next</button>
-          <input class="form-control input-lg" name="signed_name_as" type="text" id="myText" onkeyup="addText()" required>
+          <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>
+          <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>
+          <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>
         </div>
       </form>
     </div>
@@ -122,8 +143,9 @@ if (isset($_POST['signed_name_as'])){
         </div>
         <div class="modal-footer">
           <h1 id="text2b" class="sig"></h1>
-          <button <?PHP if ($d['eligibleVoterSigMatch'] == 'YES' ){ echo "style='display:none;'"; } ?> id='b2' name='b2' type="submit" class="btn btn-primary btn-lg btn-block">Sign and Submit</button>
-          <input class="form-control input-lg" name="signed_name_as_circulator" type="text" id="myTextb" onkeyup="addTextb()" required>
+          <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>
+          <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>
+          <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>
         </div>
       </form>
     </div>
@@ -131,8 +153,9 @@ if (isset($_POST['signed_name_as'])){
 </div>
 
 <div class='col-sm-12'><img class="img-responsive" src='hard_copy.php'></div>
-
-
+<?PHP if ($d['petition_jpg_page2'] != ''){ ?>
+  <div class='col-sm-12'><img class="img-responsive" src='<?PHP echo $d['petition_jpg_page2'];?>'></div>
+<?PHP } ?>
 <?PHP 
 if(isset($_POST['signed_name_as'])){
  slack_general('petition.php ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');