Update petition.php
[clinton/MarylandElectronicPetitionSignature.git] / petition.php
index f594e58..3f6773e 100644 (file)
@@ -6,11 +6,13 @@ if (isset($_POST['petition'])){
   $q = "select * from petitions where petition_id = '$id'";
   $r = $petition->query($q);
   $d = mysqli_fetch_array($r);
+  slack_general('OK POST: petition.php ('.$_COOKIE['invite'].')','md-petition');
 }elseif($_COOKIE['pID'] != ''){
   $id = $_COOKIE['pID'];
   $q = "select * from petitions where petition_id = '$id'";
   $r = $petition->query($q);
   $d = mysqli_fetch_array($r);
+  slack_general('OK COOKIE: petition.php ('.$_COOKIE['invite'].')','md-petition');
 }else{
   slack_general('MAJOR ERROR: petition.php ('.$_COOKIE['invite'].')','md-petition');
   header('Location: reset.php');
@@ -26,8 +28,21 @@ setcookie("pJPG", $d['petition_jpg']);
 }
 .sig {
     font-family: "myFirstFont";
+    font-size: 60px;
 }
 </style>
+<script>
+function matchString1() { 
+        var string = document.getElementById('myText').value; 
+        var result = string.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); 
+        alert("Confirmed : " + result); 
+} 
+function matchString2() { 
+        var string = document.getElementById('myTextb').value; 
+        var result = string.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); 
+        alert("Confirmed : " + result); 
+}  
+</script>
 <?PHP
 if (isset($_POST['signed_name_as'])){
 ?>
@@ -40,6 +55,7 @@ if (isset($_POST['signed_name_as'])){
   function addTextb()
   {
       document.getElementById('text2b').innerHTML = document.getElementById('myTextb').value;
+      matchString2();
   }
 </script>
 <?PHP
@@ -52,6 +68,7 @@ if (isset($_POST['signed_name_as'])){
   function addText()
   {
       document.getElementById('text2').innerHTML = document.getElementById('myText').value;
+      matchString1();
   }
 </script>
 <?PHP
@@ -111,6 +128,8 @@ if (isset($_POST['signed_name_as'])){
 
 <?PHP 
 if(isset($_POST['signed_name_as'])){
- slack_general('petition.php ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');
+ slack_general('petition.php ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');
+}else{
+ slack_general('petition.php ('.$d['petition_name'].') ('.$_COOKIE['invite'].')','md-petition'); 
 }
 include_once('footer.php');