|
@@ 2633-2647 (lines=15) @@
|
| 2630 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2631 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2632 |
|
|
| 2633 |
|
if (empty($name)) { |
| 2634 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2635 |
|
return $msg; |
| 2636 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2637 |
|
$msg = get_lang('InvalidStartDate'); |
| 2638 |
|
return $msg; |
| 2639 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2640 |
|
$date_end = ''; |
| 2641 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2642 |
|
$msg = get_lang('InvalidEndDate'); |
| 2643 |
|
return $msg; |
| 2644 |
|
} elseif ($date_start >= $date_end) { |
| 2645 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2646 |
|
return $msg; |
| 2647 |
|
} |
| 2648 |
|
|
| 2649 |
|
$access_url_id = api_get_current_access_url_id(); |
| 2650 |
|
$params = [ |
|
@@ 2711-2725 (lines=15) @@
|
| 2708 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2709 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2710 |
|
|
| 2711 |
|
if (empty($name)) { |
| 2712 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2713 |
|
return $msg; |
| 2714 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2715 |
|
$msg = get_lang('InvalidStartDate'); |
| 2716 |
|
return $msg; |
| 2717 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2718 |
|
$date_end = null; |
| 2719 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2720 |
|
$msg = get_lang('InvalidEndDate'); |
| 2721 |
|
return $msg; |
| 2722 |
|
} elseif ($date_start >= $date_end) { |
| 2723 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2724 |
|
return $msg; |
| 2725 |
|
} |
| 2726 |
|
if ($date_end <> null) { |
| 2727 |
|
$sql = "UPDATE $tbl_session_category |
| 2728 |
|
SET |