|
@@ 2450-2464 (lines=15) @@
|
| 2447 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2448 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2449 |
|
|
| 2450 |
|
if (empty($name)) { |
| 2451 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2452 |
|
return $msg; |
| 2453 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2454 |
|
$msg = get_lang('InvalidStartDate'); |
| 2455 |
|
return $msg; |
| 2456 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2457 |
|
$date_end = "null"; |
| 2458 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2459 |
|
$msg = get_lang('InvalidEndDate'); |
| 2460 |
|
return $msg; |
| 2461 |
|
} elseif ($date_start >= $date_end) { |
| 2462 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2463 |
|
return $msg; |
| 2464 |
|
} |
| 2465 |
|
|
| 2466 |
|
$access_url_id = api_get_current_access_url_id(); |
| 2467 |
|
$params = [ |
|
@@ 2523-2537 (lines=15) @@
|
| 2520 |
|
$date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
| 2521 |
|
$date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
| 2522 |
|
|
| 2523 |
|
if (empty($name)) { |
| 2524 |
|
$msg = get_lang('SessionCategoryNameIsRequired'); |
| 2525 |
|
return $msg; |
| 2526 |
|
} elseif (!$month_start || !$day_start || !$year_start || !checkdate($month_start, $day_start, $year_start)) { |
| 2527 |
|
$msg = get_lang('InvalidStartDate'); |
| 2528 |
|
return $msg; |
| 2529 |
|
} elseif (!$month_end && !$day_end && !$year_end) { |
| 2530 |
|
$date_end = null; |
| 2531 |
|
} elseif (!$month_end || !$day_end || !$year_end || !checkdate($month_end, $day_end, $year_end)) { |
| 2532 |
|
$msg = get_lang('InvalidEndDate'); |
| 2533 |
|
return $msg; |
| 2534 |
|
} elseif ($date_start >= $date_end) { |
| 2535 |
|
$msg = get_lang('StartDateShouldBeBeforeEndDate'); |
| 2536 |
|
return $msg; |
| 2537 |
|
} |
| 2538 |
|
if ($date_end <> null) { |
| 2539 |
|
$sql = "UPDATE $tbl_session_category |
| 2540 |
|
SET |