adjusting week bit template values
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Apr 2016 17:15:44 +0000 (13:15 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 21 Apr 2016 17:15:44 +0000 (13:15 -0400)
models/front/events/frontAdd.php
views/front/events/frontAdd.html

index c1ed41e..6f8734f 100644 (file)
@@ -91,8 +91,8 @@ 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']) && strlen($_REQUEST['emin']) == 0){
-                 $startTimeOnly = true;
+             if(empty($_REQUEST['ehour']) || empty($_REQUEST['emin']) && strlen($_REQUEST['emin']) === 0){
+                 $startTimeOnly = 1;
                  $emilitaryTime = "12:00:00";
              } else {
             
@@ -101,25 +101,21 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
              }
              
              
-             if(empty($_REQUEST['shour']) || empty($_REQUEST['smin']) && strlen($_REQUEST['emin']) == 0){
+             if(empty($_REQUEST['shour']) || empty($_REQUEST['smin']) && strlen($_REQUEST['smin']) === 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));
 
                  $smilitaryTime = date("H:i:s", strtotime($startTime));
              }
  
              
-             if(empty($_REQUEST['shour']) || empty($_REQUEST['smin']) && empty($_REQUEST['ehour']) || empty($_REQUEST['emin'])){
+             if(empty($_REQUEST['shour'])  && empty($_REQUEST['ehour'])){
                  $allDay = true;
-                 $startTimeOnly = false;
+                 $startTimeOnly = 0;
              }
-             
-             
-             
-             
+                         
              $starting_date = strtotime($starting . " " . $smilitaryTime);
              $mysqlStart = date("Y-m-d H:i:s",$starting_date);
              
@@ -151,8 +147,9 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents
              $fileDescr = trim(filter_var($_REQUEST['fileDescription'],FILTER_SANITIZE_STRING));
 
              $weekOfMonth = $_REQUEST['weekom'];
-             $weekOfMonth = pow(2, $weekOfMonth);
-             
+             if(strlen($weekOfMonth) !== 0){
+                 $weekOfMonth = pow(2, $weekOfMonth);
+             }
              $category = $_REQUEST['categories'];
 
              // set boolean values based on selected recurrence options
index 46d6e21..f123aee 100644 (file)
             <td>
                 <select name="weekom" id="weeklyRepeat">
                     <option value="">Select</option>
-                    <option value="1">Every First Week of Month</option><option value="2">Every Second Week of Month</option><option value="3">Every Third Week of Month</option><option value="4">Every Fourth Week of Month</option><option value="5">Every Fifth Week of Month</option> <option value="6">Every Last Week of Month</option> 
+                    <option value="0">Every First Week of Month</option><option value="1">Every Second Week of Month</option><option value="2">Every Third Week of Month</option><option value="3">Every Fourth Week of Month</option><option value="4">Every Fifth Week of Month</option> <option value="5">Every Last Week of Month</option> 
                 </select>
             </td>
         </tr>