|
|
|
|
@ -54,13 +54,70 @@ function count_teacher_courses() |
|
|
|
|
***************************/ |
|
|
|
|
|
|
|
|
|
$isCoach = api_is_coach(); |
|
|
|
|
$isPlatformAdmin = api_is_platform_admin(); |
|
|
|
|
|
|
|
|
|
$view = isset($_GET['view']) ? $_GET['view'] : 'teacher'; |
|
|
|
|
|
|
|
|
|
$menu_items = array(); |
|
|
|
|
|
|
|
|
|
if(api_is_allowed_to_create_course()) |
|
|
|
|
{ |
|
|
|
|
if(!$isCoach && !api_is_platform_admin()) |
|
|
|
|
{ |
|
|
|
|
$view = 'teacher'; |
|
|
|
|
} |
|
|
|
|
if($view=='teacher') |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = get_lang('TeacherInterface'); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = '<a href="'.api_get_self().'?view=teacher">'.get_lang('TeacherInterface').'</a>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if($isCoach) |
|
|
|
|
{ |
|
|
|
|
if(!api_is_allowed_to_create_course() && !api_is_platform_admin()) |
|
|
|
|
{ |
|
|
|
|
$view = 'teacher'; |
|
|
|
|
} |
|
|
|
|
if($view=='coach') |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = get_lang('CoachInterface'); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = '<a href="'.api_get_self().'?view=coach">'.get_lang('CoachInterface').'</a>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(api_is_platform_admin) |
|
|
|
|
{ |
|
|
|
|
if($view=='admin') |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = get_lang('AdminInterface'); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$menu_items[] = '<a href="'.api_get_self().'?view=admin">'.get_lang('AdminInterface').'</a>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$nb_menu_items = count($menu_items); |
|
|
|
|
foreach($menu_items as $key=> $item) |
|
|
|
|
{ |
|
|
|
|
echo $item; |
|
|
|
|
if($key!=$nb_menu_items-1) |
|
|
|
|
{ |
|
|
|
|
echo ' | '; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '<div align="right"> |
|
|
|
|
<a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif"> '.get_lang('Print').'</a> |
|
|
|
|
<a href="'.$_SERVER['PHP_SELF'].'?export=csv"><img align="absbottom" src="../img/excel.gif"> '.get_lang('ExportAsCSV').'</a> |
|
|
|
|
</div>'; |
|
|
|
|
|
|
|
|
|
if($isCoach) |
|
|
|
|
if($isCoach && $view=='coach') |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
/**************************************** |
|
|
|
|
@ -331,18 +388,22 @@ if($isCoach) |
|
|
|
|
|
|
|
|
|
echo '<div class="clear"> </div>'; |
|
|
|
|
|
|
|
|
|
$sqlNbCours = " SELECT course_rel_user.course_code, course.title |
|
|
|
|
|
|
|
|
|
if(api_is_allowed_to_create_course() && $view=='teacher') |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
$sqlNbCours = " SELECT course_rel_user.course_code, course.title |
|
|
|
|
FROM $tbl_course_user as course_rel_user |
|
|
|
|
INNER JOIN $tbl_course as course |
|
|
|
|
ON course.code = course_rel_user.course_code |
|
|
|
|
WHERE course_rel_user.user_id='".$_user['user_id']."' AND course_rel_user.status='1' |
|
|
|
|
"; |
|
|
|
|
$resultNbCours = api_sql_query($sqlNbCours, __FILE__, __LINE__); |
|
|
|
|
$a_courses = api_store_result($resultNbCours); |
|
|
|
|
$nb_teacher_courses = count($a_courses); |
|
|
|
|
$resultNbCours = api_sql_query($sqlNbCours, __FILE__, __LINE__); |
|
|
|
|
$a_courses = api_store_result($resultNbCours); |
|
|
|
|
$nb_teacher_courses = count($a_courses); |
|
|
|
|
|
|
|
|
|
if($nb_teacher_courses) |
|
|
|
|
{ |
|
|
|
|
if($nb_teacher_courses) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$table = new SortableTable('tracking_list_course', 'count_teacher_courses'); |
|
|
|
|
@ -450,6 +511,7 @@ if($nb_teacher_courses) |
|
|
|
|
$table -> updateColAttributes(7,array('align'=>'center')); |
|
|
|
|
$table -> display(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|