removed echo statements and changed time value conditionals, php recognizes 0 as...
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Apr 2016 14:15:39 +0000 (10:15 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Apr 2016 14:15:39 +0000 (10:15 -0400)
models/front/events/frontAdd.php
views/front/events/frontAdd.html

index 5f69d45..c1ed41e 100644 (file)
@@ -91,27 +91,30 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
              
              
              // if there are no times selected, default the start time to midnight and the endtime to 12:00pm as it is in the admin 
-             if(empty($_REQUEST['ehour']) || empty($_REQUEST['emin'])){
+             if(empty($_REQUEST['ehour']) || empty($_REQUEST['emin']) && strlen($_REQUEST['emin']) == 0){
                  $startTimeOnly = true;
                  $emilitaryTime = "12:00:00";
              } else {
+            
                  $endTime = trim(filter_var($_REQUEST['ehour'],FILTER_SANITIZE_STRING)) . ':' . trim(filter_var($_REQUEST['emin'],FILTER_SANITIZE_STRING)) . " " . trim(filter_var($_REQUEST['eampm'],FILTER_SANITIZE_STRING));
-             
                  $emilitaryTime = date("H:i:s", strtotime($endTime));
              }
              
              
-             if(empty($_REQUEST['shour']) || empty($_REQUEST['smin'])){
+             if(empty($_REQUEST['shour']) || empty($_REQUEST['smin']) && strlen($_REQUEST['emin']) == 0){
                  $smilitaryTime = "12:00:00";
              } else {
-                 $startTime = trim(filter_var($_REQUEST['shour'],FILTER_SANITIZE_STRING)) . ':' . trim(filter_var($_REQUEST['smin'],FILTER_SANITIZE_STRING)) . " " . trim(filter_var($_REQUEST['sampm'],FILTER_SANITIZE_STRING));
                  
+             
+                 $startTime = trim(filter_var($_REQUEST['shour'],FILTER_SANITIZE_STRING)) . ':' . trim(filter_var($_REQUEST['smin'],FILTER_SANITIZE_STRING)) . " " . trim(filter_var($_REQUEST['sampm'],FILTER_SANITIZE_STRING));
+
                  $smilitaryTime = date("H:i:s", strtotime($startTime));
              }
  
              
              if(empty($_REQUEST['shour']) || empty($_REQUEST['smin']) && empty($_REQUEST['ehour']) || empty($_REQUEST['emin'])){
                  $allDay = true;
+                 $startTimeOnly = false;
              }
              
              
@@ -148,7 +151,7 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
              $fileDescr = trim(filter_var($_REQUEST['fileDescription'],FILTER_SANITIZE_STRING));
 
              $weekOfMonth = $_REQUEST['weekom'];
-             $weekofMonth = pow(2, $weekOfMonth);
+             $weekOfMonth = pow(2, $weekOfMonth);
              
              $category = $_REQUEST['categories'];
 
@@ -172,10 +175,8 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
              }
              if(empty($_REQUEST['allday'])){
                  $allDay = false;
-//                 $startTimeOnly = false;
              } else {
                  $allDay = $_REQUEST['allday'];
-//                 $startTimeOnly = true;
              }
              
              //get days of the week values for recurrences
@@ -264,7 +265,6 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
                             'admin_email'       => $adminEmail,
                             'contact_name'      => $contactFirst . " " . $contactLast,
                             'contact_email'     => $contactEmail,
-                            'contact_email'     => $contactPhone,
                             'admin_org'         => $admin_org
                         );
             $this->wpdb->insert(
@@ -289,7 +289,6 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
                              '%s',
                              '%s',
                              '%s',
-                             '%s',
                              '%s'
                         )
                     );   
index d5d2907..46d6e21 100644 (file)
@@ -48,7 +48,7 @@
                 <option value="12">12</option>
         </select>&nbsp;:&nbsp;<select class="timeDropDown glm-required" name="smin">
                 <option value="">Minute</option>
-                <option value="0">00</option>
+                <option value="00">00</option>
                 <option value="15">15</option>
                 <option value="30">30</option>
                 <option value="45">45</option>
@@ -78,7 +78,7 @@
                 <option value="12">12</option>
         </select>&nbsp;:&nbsp;<select class="timeDropDown" name="emin">
                 <option value="">Minute</option>
-                <option value="0">00</option>
+                <option value="00">00</option>
                 <option value="15">15</option>
                 <option value="30">30</option>
                 <option value="45">45</option>