'; // start of content for logged in users
$special_course_list = UserManager::get_special_course_list();
if(count($special_course_list)>0) {
echo '
';
foreach ($special_course_list as $my_course) {
//$list[] = get_logged_user_course_html($my_course, 0, null, true);
}
if ( is_array($list) ) {
//Courses whithout sessions
$old_user_category = 0;
foreach($list as $key=>$value) {
if ( empty($value[2]) ) { //if out of any session
$userdefined_categories = get_user_course_categories();
echo '
';
if ($old_user_category<>$value[0]) {
if ($key<>0 OR $value[0]<>0) {// there are courses in the previous category
echo "\n
";
}
echo "\n\n\t
- ".$userdefined_categories[$value[0]]."
\n";
if ($key<>0 OR $value[0]<>0){ // there are courses in the previous category
echo "
";
}
$old_user_category=$value[0];
}
echo $value[1];
echo "
\n";
}
}
}
echo '
';
}
if ($key == 0) {
// sessions and courses that are not in a session category
if (!isset($_GET['history'])) { // check if it's not history trainnign session list
// independent courses
if(count($category['courses']) > 0) {
echo '
';
}
foreach ($category['courses'] as $course) {
$c = get_logged_user_course_html($course, 0, 'independent_course_item');
echo $c[1];
}
if(count($category['courses']) > 0) {
echo '
';
}
}
//independent sessions
foreach ($category['sessions'] as $session) {
//don't show empty sessions
if (count($session['courses'])<1) { continue; }
echo '
';
echo '- ';
echo Display::return_icon('div_show.gif', get_lang('Expand'), array('align' => 'absmiddle', 'id' => 'session_img_'.$session['details']['id'])) . ' ';
$s = get_session_title_box($session['details']['id']);
echo get_lang('SessionName') . ': ' . $s['title']. ' - '.(!empty($s['coach'])?$s['coach'].' - ':'').$s['dates'];
echo '
';
//courses inside the current session
foreach ($session['courses'] as $course) {
$c = get_logged_user_course_html($course, $session['details']['id'], 'session_course_item');
echo $c[1];
}
echo '
';
}
} else {
// all sessions included in
if (!empty($category['details'])) {
echo '
';
echo '
'. Display::return_icon('div_show.gif', get_lang('Expand'), array('align' => 'absmiddle', 'id' => 'category_img_'.$category['details']['id'])) . ' ' . get_lang('SessionCategory') . ': ' . $category['details']['name'].' - '.get_lang('From').' '.$category['details']['date_start'].' '.get_lang('Until').' '.$category['details']['date_end'].'
';
foreach ($category['sessions'] as $session) {
//don't show empty sessions
if (count($session['courses'])<1) { continue; }
echo '
';
echo '- ';
echo Display::return_icon('div_show.gif', get_lang('Expand'), array('align' => 'absmiddle', 'id' => 'session_img_'.$session['details']['id'])) . ' ';
$s = get_session_title_box($session['details']['id']);
echo get_lang('SessionName') . ': ' . $s['title']. ' - '.(!empty($s['coach'])?$s['coach'].' - ':'').$s['dates'];
echo '
';
foreach ($session['courses'] as $course) {
//echo '- ';
$c = get_logged_user_course_html($course, $session['details']['id'], 'session_course_item');
//var_dump($c);
echo $c[1];
//echo $course['code'];
//echo '
';
}
echo '
';
}
echo '
';
}
}
}
}
/*
if ( is_array($list) ) {
//Courses whithout sessions
$old_user_category = 0;
foreach ($list as $key => $value) {
if (empty($value[2])) { //if out of any session
$userdefined_categories = get_user_course_categories();
echo '
';
if ($old_user_category<>$value[0]) {
if ($key <> 0 || $value[0] <> 0) {// there are courses in the previous category
echo "\n
";
}
echo "\n\n\t
- ".$userdefined_categories[$value[0]]."
\n";
if ($key<>0 OR $value[0]<>0){ // there are courses in the previous category
echo "
";
}
$old_user_category = $value[0];
}
echo $value[1];
echo "
\n";
}
}
$listActives = $listInactives = $listCourses = array();
foreach ($list as $key => $value) {
if ($value['active']) { //if the session is still active (as told by get_logged_user_course_html())
$listActives[] = $value;
} else if (!empty($value[2])) { //if there is a session but it is not active
$listInactives[] = $value;
}
}
$old_user_category = 0;
$userdefined_categories = get_user_course_categories();
if (count($listActives) > 0 && $display_actives) {
echo "
\n";
$name_category = array();
$i = 0;
$j=0;
foreach ($listActives as $key => $value) {
$session_category_id=$value['session_category_id'];
if (!empty($value[3]['category'])) {
if (!in_array($value[3]['category'], $name_category)) {
if ($key != 0) {
echo '
';
}
//Category
$name_category['name'] = $value[3]['category'];
echo '
' .
'- '.$name_category['name'].'
';
echo "
\n";
}
}
if (!empty($value[2])) {
if ((isset($old_session) && $old_session != $value[2]) or ((!isset($old_session)) && isset($value[2]))) {
$old_session = $value[2];
if ($key != 0) {
echo '';
}
//Session
echo '
' .
'- '.$value[3]['title'].' '.$value[3]['dates'].'
';
if ( !empty($value[3]['coach']) ) {
echo '- '.$value[3]['coach'].'
';
}
echo "
\n";
echo '
';
}
}
//Courses
echo $value[1];
$i++;
}
echo "\n
\n";
}
if (count($listInactives) > 0 && !$display_actives) {
echo '
';
foreach ($listInactives as $key => $value) {
if (!empty($value[2])) {
if ($old_session != $value[2]) {
$old_session = $value[2];
if ($key != 0) {
echo '
';
}
echo '
' .
'- '.$value[3]['title'].' '.$value[3]['dates'].'
';
if (!empty($value[3]['coach'])) {
echo '- '.$value[3]['coach'].'
';
}
echo "
\n";
echo '
';
}
}
echo $value[1];
}
echo "\n
\n";
}
} */
echo '
'; // end of content section
// Register whether full admin or null admin course
// by course through an array dbname x user status
api_session_register('status');
/*
==============================================================================
RIGHT MENU
==============================================================================
*/
echo ' '; // end of menu
//footer
Display :: display_footer();