|
@@ 2561-2575 (lines=15) @@
|
| 2558 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2559 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2560 |
|
|
| 2561 |
|
if (empty($name)) { |
| 2562 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2563 |
|
return $msg; |
| 2564 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2565 |
|
$msg = get_lang('InvalidStartDate'); |
| 2566 |
|
return $msg; |
| 2567 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2568 |
|
$date_end = ''; |
| 2569 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2570 |
|
$msg = get_lang('InvalidEndDate'); |
| 2571 |
|
return $msg; |
| 2572 |
|
} elseif ($date_start >= $date_end) { |
| 2573 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2574 |
|
return $msg; |
| 2575 |
|
} |
| 2576 |
|
|
| 2577 |
|
$access_url_id = api_get_current_access_url_id(); |
| 2578 |
|
$params = [ |
|
@@ 2639-2653 (lines=15) @@
|
| 2636 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2637 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2638 |
|
|
| 2639 |
|
if (empty($name)) { |
| 2640 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2641 |
|
return $msg; |
| 2642 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2643 |
|
$msg = get_lang('InvalidStartDate'); |
| 2644 |
|
return $msg; |
| 2645 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2646 |
|
$date_end = null; |
| 2647 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2648 |
|
$msg = get_lang('InvalidEndDate'); |
| 2649 |
|
return $msg; |
| 2650 |
|
} elseif ($date_start >= $date_end) { |
| 2651 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2652 |
|
return $msg; |
| 2653 |
|
} |
| 2654 |
|
if ($date_end <> null) { |
| 2655 |
|
$sql = "UPDATE $tbl_session_category |
| 2656 |
|
SET |