Update analytics.php
[clinton/MarylandElectronicPetitionSignature.git] / petition.php
index 158eaaa..657e97f 100644 (file)
@@ -6,15 +6,15 @@ 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');
+  //slack_general('OK POST (invite:'.$_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');
+  //slack_general('OK COOKIE (invite:'.$_COOKIE['invite'].')','md-petition');
 }else{
-  slack_general('MAJOR ERROR: petition.php ('.$_COOKIE['invite'].')','md-petition');
+  slack_general('MAJOR ERROR (invite:'.$_COOKIE['invite'].')','md-petition');
   header('Location: reset.php');
   die('Error #15'); 
 }
@@ -56,7 +56,9 @@ if (isset($_POST['signed_name_as'])){
   {
       document.getElementById('text2b').innerHTML = document.getElementById('myTextb').value;
       var string = document.getElementById('myTextb').value; 
+      var string = string.replace(/ +(?= )/g,'');
       var res = string.toUpperCase();
+      var res = res.replace(/ +(?= )/g,'');
       var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i); 
       if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){
             document.getElementById("b2").style.display = "block";
@@ -82,7 +84,9 @@ if (isset($_POST['signed_name_as'])){
   {
       document.getElementById('text2').innerHTML = document.getElementById('myText').value;
       var string = document.getElementById('myText').value; 
+      var string = string.replace(/ +(?= )/g,'');
       var res = string.toUpperCase();
+      var res = res.replace(/ +(?= )/g,'');
       var result = res.match(/<?PHP echo $_COOKIE['pNAME'];?>/i);
       if (result == "<?PHP echo $_COOKIE['pNAME'];?>"){
             document.getElementById("b1").style.display = "block";
@@ -138,7 +142,7 @@ if (isset($_POST['signed_name_as'])){
           <span aria-hidden="true">&times;</span>
         </button>
       </div>
-      <form action='sign.php' method='POST' name='form2' id='form2'><input type='hidden' value='<?PHP echo $_POST['signed_name_as'];?>' name='signed_name_as'>
+      <form action='presign.php' method='POST' name='form2' id='form2'><input type='hidden' value='<?PHP echo $_POST['signed_name_as'];?>' name='signed_name_as'>
         <div class="modal-body">
           <h2><?PHP echo $d['petition_circulator_text_box'];?></h2>
           <h3><?PHP echo $_COOKIE['pNAME'];?>, Please Sign Here</h3>
@@ -160,8 +164,8 @@ if (isset($_POST['signed_name_as'])){
 <?PHP } ?>
 <?PHP 
 if(isset($_POST['signed_name_as'])){
- slack_general('petition.php ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');
+ slack_general('*Step 2* ('.$d['petition_name'].') ('.$_POST['signed_name_as'].') ('.$_COOKIE['invite'].')','md-petition');
 }else{
- slack_general('petition.php ('.$d['petition_name'].') ('.$_COOKIE['invite'].')','md-petition'); 
+ slack_general('*Step 1* ('.$d['petition_name'].') ('.$_COOKIE['invite'].')','md-petition'); 
 }
 include_once('footer.php');