// 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 {
}
- 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);
$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
<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>