'index.php',"name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); list($year_start, $month_start, $day_start) = explode('-', $infos['date_start']); list($year_end, $month_end, $day_end) = explode('-', $infos['date_end']); if (array_key_exists('calendar_start_date', $infos)) { list($calendarStartDateYear, $calendarStartDateMonth, $calendarStartDateDay) = explode('-', $infos['calendar_start_date']); } // Default value $showDescriptionChecked = 'checked'; if (isset($infos['show_description'])) { if (!empty($infos['show_description'])) { $showDescriptionChecked = 'checked'; } else { $showDescriptionChecked = null; } } $end_year_disabled = $end_month_disabled = $end_day_disabled = ''; if (isset($_POST['formSent']) && $_POST['formSent']) { $formSent = 1; $name = $_POST['name']; $year_start = $_POST['year_start']; $month_start = $_POST['month_start']; $day_start = $_POST['day_start']; $year_end = $_POST['year_end']; $month_end = $_POST['month_end']; $day_end = $_POST['day_end']; $nb_days_acess_before = $_POST['nb_days_access_before']; $nb_days_acess_after = $_POST['nb_days_access_after']; //$nolimit = $_POST['nolimit']; $id_coach = $_POST['id_coach']; $id_session_category = $_POST['session_category']; $id_visibility = $_POST['session_visibility']; $duration = isset($_POST['duration']) ? $_POST['duration'] : null; $description = isset($_POST['description']) ? $_POST['description'] : null; $showDescription = isset($_POST['show_description']) ? 1 : 0; $end_limit = $_POST['end_limit']; $start_limit = $_POST['start_limit']; if (empty($end_limit) && empty($start_limit)) { $nolimit = 1; } else { $nolimit = null; } $calendarStartDay = isset($_POST['calendar_start_date_day']) ? $_POST['calendar_start_date_day'] : ''; $calendarStartMonth = isset($_POST['calendar_start_date_month']) ? $_POST['calendar_start_date_month'] : ''; $calendarStartYear = isset($_POST['calendar_start_date_year']) ? $_POST['calendar_start_date_year'] : ''; $calendarStartDate = $calendarStartYear.'-'.$calendarStartMonth.'-'.$calendarStartDay.' 00:00:00'; if (empty($calendarStartYear) || empty($calendarStartMonth) || empty($calendarStartDay)) { $calendarStartDate = ''; } $return = SessionManager::edit_session( $id, $name, $year_start, $month_start, $day_start, $year_end, $month_end, $day_end, $nb_days_acess_before, $nb_days_acess_after, $nolimit, $id_coach, $id_session_category, $id_visibility, $start_limit, $end_limit, $description, $showDescription, $duration, $calendarStartDate ); if ($return == strval(intval($return))) { header('Location: resume_session.php?id_session='.$return); exit(); } } $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; $sql="SELECT user_id,lastname,firstname,username FROM $tbl_user WHERE status='1'".$order_clause; if (api_is_multiple_url_enabled()) { $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $access_url_id = api_get_current_access_url_id(); if ($access_url_id != -1) { $sql="SELECT DISTINCT u.user_id,lastname,firstname,username FROM $tbl_user u INNER JOIN $table_access_url_rel_user url_rel_user ON (url_rel_user.user_id = u.user_id) WHERE status='1' AND access_url_id = '$access_url_id' $order_clause"; } } $result = Database::query($sql); $Coaches = Database::store_result($result); $thisYear = date('Y'); // display the header Display::display_header($tool_name); if (!empty($return)) { Display::display_error_message($return,false); } $page = isset($_GET['page']) && $_GET['page'] == 'resume_session.php' ? 'resume_session.php' : null; ?>