"index.php", "name" => get_lang('MySpace')); if (isset($_GET["id_session"]) && $_GET["id_session"] != "") { $interbreadcrumb[] = array("url" => "session.php", "name" => get_lang('Sessions')); } if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") { $interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors')); } if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "student") { $interbreadcrumb[] = array("url" => "student.php", "name" => get_lang('Students')); } if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) { $interbreadcrumb[] = array("url" => "teachers.php", "name" => get_lang('Teachers')); } function count_courses() { global $nb_courses; return $nb_courses; } //checking if the current coach is the admin coach $show_import_icon = false; if (api_get_setting('add_users_by_coach') == 'true') { if (!api_is_platform_admin()) { $sql = 'SELECT id_coach FROM '.Database::get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$sessionId; $rs = Database::query($sql); if (Database::result($rs, 0, 0) != $_user['user_id']) { api_not_allowed(true); } else { $show_import_icon = true; } } } Display :: display_header($nameTools); $a_courses = array(); if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) { $title = ''; if (empty($sessionId)) { if (isset($_GET['user_id'])) { $user_id = intval($_GET['user_id']); $user_info = api_get_user_info($user_id); $title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']); $courses = CourseManager::get_course_list_of_user_as_course_admin($user_id); } else { $title = get_lang('YourCourseList'); $courses = CourseManager::get_courses_followed_by_drh(api_get_user_id()); } } else { $session_name = api_get_session_name($sessionId); $title = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession'); $courses = Tracking::get_courses_list_from_session($sessionId); } $a_courses = array_keys($courses); if (!api_is_session_admin()) { $menu_items[] = Display::url( Display::return_icon('stats.png', get_lang('MyStats'),'',ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php" ); $menu_items[] = Display::url( Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), "index.php?view=drh_students&display=yourstudents" ); $menu_items[] = Display::url( Display::return_icon('teacher.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php' ); $menu_items[] = Display::url( Display::return_icon('course_na.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), '#' ); $menu_items[] = Display::url( Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_MEDIUM), 'session.php' ); if (api_can_login_as($user_id)) { $link = ''. Display::return_icon('login_as.png', get_lang('LoginAs'), null, ICON_SIZE_MEDIUM).' '; $menu_items[] = $link; } } $actionsLeft = $actionsRight = ''; $nb_menu_items = count($menu_items); if ($nb_menu_items > 1) { foreach ($menu_items as $key => $item) { $actionsLeft .= $item; } } if (count($a_courses) > 0) { $actionsRight .= Display::url( Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick'=>'javascript: window.print();') ); } $toolbar = Display::toolbarAction('toolbar-course', $content = array( 0 => $actionsLeft, 1 => $actionsRight )); echo $toolbar; echo Display::page_header($title); } // Database Table Definitions $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $tbl_user_course = Database::get_main_table(TABLE_MAIN_COURSE_USER); if ($show_import_icon) { echo "
';
$title = Display::url(
$data['title'],
$courseInfo['course_public_url'].'?id_session='.$sessionId
);
$attendanceLink = Display::url(
Display::return_icon('attendance_list.png', get_lang('Attendance'), array(), ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$courseCode.'&id_session='.$sessionId.'&action=calendar_logins'
);
$courseList[] = array(
$title,
$countStudents,
is_null($avgTimeSpentInCourse) ? '-' : $avgTimeSpentInCourse,
$tematicAdvanceProgress,
is_null($avgProgressInCourse) ? '-' : $avgProgressInCourse.'%',
is_null($avgScoreInCourse) ? '-' : $avgScoreInCourse,
is_null($messagesInCourse) ? '-' : $messagesInCourse,
is_null($assignmentsInCourse) ? '-' : $assignmentsInCourse,
$attendanceLink,
$courseIcon
);
}
}
return $courseList;
}
$table = new SortableTable(
'tracking_course',
'get_count_courses',
'get_courses',
1,
10
);
$table->set_header(0, get_lang('CourseTitle'), false);
$table->set_header(1, get_lang('NbStudents'), false);
$table->set_header(2, get_lang('TimeSpentInTheCourse').Display :: return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table->set_header(3, get_lang('ThematicAdvance'), false);
$table->set_header(4, get_lang('AvgStudentsProgress').Display :: return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table->set_header(5, get_lang('AvgCourseScore').Display :: return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table->set_header(6, get_lang('AvgMessages'), false);
$table->set_header(7, get_lang('AvgAssignments'), false);
$table->set_header(8, get_lang('Attendances'), false);
$table->set_header(9, get_lang('Details'), false);
$form = new FormValidator('search_course', 'get', api_get_path(WEB_CODE_PATH).'mySpace/course.php');
$form->addElement('text', 'keyword', get_lang('Keyword'));
$form->addButtonSearch(get_lang('Search'));
$form->addElement('hidden', 'session_id', $sessionId);
$keyword = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null;
$params = array(
'session_id' => $sessionId,
'keyword' => $keyword
);
$table->set_additional_parameters($params);
$form->setDefaults($params);
$form->display();
$table->display();
Display :: display_footer();