|
@@ 2540-2554 (lines=15) @@
|
| 2537 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2538 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2539 |
|
|
| 2540 |
|
if (empty($name)) { |
| 2541 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2542 |
|
return $msg; |
| 2543 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2544 |
|
$msg = get_lang('InvalidStartDate'); |
| 2545 |
|
return $msg; |
| 2546 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2547 |
|
$date_end = "null"; |
| 2548 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2549 |
|
$msg = get_lang('InvalidEndDate'); |
| 2550 |
|
return $msg; |
| 2551 |
|
} elseif ($date_start >= $date_end) { |
| 2552 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2553 |
|
return $msg; |
| 2554 |
|
} |
| 2555 |
|
|
| 2556 |
|
$access_url_id = api_get_current_access_url_id(); |
| 2557 |
|
$params = [ |
|
@@ 2613-2627 (lines=15) @@
|
| 2610 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2611 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2612 |
|
|
| 2613 |
|
if (empty($name)) { |
| 2614 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2615 |
|
return $msg; |
| 2616 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2617 |
|
$msg = get_lang('InvalidStartDate'); |
| 2618 |
|
return $msg; |
| 2619 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2620 |
|
$date_end = null; |
| 2621 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2622 |
|
$msg = get_lang('InvalidEndDate'); |
| 2623 |
|
return $msg; |
| 2624 |
|
} elseif ($date_start >= $date_end) { |
| 2625 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2626 |
|
return $msg; |
| 2627 |
|
} |
| 2628 |
|
if ($date_end <> null) { |
| 2629 |
|
$sql = "UPDATE $tbl_session_category |
| 2630 |
|
SET |