parent
							
								
									0fc6dee2c8
								
							
						
					
					
						commit
						939949f9cc
					
				@ -1,303 +1,303 @@ | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
*	@package chamilo.admin | 
				
			||||
* 	@todo use formvalidator | 
				
			||||
*/ | 
				
			||||
// resetting the course id | 
				
			||||
$cidReset = true; | 
				
			||||
 | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
$xajax = new xajax(); | 
				
			||||
$xajax->registerFunction('search_courses'); | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section = SECTION_PLATFORM_ADMIN; | 
				
			||||
 | 
				
			||||
// Access restrictions | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
 | 
				
			||||
// setting breadcrumbs | 
				
			||||
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); | 
				
			||||
$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); | 
				
			||||
$tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION); | 
				
			||||
$tbl_session_category				= Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); | 
				
			||||
$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER); | 
				
			||||
$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE); | 
				
			||||
$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE); | 
				
			||||
 | 
				
			||||
// setting the name of the tool | 
				
			||||
$tool_name = get_lang('SubscribeSessionsToCategory'); | 
				
			||||
$id_session = isset($_GET['id_session']) ? intval($_GET['id_session']) : null; | 
				
			||||
 | 
				
			||||
$add_type = 'multiple'; | 
				
			||||
if (isset($_GET['add_type']) && $_GET['add_type'] != '') { | 
				
			||||
    $add_type = Security::remove_XSS($_REQUEST['add_type']); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (!api_is_platform_admin() && !api_is_session_admin()) { | 
				
			||||
	$sql = 'SELECT session_admin_id FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session; | 
				
			||||
	$rs = Database::query($sql); | 
				
			||||
	if (Database::result($rs,0,0)!=$_user['user_id']) { | 
				
			||||
		api_not_allowed(true); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$xajax -> processRequests(); | 
				
			||||
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/'); | 
				
			||||
$htmlHeadXtra[] = ' | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function add_course_to_session (code, content) { | 
				
			||||
	document.getElementById("course_to_add").value = ""; | 
				
			||||
	document.getElementById("ajax_list_courses_single").innerHTML = ""; | 
				
			||||
	destination = document.getElementById("destination"); | 
				
			||||
	for (i=0;i<destination.length;i++) { | 
				
			||||
		if(destination.options[i].text == content) { | 
				
			||||
				return false; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
	destination.options[destination.length] = new Option(content,code); | 
				
			||||
	destination.selectedIndex = -1; | 
				
			||||
	sortOptions(destination.options); | 
				
			||||
} | 
				
			||||
function send() { | 
				
			||||
	if (document.formulaire.CategorySessionId.value!=0) { | 
				
			||||
		document.formulaire.formSent.value=0; | 
				
			||||
		document.formulaire.submit(); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
function remove_item(origin) | 
				
			||||
{ | 
				
			||||
	for(var i = 0 ; i<origin.options.length ; i++) { | 
				
			||||
		if(origin.options[i].selected) { | 
				
			||||
			origin.options[i]=null; | 
				
			||||
			i = i-1; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
</script>'; | 
				
			||||
 | 
				
			||||
$formSent = 0; | 
				
			||||
$errorMsg = $firstLetterCourse = $firstLetterSession = ''; | 
				
			||||
$CourseList = $SessionList = array(); | 
				
			||||
$courses = $sessions = array(); | 
				
			||||
$categoryId = isset($_POST['CategorySessionId']) ? intval($_POST['CategorySessionId']) : null; | 
				
			||||
 | 
				
			||||
if (isset($_POST['formSent']) && $_POST['formSent']) { | 
				
			||||
    $formSent = $_POST['formSent']; | 
				
			||||
    $sessionCategoryList = $_POST['SessionCategoryList']; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    if ($categoryId != 0 && count($sessionCategoryList) > 0) { | 
				
			||||
        // Removing all | 
				
			||||
        $sql = "UPDATE $tbl_session SET session_category_id = '' WHERE session_category_id = $categoryId"; | 
				
			||||
        Database::query($sql); | 
				
			||||
        // Adding new | 
				
			||||
        $sessionCategoryList = array_map('intval', $sessionCategoryList); | 
				
			||||
        $session_id = join(',', $sessionCategoryList); | 
				
			||||
 | 
				
			||||
        $sql = "UPDATE $tbl_session SET session_category_id = $categoryId WHERE id in ($session_id) "; | 
				
			||||
        Database::query($sql); | 
				
			||||
        header('Location: add_many_session_to_category.php?id_category=' . $categoryId . '&msg=ok'); | 
				
			||||
        exit; | 
				
			||||
    } else { | 
				
			||||
        header('Location: add_many_session_to_category.php?msg=error'); | 
				
			||||
        exit; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['id_category'])) { | 
				
			||||
    $categoryId = intval($_GET['id_category']); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['msg']) && $_GET['msg'] == 'error') { | 
				
			||||
    $errorMsg = get_lang('MsgErrorSessionCategory'); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['msg']) && $_GET['msg'] == 'ok') { | 
				
			||||
    $OkMsg = get_lang('SessionCategoryUpdate'); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null; | 
				
			||||
 | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
 | 
				
			||||
$where = ''; | 
				
			||||
$rows_category_session = array(); | 
				
			||||
if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) { | 
				
			||||
 | 
				
			||||
    $where = 'WHERE session_category_id !=' . $categoryId; | 
				
			||||
    $sql = 'SELECT id, name  FROM ' . $tbl_session . ' WHERE session_category_id =' . $categoryId . ' ORDER BY name'; | 
				
			||||
    $result = Database::query($sql); | 
				
			||||
    $rows_category_session = Database::store_result($result); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$rows_session_category = SessionManager::get_all_session_category(); | 
				
			||||
if (empty($rows_session_category)) { | 
				
			||||
    Display::display_warning_message(get_lang('YouNeedToAddASessionCategoryFirst')); | 
				
			||||
    Display::display_footer(); | 
				
			||||
    exit; | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (api_get_multiple_access_url()) { | 
				
			||||
    $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); | 
				
			||||
    $access_url_id = api_get_current_access_url_id(); | 
				
			||||
    $sql = "SELECT s.id, s.name  FROM $tbl_session s INNER JOIN $table_access_url_rel_session u ON s.id = u.session_id $where AND u.access_url_id = $access_url_id ORDER BY name"; | 
				
			||||
} else { | 
				
			||||
    $sql = "SELECT id, name  FROM $tbl_session $where ORDER BY name"; | 
				
			||||
} | 
				
			||||
$result=Database::query($sql); | 
				
			||||
$rows_session = Database::store_result($result); | 
				
			||||
?> | 
				
			||||
<form name="formulaire" method="post" | 
				
			||||
      action="<?php echo api_get_self(); ?>?page=<?php echo $page; | 
				
			||||
      if (!empty($_GET['add'])) { | 
				
			||||
          echo '&add=true'; | 
				
			||||
      } ?>" style="margin:0px;"> | 
				
			||||
    <?php echo '<legend>' . $tool_name . '</legend>'; ?> | 
				
			||||
    <input type="hidden" name="formSent" value="1"/> | 
				
			||||
    <?php | 
				
			||||
    if (!empty($errorMsg)) { | 
				
			||||
        Display::display_error_message($errorMsg); //main API | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
if(!empty($OkMsg)) { | 
				
			||||
	Display::display_confirmation_message($OkMsg); //main API | 
				
			||||
} | 
				
			||||
 | 
				
			||||
/* | 
				
			||||
 * | 
				
			||||
 * The a/b/c Filter is not a priority | 
				
			||||
 * | 
				
			||||
 * <td width="45%" align="center"> | 
				
			||||
 <?php echo get_lang('FirstLetterCourse'); ?> :
 | 
				
			||||
     <select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')"> | 
				
			||||
      <option value="%">--</option> | 
				
			||||
      <?php | 
				
			||||
      echo Display :: get_alphabet_options(); | 
				
			||||
      echo Display :: get_numeric_options(0,9,''); | 
				
			||||
      ?> | 
				
			||||
     </select> | 
				
			||||
</td> | 
				
			||||
 | 
				
			||||
 */ | 
				
			||||
?> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%" align="center"> | 
				
			||||
<tr> | 
				
			||||
	<td align="left"></td> | 
				
			||||
	<td align="left"></td> | 
				
			||||
	<td  align="center"> | 
				
			||||
	<b><?php echo get_lang('SessionCategoryName') ?> :</b><br />
 | 
				
			||||
	<select name="CategorySessionId" style="width: 320px;" onchange="javascript:send();" > | 
				
			||||
		<option value="0" ></option> | 
				
			||||
		<?php | 
				
			||||
		if (!empty($rows_session_category)) { | 
				
			||||
    		foreach($rows_session_category as $category) { | 
				
			||||
    			if($category['id'] == $categoryId) | 
				
			||||
      				echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; | 
				
			||||
      			else | 
				
			||||
      				echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; | 
				
			||||
    		} | 
				
			||||
		} | 
				
			||||
  		?> | 
				
			||||
  	</select> | 
				
			||||
	</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="45%" align="center"><b><?php echo get_lang('SessionListInPlatform') ?> :</b></td>
 | 
				
			||||
  <td width="10%"> </td> | 
				
			||||
  <td align="center" width="45%"><b><?php echo get_lang('SessionListInCategory') ?> :</b></td>
 | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
<?php if($add_type == 'multiple') { ?> | 
				
			||||
<tr> | 
				
			||||
<td> </td></tr> | 
				
			||||
<?php } ?> | 
				
			||||
<tr> | 
				
			||||
  <td width="45%" align="center"> | 
				
			||||
	<div id="ajax_list_courses_multiple"> | 
				
			||||
	<select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> | 
				
			||||
	<?php | 
				
			||||
	foreach($rows_session as $enreg) { | 
				
			||||
	?> | 
				
			||||
		<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option>
 | 
				
			||||
	<?php } ?> | 
				
			||||
	</select></div> | 
				
			||||
<?php unset($nosessionCourses); ?> | 
				
			||||
  </td> | 
				
			||||
  <td width="10%" valign="middle" align="center"> | 
				
			||||
  	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))"> | 
				
			||||
        <i class="fa fa-arrow-left"></i> | 
				
			||||
    </button> | 
				
			||||
	<br /><br /> | 
				
			||||
	<button class="btn  btn-default" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))"> | 
				
			||||
        <i class="fa fa-arrow-right"></i> | 
				
			||||
	</button> | 
				
			||||
	<br /><br /><br /><br /><br /><br /> | 
				
			||||
	<?php | 
				
			||||
		echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('SubscribeSessionsToCategory').'</button>'; | 
				
			||||
	?> | 
				
			||||
  </td> | 
				
			||||
  <td width="45%" align="center"> | 
				
			||||
  <select id='destination' name="SessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> | 
				
			||||
	<?php | 
				
			||||
	foreach($rows_category_session as $enreg) { ?> | 
				
			||||
		<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option>
 | 
				
			||||
	<?php } ?> | 
				
			||||
  </select></td> | 
				
			||||
</tr> | 
				
			||||
</table> | 
				
			||||
 | 
				
			||||
</form> | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function moveItem(origin , destination) { | 
				
			||||
	for(var i = 0 ; i<origin.options.length ; i++) { | 
				
			||||
		if(origin.options[i].selected) { | 
				
			||||
			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value); | 
				
			||||
			origin.options[i]=null; | 
				
			||||
			i = i-1; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
	destination.selectedIndex = -1; | 
				
			||||
	sortOptions(destination.options); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function sortOptions(options) { | 
				
			||||
	newOptions = new Array(); | 
				
			||||
	for (i = 0 ; i<options.length ; i++) { | 
				
			||||
		newOptions[i] = options[i]; | 
				
			||||
	} | 
				
			||||
 | 
				
			||||
	newOptions = newOptions.sort(mysort); | 
				
			||||
	options.length = 0; | 
				
			||||
 | 
				
			||||
	for(i = 0 ; i < newOptions.length ; i++){ | 
				
			||||
		options[i] = newOptions[i]; | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function mysort(a, b){ | 
				
			||||
	if(a.text.toLowerCase() > b.text.toLowerCase()){ | 
				
			||||
		return 1; | 
				
			||||
	} | 
				
			||||
	if(a.text.toLowerCase() < b.text.toLowerCase()){ | 
				
			||||
		return -1; | 
				
			||||
	} | 
				
			||||
	return 0; | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function valide(){ | 
				
			||||
	var options = document.getElementById('destination').options; | 
				
			||||
	for (i = 0 ; i<options.length ; i++) | 
				
			||||
		options[i].selected = true; | 
				
			||||
 | 
				
			||||
	document.forms.formulaire.submit(); | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
Display::display_footer(); | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
*	@package chamilo.admin | 
				
			||||
* 	@todo use formvalidator | 
				
			||||
*/ | 
				
			||||
// resetting the course id | 
				
			||||
$cidReset = true; | 
				
			||||
 | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
$xajax = new xajax(); | 
				
			||||
$xajax->registerFunction('search_courses'); | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section = SECTION_PLATFORM_ADMIN; | 
				
			||||
 | 
				
			||||
// Access restrictions | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
 | 
				
			||||
// setting breadcrumbs | 
				
			||||
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); | 
				
			||||
$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); | 
				
			||||
$tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION); | 
				
			||||
$tbl_session_category				= Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); | 
				
			||||
$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER); | 
				
			||||
$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE); | 
				
			||||
$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE); | 
				
			||||
 | 
				
			||||
// setting the name of the tool | 
				
			||||
$tool_name = get_lang('SubscribeSessionsToCategory'); | 
				
			||||
$id_session = isset($_GET['id_session']) ? intval($_GET['id_session']) : null; | 
				
			||||
 | 
				
			||||
$add_type = 'multiple'; | 
				
			||||
if (isset($_GET['add_type']) && $_GET['add_type'] != '') { | 
				
			||||
    $add_type = Security::remove_XSS($_REQUEST['add_type']); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (!api_is_platform_admin() && !api_is_session_admin()) { | 
				
			||||
	$sql = 'SELECT session_admin_id FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session; | 
				
			||||
	$rs = Database::query($sql); | 
				
			||||
	if (Database::result($rs,0,0)!=$_user['user_id']) { | 
				
			||||
		api_not_allowed(true); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$xajax -> processRequests(); | 
				
			||||
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/'); | 
				
			||||
$htmlHeadXtra[] = ' | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function add_course_to_session (code, content) { | 
				
			||||
	document.getElementById("course_to_add").value = ""; | 
				
			||||
	document.getElementById("ajax_list_courses_single").innerHTML = ""; | 
				
			||||
	destination = document.getElementById("destination"); | 
				
			||||
	for (i=0;i<destination.length;i++) { | 
				
			||||
		if(destination.options[i].text == content) { | 
				
			||||
				return false; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
	destination.options[destination.length] = new Option(content,code); | 
				
			||||
	destination.selectedIndex = -1; | 
				
			||||
	sortOptions(destination.options); | 
				
			||||
} | 
				
			||||
function send() { | 
				
			||||
	if (document.formulaire.CategorySessionId.value!=0) { | 
				
			||||
		document.formulaire.formSent.value=0; | 
				
			||||
		document.formulaire.submit(); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
function remove_item(origin) | 
				
			||||
{ | 
				
			||||
	for(var i = 0 ; i<origin.options.length ; i++) { | 
				
			||||
		if(origin.options[i].selected) { | 
				
			||||
			origin.options[i]=null; | 
				
			||||
			i = i-1; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
</script>'; | 
				
			||||
 | 
				
			||||
$formSent = 0; | 
				
			||||
$errorMsg = $firstLetterCourse = $firstLetterSession = ''; | 
				
			||||
$CourseList = $SessionList = array(); | 
				
			||||
$courses = $sessions = array(); | 
				
			||||
$categoryId = isset($_POST['CategorySessionId']) ? intval($_POST['CategorySessionId']) : null; | 
				
			||||
 | 
				
			||||
if (isset($_POST['formSent']) && $_POST['formSent']) { | 
				
			||||
    $formSent = $_POST['formSent']; | 
				
			||||
    $sessionCategoryList = $_POST['SessionCategoryList']; | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    if ($categoryId != 0 && count($sessionCategoryList) > 0) { | 
				
			||||
        // Removing all | 
				
			||||
        $sql = "UPDATE $tbl_session SET session_category_id = '' WHERE session_category_id = $categoryId"; | 
				
			||||
        Database::query($sql); | 
				
			||||
        // Adding new | 
				
			||||
        $sessionCategoryList = array_map('intval', $sessionCategoryList); | 
				
			||||
        $session_id = join(',', $sessionCategoryList); | 
				
			||||
 | 
				
			||||
        $sql = "UPDATE $tbl_session SET session_category_id = $categoryId WHERE id in ($session_id) "; | 
				
			||||
        Database::query($sql); | 
				
			||||
        header('Location: add_many_session_to_category.php?id_category=' . $categoryId . '&msg=ok'); | 
				
			||||
        exit; | 
				
			||||
    } else { | 
				
			||||
        header('Location: add_many_session_to_category.php?msg=error'); | 
				
			||||
        exit; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['id_category'])) { | 
				
			||||
    $categoryId = intval($_GET['id_category']); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['msg']) && $_GET['msg'] == 'error') { | 
				
			||||
    $errorMsg = get_lang('MsgErrorSessionCategory'); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (isset($_GET['msg']) && $_GET['msg'] == 'ok') { | 
				
			||||
    $OkMsg = get_lang('SessionCategoryUpdate'); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null; | 
				
			||||
 | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
 | 
				
			||||
$where = ''; | 
				
			||||
$rows_category_session = array(); | 
				
			||||
if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) { | 
				
			||||
 | 
				
			||||
    $where = 'WHERE session_category_id !=' . $categoryId; | 
				
			||||
    $sql = 'SELECT id, name  FROM ' . $tbl_session . ' WHERE session_category_id =' . $categoryId . ' ORDER BY name'; | 
				
			||||
    $result = Database::query($sql); | 
				
			||||
    $rows_category_session = Database::store_result($result); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$rows_session_category = SessionManager::get_all_session_category(); | 
				
			||||
if (empty($rows_session_category)) { | 
				
			||||
    Display::display_warning_message(get_lang('YouNeedToAddASessionCategoryFirst')); | 
				
			||||
    Display::display_footer(); | 
				
			||||
    exit; | 
				
			||||
} | 
				
			||||
 | 
				
			||||
if (api_get_multiple_access_url()) { | 
				
			||||
    $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); | 
				
			||||
    $access_url_id = api_get_current_access_url_id(); | 
				
			||||
    $sql = "SELECT s.id, s.name  FROM $tbl_session s INNER JOIN $table_access_url_rel_session u ON s.id = u.session_id $where AND u.access_url_id = $access_url_id ORDER BY name"; | 
				
			||||
} else { | 
				
			||||
    $sql = "SELECT id, name  FROM $tbl_session $where ORDER BY name"; | 
				
			||||
} | 
				
			||||
$result=Database::query($sql); | 
				
			||||
$rows_session = Database::store_result($result); | 
				
			||||
?> | 
				
			||||
<form name="formulaire" method="post" | 
				
			||||
      action="<?php echo api_get_self(); ?>?page=<?php echo $page; | 
				
			||||
      if (!empty($_GET['add'])) { | 
				
			||||
          echo '&add=true'; | 
				
			||||
      } ?>" style="margin:0px;"> | 
				
			||||
    <?php echo '<legend>' . $tool_name . '</legend>'; ?> | 
				
			||||
    <input type="hidden" name="formSent" value="1"/> | 
				
			||||
    <?php | 
				
			||||
    if (!empty($errorMsg)) { | 
				
			||||
        Display::display_error_message($errorMsg); //main API | 
				
			||||
    } | 
				
			||||
 | 
				
			||||
if(!empty($OkMsg)) { | 
				
			||||
	Display::display_confirmation_message($OkMsg); //main API | 
				
			||||
} | 
				
			||||
 | 
				
			||||
/* | 
				
			||||
 * | 
				
			||||
 * The a/b/c Filter is not a priority | 
				
			||||
 * | 
				
			||||
 * <td width="45%" align="center"> | 
				
			||||
 <?php echo get_lang('FirstLetterCourse'); ?> :
 | 
				
			||||
     <select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')"> | 
				
			||||
      <option value="%">--</option> | 
				
			||||
      <?php | 
				
			||||
      echo Display :: get_alphabet_options(); | 
				
			||||
      echo Display :: get_numeric_options(0,9,''); | 
				
			||||
      ?> | 
				
			||||
     </select> | 
				
			||||
</td> | 
				
			||||
 | 
				
			||||
 */ | 
				
			||||
?> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%" align="center"> | 
				
			||||
<tr> | 
				
			||||
	<td align="left"></td> | 
				
			||||
	<td align="left"></td> | 
				
			||||
	<td  align="center"> | 
				
			||||
	<b><?php echo get_lang('SessionCategoryName') ?> :</b><br />
 | 
				
			||||
	<select name="CategorySessionId" style="width: 320px;" onchange="javascript:send();" > | 
				
			||||
		<option value="0" ></option> | 
				
			||||
		<?php | 
				
			||||
		if (!empty($rows_session_category)) { | 
				
			||||
    		foreach($rows_session_category as $category) { | 
				
			||||
    			if($category['id'] == $categoryId) | 
				
			||||
      				echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; | 
				
			||||
      			else | 
				
			||||
      				echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; | 
				
			||||
    		} | 
				
			||||
		} | 
				
			||||
  		?> | 
				
			||||
  	</select> | 
				
			||||
	</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="45%" align="center"><b><?php echo get_lang('SessionListInPlatform') ?> :</b></td>
 | 
				
			||||
  <td width="10%"> </td> | 
				
			||||
  <td align="center" width="45%"><b><?php echo get_lang('SessionListInCategory') ?> :</b></td>
 | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
<?php if($add_type == 'multiple') { ?> | 
				
			||||
<tr> | 
				
			||||
<td> </td></tr> | 
				
			||||
<?php } ?> | 
				
			||||
<tr> | 
				
			||||
  <td width="45%" align="center"> | 
				
			||||
	<div id="ajax_list_courses_multiple"> | 
				
			||||
	<select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> | 
				
			||||
	<?php | 
				
			||||
	foreach($rows_session as $enreg) { | 
				
			||||
	?> | 
				
			||||
		<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option>
 | 
				
			||||
	<?php } ?> | 
				
			||||
	</select></div> | 
				
			||||
<?php unset($nosessionCourses); ?> | 
				
			||||
  </td> | 
				
			||||
  <td width="10%" valign="middle" align="center"> | 
				
			||||
  	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))"> | 
				
			||||
        <i class="fa fa-arrow-left"></i> | 
				
			||||
    </button> | 
				
			||||
	<br /><br /> | 
				
			||||
	<button class="btn  btn-default" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))"> | 
				
			||||
        <i class="fa fa-arrow-right"></i> | 
				
			||||
	</button> | 
				
			||||
	<br /><br /><br /><br /><br /><br /> | 
				
			||||
	<?php | 
				
			||||
		echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('SubscribeSessionsToCategory').'</button>'; | 
				
			||||
	?> | 
				
			||||
  </td> | 
				
			||||
  <td width="45%" align="center"> | 
				
			||||
  <select id='destination' name="SessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> | 
				
			||||
	<?php | 
				
			||||
	foreach($rows_category_session as $enreg) { ?> | 
				
			||||
		<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option>
 | 
				
			||||
	<?php } ?> | 
				
			||||
  </select></td> | 
				
			||||
</tr> | 
				
			||||
</table> | 
				
			||||
 | 
				
			||||
</form> | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function moveItem(origin , destination) { | 
				
			||||
	for(var i = 0 ; i<origin.options.length ; i++) { | 
				
			||||
		if(origin.options[i].selected) { | 
				
			||||
			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value); | 
				
			||||
			origin.options[i]=null; | 
				
			||||
			i = i-1; | 
				
			||||
		} | 
				
			||||
	} | 
				
			||||
	destination.selectedIndex = -1; | 
				
			||||
	sortOptions(destination.options); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function sortOptions(options) { | 
				
			||||
	newOptions = new Array(); | 
				
			||||
	for (i = 0 ; i<options.length ; i++) { | 
				
			||||
		newOptions[i] = options[i]; | 
				
			||||
	} | 
				
			||||
 | 
				
			||||
	newOptions = newOptions.sort(mysort); | 
				
			||||
	options.length = 0; | 
				
			||||
 | 
				
			||||
	for(i = 0 ; i < newOptions.length ; i++){ | 
				
			||||
		options[i] = newOptions[i]; | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function mysort(a, b){ | 
				
			||||
	if(a.text.toLowerCase() > b.text.toLowerCase()){ | 
				
			||||
		return 1; | 
				
			||||
	} | 
				
			||||
	if(a.text.toLowerCase() < b.text.toLowerCase()){ | 
				
			||||
		return -1; | 
				
			||||
	} | 
				
			||||
	return 0; | 
				
			||||
} | 
				
			||||
 | 
				
			||||
function valide(){ | 
				
			||||
	var options = document.getElementById('destination').options; | 
				
			||||
	for (i = 0 ; i<options.length ; i++) | 
				
			||||
		options[i].selected = true; | 
				
			||||
 | 
				
			||||
	document.forms.formulaire.submit(); | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
 | 
				
			||||
Display::display_footer(); | 
				
			||||
@ -1,231 +1,231 @@ | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
*	@package chamilo.admin | 
				
			||||
* 	@todo use formvalidator for the form | 
				
			||||
*/ | 
				
			||||
 | 
				
			||||
$cidReset=true; | 
				
			||||
 | 
				
			||||
// including the global Dokeos file | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
$xajax = new xajax(); | 
				
			||||
$xajax -> registerFunction ('search_coachs'); | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section=SECTION_PLATFORM_ADMIN; | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
 | 
				
			||||
$formSent=0; | 
				
			||||
$errorMsg=''; | 
				
			||||
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); | 
				
			||||
$interbreadcrumb[]=array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory')); | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_user		= Database::get_main_table(TABLE_MAIN_USER); | 
				
			||||
$tbl_session	= Database::get_main_table(TABLE_MAIN_SESSION); | 
				
			||||
 | 
				
			||||
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']; | 
				
			||||
	$return = SessionManager::create_category_session($name,$year_start,$month_start,$day_start,$year_end,$month_end,$day_end); | 
				
			||||
	if ($return == strval(intval($return))) { | 
				
			||||
		header('Location: session_category_list.php?action=show_message&message='.urlencode(get_lang('SessionCategoryAdded'))); | 
				
			||||
		exit(); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
$thisYear=date('Y'); | 
				
			||||
$thisMonth=date('m'); | 
				
			||||
$thisDay=date('d'); | 
				
			||||
$tool_name = get_lang('AddACategory'); | 
				
			||||
 | 
				
			||||
//display the header | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
if (!empty($return)) { | 
				
			||||
	Display::display_error_message($return,false); | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
<form method="post" name="form" action="<?php echo api_get_self(); ?>" style="margin:0px;">
 | 
				
			||||
<input type="hidden" name="formSent" value="1"> | 
				
			||||
<legend><?php echo $tool_name; ?></legend>
 | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="550"> | 
				
			||||
<tr> | 
				
			||||
  <td width="30%"><?php echo get_lang('SessionCategoryName') ?>  </td>
 | 
				
			||||
  <td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr > | 
				
			||||
<td colspan="2"> | 
				
			||||
	<a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a>
 | 
				
			||||
		<div style="display: none" id="options"> | 
				
			||||
	<br> | 
				
			||||
	<div> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%"> | 
				
			||||
<tr><td colspan="2"><?php echo get_lang('TheTimeLimitsAreReferential');?></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateStart') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_start"> | 
				
			||||
 | 
				
			||||
<?php | 
				
			||||
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { | 
				
			||||
?> | 
				
			||||
	<option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
 | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateEnd') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
    <option value="1">01</option> | 
				
			||||
	<option value="2">02</option> | 
				
			||||
	<option value="3">03</option> | 
				
			||||
	<option value="4">04</option> | 
				
			||||
	<option value="5">05</option> | 
				
			||||
	<option value="6">06</option> | 
				
			||||
	<option value="7">07</option> | 
				
			||||
	<option value="8">08</option> | 
				
			||||
	<option value="9">09</option> | 
				
			||||
	<option value="10">10</option> | 
				
			||||
	<option value="11">11</option> | 
				
			||||
	<option value="12">12</option> | 
				
			||||
	<option value="13">13</option> | 
				
			||||
	<option value="14">14</option> | 
				
			||||
	<option value="15">15</option> | 
				
			||||
	<option value="16">16</option> | 
				
			||||
	<option value="17">17</option> | 
				
			||||
	<option value="18">18</option> | 
				
			||||
	<option value="19">19</option> | 
				
			||||
	<option value="20">20</option> | 
				
			||||
	<option value="21">21</option> | 
				
			||||
	<option value="22">22</option> | 
				
			||||
	<option value="23">23</option> | 
				
			||||
	<option value="24">24</option> | 
				
			||||
	<option value="25">25</option> | 
				
			||||
	<option value="26">26</option> | 
				
			||||
	<option value="27">27</option> | 
				
			||||
	<option value="28">28</option> | 
				
			||||
	<option value="29">29</option> | 
				
			||||
	<option value="30">30</option> | 
				
			||||
	<option value="31">31</option> | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
    <option value="1">01</option> | 
				
			||||
	<option value="2">02</option> | 
				
			||||
	<option value="3">03</option> | 
				
			||||
	<option value="4">04</option> | 
				
			||||
	<option value="5">05</option> | 
				
			||||
	<option value="6">06</option> | 
				
			||||
	<option value="7">07</option> | 
				
			||||
	<option value="8">08</option> | 
				
			||||
	<option value="9">09</option> | 
				
			||||
	<option value="10">10</option> | 
				
			||||
	<option value="11">11</option> | 
				
			||||
	<option value="12">12</option> | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_end"> | 
				
			||||
    <option value="0">----</option> | 
				
			||||
<?php | 
				
			||||
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { | 
				
			||||
?> | 
				
			||||
	<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
</div> | 
				
			||||
<br> | 
				
			||||
</div> | 
				
			||||
</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td> </td> | 
				
			||||
  <td><button class="save" type="submit" value="<?php echo get_lang('AddACategory') ?>"><?php echo get_lang('AddACategory') ?></button>
 | 
				
			||||
 </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
 | 
				
			||||
</form> | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function setDisable(select) { | 
				
			||||
	document.form.day_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.day_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_end.disabled = (select.checked) ? true : false; | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
Display::display_footer(); | 
				
			||||
 | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
*	@package chamilo.admin | 
				
			||||
* 	@todo use formvalidator for the form | 
				
			||||
*/ | 
				
			||||
 | 
				
			||||
$cidReset=true; | 
				
			||||
 | 
				
			||||
// including the global Dokeos file | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
$xajax = new xajax(); | 
				
			||||
$xajax -> registerFunction ('search_coachs'); | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section=SECTION_PLATFORM_ADMIN; | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
 | 
				
			||||
$formSent=0; | 
				
			||||
$errorMsg=''; | 
				
			||||
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); | 
				
			||||
$interbreadcrumb[]=array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory')); | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_user		= Database::get_main_table(TABLE_MAIN_USER); | 
				
			||||
$tbl_session	= Database::get_main_table(TABLE_MAIN_SESSION); | 
				
			||||
 | 
				
			||||
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']; | 
				
			||||
	$return = SessionManager::create_category_session($name,$year_start,$month_start,$day_start,$year_end,$month_end,$day_end); | 
				
			||||
	if ($return == strval(intval($return))) { | 
				
			||||
		header('Location: session_category_list.php?action=show_message&message='.urlencode(get_lang('SessionCategoryAdded'))); | 
				
			||||
		exit(); | 
				
			||||
	} | 
				
			||||
} | 
				
			||||
$thisYear=date('Y'); | 
				
			||||
$thisMonth=date('m'); | 
				
			||||
$thisDay=date('d'); | 
				
			||||
$tool_name = get_lang('AddACategory'); | 
				
			||||
 | 
				
			||||
//display the header | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
if (!empty($return)) { | 
				
			||||
	Display::display_error_message($return,false); | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
<form method="post" name="form" action="<?php echo api_get_self(); ?>" style="margin:0px;">
 | 
				
			||||
<input type="hidden" name="formSent" value="1"> | 
				
			||||
<legend><?php echo $tool_name; ?></legend>
 | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="550"> | 
				
			||||
<tr> | 
				
			||||
  <td width="30%"><?php echo get_lang('SessionCategoryName') ?>  </td>
 | 
				
			||||
  <td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr > | 
				
			||||
<td colspan="2"> | 
				
			||||
	<a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a>
 | 
				
			||||
		<div style="display: none" id="options"> | 
				
			||||
	<br> | 
				
			||||
	<div> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%"> | 
				
			||||
<tr><td colspan="2"><?php echo get_lang('TheTimeLimitsAreReferential');?></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateStart') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_start"> | 
				
			||||
 | 
				
			||||
<?php | 
				
			||||
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { | 
				
			||||
?> | 
				
			||||
	<option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
 | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateEnd') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
    <option value="1">01</option> | 
				
			||||
	<option value="2">02</option> | 
				
			||||
	<option value="3">03</option> | 
				
			||||
	<option value="4">04</option> | 
				
			||||
	<option value="5">05</option> | 
				
			||||
	<option value="6">06</option> | 
				
			||||
	<option value="7">07</option> | 
				
			||||
	<option value="8">08</option> | 
				
			||||
	<option value="9">09</option> | 
				
			||||
	<option value="10">10</option> | 
				
			||||
	<option value="11">11</option> | 
				
			||||
	<option value="12">12</option> | 
				
			||||
	<option value="13">13</option> | 
				
			||||
	<option value="14">14</option> | 
				
			||||
	<option value="15">15</option> | 
				
			||||
	<option value="16">16</option> | 
				
			||||
	<option value="17">17</option> | 
				
			||||
	<option value="18">18</option> | 
				
			||||
	<option value="19">19</option> | 
				
			||||
	<option value="20">20</option> | 
				
			||||
	<option value="21">21</option> | 
				
			||||
	<option value="22">22</option> | 
				
			||||
	<option value="23">23</option> | 
				
			||||
	<option value="24">24</option> | 
				
			||||
	<option value="25">25</option> | 
				
			||||
	<option value="26">26</option> | 
				
			||||
	<option value="27">27</option> | 
				
			||||
	<option value="28">28</option> | 
				
			||||
	<option value="29">29</option> | 
				
			||||
	<option value="30">30</option> | 
				
			||||
	<option value="31">31</option> | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
    <option value="1">01</option> | 
				
			||||
	<option value="2">02</option> | 
				
			||||
	<option value="3">03</option> | 
				
			||||
	<option value="4">04</option> | 
				
			||||
	<option value="5">05</option> | 
				
			||||
	<option value="6">06</option> | 
				
			||||
	<option value="7">07</option> | 
				
			||||
	<option value="8">08</option> | 
				
			||||
	<option value="9">09</option> | 
				
			||||
	<option value="10">10</option> | 
				
			||||
	<option value="11">11</option> | 
				
			||||
	<option value="12">12</option> | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_end"> | 
				
			||||
    <option value="0">----</option> | 
				
			||||
<?php | 
				
			||||
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { | 
				
			||||
?> | 
				
			||||
	<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
</div> | 
				
			||||
<br> | 
				
			||||
</div> | 
				
			||||
</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td> </td> | 
				
			||||
  <td><button class="save" type="submit" value="<?php echo get_lang('AddACategory') ?>"><?php echo get_lang('AddACategory') ?></button>
 | 
				
			||||
 </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
 | 
				
			||||
</form> | 
				
			||||
<script type="text/javascript"> | 
				
			||||
function setDisable(select) { | 
				
			||||
	document.form.day_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.day_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_end.disabled = (select.checked) ? true : false; | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
Display::display_footer(); | 
				
			||||
 | 
				
			||||
@ -1,253 +1,253 @@ | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
 * Edition script for sessions categories | 
				
			||||
 * @package chamilo.admin | 
				
			||||
 */ | 
				
			||||
$cidReset = true; | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section = SECTION_PLATFORM_ADMIN; | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
$id = intval($_GET['id']); | 
				
			||||
$formSent = 0; | 
				
			||||
$errorMsg = ''; | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); | 
				
			||||
$tool_name = get_lang('EditSessionCategory'); | 
				
			||||
$interbreadcrumb[] = array( | 
				
			||||
    'url' => 'index.php', | 
				
			||||
    "name" => get_lang('PlatformAdmin') | 
				
			||||
); | 
				
			||||
$interbreadcrumb[] = array( | 
				
			||||
    'url' => "session_category_list.php", | 
				
			||||
    "name" => get_lang('ListSessionCategory') | 
				
			||||
); | 
				
			||||
 | 
				
			||||
$sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name"; | 
				
			||||
$result=Database::query($sql); | 
				
			||||
if (!$infos=Database::fetch_array($result)) { | 
				
			||||
	header('Location: session_list.php'); | 
				
			||||
	exit(); | 
				
			||||
} | 
				
			||||
list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']); | 
				
			||||
list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']); | 
				
			||||
 | 
				
			||||
if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) { | 
				
			||||
	api_not_allowed(true); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
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']; | 
				
			||||
    $return = SessionManager::edit_category_session( | 
				
			||||
        $id, | 
				
			||||
        $name, | 
				
			||||
        $year_start, | 
				
			||||
        $month_start, | 
				
			||||
        $day_start, | 
				
			||||
        $year_end, | 
				
			||||
        $month_end, | 
				
			||||
        $day_end | 
				
			||||
    ); | 
				
			||||
    if ($return == strval(intval($return))) { | 
				
			||||
        header( | 
				
			||||
            'Location: session_category_list.php?action=show_message&message=' . urlencode( | 
				
			||||
                get_lang('SessionCategoryUpdate') | 
				
			||||
            ) | 
				
			||||
        ); | 
				
			||||
        exit(); | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$thisYear = date('Y'); | 
				
			||||
$thisMonth = date('m'); | 
				
			||||
$thisDay = date('d'); | 
				
			||||
 | 
				
			||||
// display the header | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
if (!empty($return)) { | 
				
			||||
	Display::display_error_message($return,false); | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
<form method="post" name="form" action="<?php echo api_get_self(); ?>?id=<?php echo $id; ?>">
 | 
				
			||||
<input type="hidden" name="formSent" value="1"> | 
				
			||||
<legend><?php echo $tool_name;?> </legend>
 | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="550"> | 
				
			||||
<tr> | 
				
			||||
  <td width="30%"><?php echo get_lang('SessionName') ?>  </td>
 | 
				
			||||
  <td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); else echo api_htmlentities($infos['name'],ENT_QUOTES,$charset); ?>"></td>
 | 
				
			||||
</tr> | 
				
			||||
<td colspan="2"> | 
				
			||||
	<a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('EditTimeLimit') ?></a>
 | 
				
			||||
		<div style="display: <?php if($formSent && ($nb_days_acess_before!=0 || $nb_days_acess_after!=0)) echo 'block'; else echo 'none'; ?>;" id="options">
 | 
				
			||||
	<br> | 
				
			||||
	<div> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%"> | 
				
			||||
<tr><td colspan="2"><?php echo get_lang('TheTimeLimitsAreReferential');?></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateStart') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if($day_start == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($day_start == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($day_start == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($day_start == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($day_start == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($day_start == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($day_start == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($day_start == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($day_start == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($day_start == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($day_start == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if($day_start == 13) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if($day_start == 14) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if($day_start == 15) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if($day_start == 16) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if($day_start == 17) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if($day_start == 18) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if($day_start == 19) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if($day_start == 20) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if($day_start == 21) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if($day_start == 22) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if($day_start == 23) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if($day_start == 24) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if($day_start == 25) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if($day_start == 26) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if($day_start == 27) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if($day_start == 28) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if($day_start == 29) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if($day_start == 30) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if($day_start == 31) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if($month_start == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($month_start == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($month_start == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($month_start == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($month_start == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($month_start == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($month_start == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($month_start == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($month_start == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($month_start == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($month_start == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_start"> | 
				
			||||
<?php | 
				
			||||
for($i=$thisYear-5;$i <= ($thisYear+5);$i++) | 
				
			||||
{ ?> | 
				
			||||
	<option value="<?php echo $i; ?>" <?php if($year_start == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} ?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateEnd') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
	<option value="1" <?php if($day_end == 1) echo 'selected="selected"'; ?> >01</option>
 | 
				
			||||
	<option value="2" <?php if($day_end == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($day_end == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($day_end == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($day_end == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($day_end == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($day_end == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($day_end == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($day_end == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($day_end == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($day_end == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($day_end == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if($day_end == 13) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if($day_end == 14) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if($day_end == 15) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if($day_end == 16) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if($day_end == 17) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if($day_end == 18) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if($day_end == 19) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if($day_end == 20) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if($day_end == 21) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if($day_end == 22) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if($day_end == 23) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if($day_end == 24) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if($day_end == 25) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if($day_end == 26) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if($day_end == 27) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if($day_end == 28) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if($day_end == 29) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if($day_end == 30) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if($day_end == 31) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
	<option value="1" <?php if($month_end == 1) echo 'selected="selected"'; ?> >01</option>
 | 
				
			||||
	<option value="2" <?php if($month_end == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($month_end == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($month_end == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($month_end == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($month_end == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($month_end == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($month_end == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($month_end == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($month_end == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($month_end == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($month_end == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_end"> | 
				
			||||
     <option value="0">----</option> | 
				
			||||
    <?php | 
				
			||||
    for($i=$thisYear-5;$i <= ($thisYear+5);$i++) | 
				
			||||
    { ?> | 
				
			||||
     <option value="<?php echo $i; ?>" <?php if($year_end == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
    <?php | 
				
			||||
} ?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
</div> | 
				
			||||
<br> | 
				
			||||
</div> | 
				
			||||
</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td> </td> | 
				
			||||
  <td> | 
				
			||||
<button class="save" type="submit" value="<?php echo get_lang('ModifyThisSession') ?>">
 | 
				
			||||
    <?php echo get_lang('ModifyThisSession') ?></button>
 | 
				
			||||
 | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
</table> | 
				
			||||
</form> | 
				
			||||
<script> | 
				
			||||
<?php if($year_start=="0000") echo "setDisable(document.form.nolimit);\r\n"; ?> | 
				
			||||
function setDisable(select){ | 
				
			||||
	document.form.day_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.day_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_end.disabled = (select.checked) ? true : false; | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
Display::display_footer(); | 
				
			||||
<?php | 
				
			||||
/* For licensing terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
 * Edition script for sessions categories | 
				
			||||
 * @package chamilo.admin | 
				
			||||
 */ | 
				
			||||
$cidReset = true; | 
				
			||||
require_once '../inc/global.inc.php'; | 
				
			||||
 | 
				
			||||
// setting the section (for the tabs) | 
				
			||||
$this_section = SECTION_PLATFORM_ADMIN; | 
				
			||||
api_protect_admin_script(true); | 
				
			||||
$id = intval($_GET['id']); | 
				
			||||
$formSent = 0; | 
				
			||||
$errorMsg = ''; | 
				
			||||
 | 
				
			||||
// Database Table Definitions | 
				
			||||
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); | 
				
			||||
$tool_name = get_lang('EditSessionCategory'); | 
				
			||||
$interbreadcrumb[] = array( | 
				
			||||
    'url' => 'index.php', | 
				
			||||
    "name" => get_lang('PlatformAdmin') | 
				
			||||
); | 
				
			||||
$interbreadcrumb[] = array( | 
				
			||||
    'url' => "session_category_list.php", | 
				
			||||
    "name" => get_lang('ListSessionCategory') | 
				
			||||
); | 
				
			||||
 | 
				
			||||
$sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name"; | 
				
			||||
$result=Database::query($sql); | 
				
			||||
if (!$infos=Database::fetch_array($result)) { | 
				
			||||
	header('Location: session_list.php'); | 
				
			||||
	exit(); | 
				
			||||
} | 
				
			||||
list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']); | 
				
			||||
list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']); | 
				
			||||
 | 
				
			||||
if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) { | 
				
			||||
	api_not_allowed(true); | 
				
			||||
} | 
				
			||||
 | 
				
			||||
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']; | 
				
			||||
    $return = SessionManager::edit_category_session( | 
				
			||||
        $id, | 
				
			||||
        $name, | 
				
			||||
        $year_start, | 
				
			||||
        $month_start, | 
				
			||||
        $day_start, | 
				
			||||
        $year_end, | 
				
			||||
        $month_end, | 
				
			||||
        $day_end | 
				
			||||
    ); | 
				
			||||
    if ($return == strval(intval($return))) { | 
				
			||||
        header( | 
				
			||||
            'Location: session_category_list.php?action=show_message&message=' . urlencode( | 
				
			||||
                get_lang('SessionCategoryUpdate') | 
				
			||||
            ) | 
				
			||||
        ); | 
				
			||||
        exit(); | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
$thisYear = date('Y'); | 
				
			||||
$thisMonth = date('m'); | 
				
			||||
$thisDay = date('d'); | 
				
			||||
 | 
				
			||||
// display the header | 
				
			||||
Display::display_header($tool_name); | 
				
			||||
if (!empty($return)) { | 
				
			||||
	Display::display_error_message($return,false); | 
				
			||||
} | 
				
			||||
?> | 
				
			||||
<form method="post" name="form" action="<?php echo api_get_self(); ?>?id=<?php echo $id; ?>">
 | 
				
			||||
<input type="hidden" name="formSent" value="1"> | 
				
			||||
<legend><?php echo $tool_name;?> </legend>
 | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="550"> | 
				
			||||
<tr> | 
				
			||||
  <td width="30%"><?php echo get_lang('SessionName') ?>  </td>
 | 
				
			||||
  <td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); else echo api_htmlentities($infos['name'],ENT_QUOTES,$charset); ?>"></td>
 | 
				
			||||
</tr> | 
				
			||||
<td colspan="2"> | 
				
			||||
	<a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('EditTimeLimit') ?></a>
 | 
				
			||||
		<div style="display: <?php if($formSent && ($nb_days_acess_before!=0 || $nb_days_acess_after!=0)) echo 'block'; else echo 'none'; ?>;" id="options">
 | 
				
			||||
	<br> | 
				
			||||
	<div> | 
				
			||||
<table border="0" cellpadding="5" cellspacing="0" width="100%"> | 
				
			||||
<tr><td colspan="2"><?php echo get_lang('TheTimeLimitsAreReferential');?></td>
 | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateStart') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if($day_start == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($day_start == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($day_start == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($day_start == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($day_start == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($day_start == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($day_start == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($day_start == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($day_start == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($day_start == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($day_start == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if($day_start == 13) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if($day_start == 14) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if($day_start == 15) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if($day_start == 16) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if($day_start == 17) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if($day_start == 18) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if($day_start == 19) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if($day_start == 20) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if($day_start == 21) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if($day_start == 22) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if($day_start == 23) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if($day_start == 24) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if($day_start == 25) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if($day_start == 26) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if($day_start == 27) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if($day_start == 28) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if($day_start == 29) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if($day_start == 30) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if($day_start == 31) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_start"> | 
				
			||||
	<option value="1">01</option> | 
				
			||||
	<option value="2" <?php if($month_start == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($month_start == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($month_start == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($month_start == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($month_start == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($month_start == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($month_start == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($month_start == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($month_start == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($month_start == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($month_start == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_start"> | 
				
			||||
<?php | 
				
			||||
for($i=$thisYear-5;$i <= ($thisYear+5);$i++) | 
				
			||||
{ ?> | 
				
			||||
	<option value="<?php echo $i; ?>" <?php if($year_start == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
<?php | 
				
			||||
} ?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td width="20%"><?php echo get_lang('DateEnd') ?>  </td>
 | 
				
			||||
  <td width="80%"> | 
				
			||||
  <select name="day_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
	<option value="1" <?php if($day_end == 1) echo 'selected="selected"'; ?> >01</option>
 | 
				
			||||
	<option value="2" <?php if($day_end == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($day_end == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($day_end == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($day_end == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($day_end == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($day_end == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($day_end == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($day_end == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($day_end == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($day_end == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($day_end == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
	<option value="13" <?php if($day_end == 13) echo 'selected="selected"'; ?> >13</option>
 | 
				
			||||
	<option value="14" <?php if($day_end == 14) echo 'selected="selected"'; ?> >14</option>
 | 
				
			||||
	<option value="15" <?php if($day_end == 15) echo 'selected="selected"'; ?> >15</option>
 | 
				
			||||
	<option value="16" <?php if($day_end == 16) echo 'selected="selected"'; ?> >16</option>
 | 
				
			||||
	<option value="17" <?php if($day_end == 17) echo 'selected="selected"'; ?> >17</option>
 | 
				
			||||
	<option value="18" <?php if($day_end == 18) echo 'selected="selected"'; ?> >18</option>
 | 
				
			||||
	<option value="19" <?php if($day_end == 19) echo 'selected="selected"'; ?> >19</option>
 | 
				
			||||
	<option value="20" <?php if($day_end == 20) echo 'selected="selected"'; ?> >20</option>
 | 
				
			||||
	<option value="21" <?php if($day_end == 21) echo 'selected="selected"'; ?> >21</option>
 | 
				
			||||
	<option value="22" <?php if($day_end == 22) echo 'selected="selected"'; ?> >22</option>
 | 
				
			||||
	<option value="23" <?php if($day_end == 23) echo 'selected="selected"'; ?> >23</option>
 | 
				
			||||
	<option value="24" <?php if($day_end == 24) echo 'selected="selected"'; ?> >24</option>
 | 
				
			||||
	<option value="25" <?php if($day_end == 25) echo 'selected="selected"'; ?> >25</option>
 | 
				
			||||
	<option value="26" <?php if($day_end == 26) echo 'selected="selected"'; ?> >26</option>
 | 
				
			||||
	<option value="27" <?php if($day_end == 27) echo 'selected="selected"'; ?> >27</option>
 | 
				
			||||
	<option value="28" <?php if($day_end == 28) echo 'selected="selected"'; ?> >28</option>
 | 
				
			||||
	<option value="29" <?php if($day_end == 29) echo 'selected="selected"'; ?> >29</option>
 | 
				
			||||
	<option value="30" <?php if($day_end == 30) echo 'selected="selected"'; ?> >30</option>
 | 
				
			||||
	<option value="31" <?php if($day_end == 31) echo 'selected="selected"'; ?> >31</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="month_end"> | 
				
			||||
	<option value="0">--</option> | 
				
			||||
	<option value="1" <?php if($month_end == 1) echo 'selected="selected"'; ?> >01</option>
 | 
				
			||||
	<option value="2" <?php if($month_end == 2) echo 'selected="selected"'; ?> >02</option>
 | 
				
			||||
	<option value="3" <?php if($month_end == 3) echo 'selected="selected"'; ?> >03</option>
 | 
				
			||||
	<option value="4" <?php if($month_end == 4) echo 'selected="selected"'; ?> >04</option>
 | 
				
			||||
	<option value="5" <?php if($month_end == 5) echo 'selected="selected"'; ?> >05</option>
 | 
				
			||||
	<option value="6" <?php if($month_end == 6) echo 'selected="selected"'; ?> >06</option>
 | 
				
			||||
	<option value="7" <?php if($month_end == 7) echo 'selected="selected"'; ?> >07</option>
 | 
				
			||||
	<option value="8" <?php if($month_end == 8) echo 'selected="selected"'; ?> >08</option>
 | 
				
			||||
	<option value="9" <?php if($month_end == 9) echo 'selected="selected"'; ?> >09</option>
 | 
				
			||||
	<option value="10" <?php if($month_end == 10) echo 'selected="selected"'; ?> >10</option>
 | 
				
			||||
	<option value="11" <?php if($month_end == 11) echo 'selected="selected"'; ?> >11</option>
 | 
				
			||||
	<option value="12" <?php if($month_end == 12) echo 'selected="selected"'; ?> >12</option>
 | 
				
			||||
  </select> | 
				
			||||
  / | 
				
			||||
  <select name="year_end"> | 
				
			||||
     <option value="0">----</option> | 
				
			||||
    <?php | 
				
			||||
    for($i=$thisYear-5;$i <= ($thisYear+5);$i++) | 
				
			||||
    { ?> | 
				
			||||
     <option value="<?php echo $i; ?>" <?php if($year_end == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
 | 
				
			||||
    <?php | 
				
			||||
} ?> | 
				
			||||
  </select> | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
 | 
				
			||||
</table> | 
				
			||||
</div> | 
				
			||||
<br> | 
				
			||||
</div> | 
				
			||||
</td> | 
				
			||||
</tr> | 
				
			||||
<tr> | 
				
			||||
  <td> </td> | 
				
			||||
  <td> | 
				
			||||
<button class="save" type="submit" value="<?php echo get_lang('ModifyThisSession') ?>">
 | 
				
			||||
    <?php echo get_lang('ModifyThisSession') ?></button>
 | 
				
			||||
 | 
				
			||||
  </td> | 
				
			||||
</tr> | 
				
			||||
</table> | 
				
			||||
</form> | 
				
			||||
<script> | 
				
			||||
<?php if($year_start=="0000") echo "setDisable(document.form.nolimit);\r\n"; ?> | 
				
			||||
function setDisable(select){ | 
				
			||||
	document.form.day_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_start.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.day_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.month_end.disabled = (select.checked) ? true : false; | 
				
			||||
	document.form.year_end.disabled = (select.checked) ? true : false; | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
<?php | 
				
			||||
Display::display_footer(); | 
				
			||||
					Loading…
					
					
				
		Reference in new issue