Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/main/mySpace/admin_view.php

112 lines
3.6 KiB

<?php
/* For licensing terms, see /license.txt */
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
$exportCSV = isset($_GET['export']) && $_GET['export'] === 'csv' ? true : false;
// Catch param export_csv from buttom
$exportCSV = isset($_GET['export_csv']) && $exportCSV == false ? true : false;
$display = isset($_GET['display']) ? Security::remove_XSS($_GET['display']) : null;
$htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '<script
type="text/javascript"
src="'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery.easy-pie-chart/dist/jquery.easypiechart.js"></script>
<script type="text/javascript">
// how hide a student based on BT#17648
function showHideStudent(el){
if($("#"+el).hasClass("hidden")){
$("#"+el).removeClass("hidden");
$("#"+el+"_").find(".icon_add").addClass("hidden");
$("#"+el+"_").find(".icon_remove").removeClass("hidden");
}else{
$("#"+el).addClass("hidden")
$("#"+el+"_").find(".icon_add").removeClass("hidden");
$("#"+el+"_").find(".icon_remove").addClass("hidden");
}
}
</script>';
// the section (for the tabs)
$this_section = SECTION_TRACKING;
$csv_content = [];
$nameTools = get_lang('MySpace');
$allowToTrack = api_is_platform_admin(true, true);
if (!$allowToTrack) {
api_not_allowed(true);
}
if ($exportCSV) {
if ('user' === $display) {
MySpace::export_tracking_user_overview();
exit;
} elseif ('session' === $display) {
MySpace::export_tracking_session_overview();
exit;
} elseif ('course' === $display) {
MySpace::export_tracking_course_overview();
exit;
} elseif ('company' === $display) {
// Getting dates
$startDate = isset($_GET['startDate']) ? $_GET['startDate'] : null;
$endDate = isset($_GET['endDate']) ? $_GET['endDate'] : null;
MySpace::export_company_resume_csv($startDate, $endDate);
exit;
}elseif ('learningPath' === $display) {
// Getting dates
$startDate = isset($_GET['startDate']) ? $_GET['startDate'] : null;
$endDate = isset($_GET['endDate']) ? $_GET['endDate'] : null;
MySpace::displayResumeLP($startDate, $endDate,true);
exit;
}
}
Display::display_header($nameTools);
echo '<div class="actions">';
echo MySpace::getTopMenu();
echo '</div>';
echo MySpace::getAdminActions();
switch ($display) {
case 'coaches':
MySpace::display_tracking_coach_overview($exportCSV);
break;
case 'user':
MySpace::display_tracking_user_overview();
break;
case 'session':
MySpace::display_tracking_session_overview();
break;
case 'course':
MySpace::display_tracking_course_overview();
break;
case 'company':
// Getting dates
$startDate = isset($_GET['startDate']) ? $_GET['startDate'] : null;
$endDate = isset($_GET['endDate']) ? $_GET['endDate'] : null;
MySpace::displayResumeCompany($startDate, $endDate);
break;
case 'learningPath':
// Getting dates
$startDate = isset($_GET['startDate']) ? $_GET['startDate'] : null;
$endDate = isset($_GET['endDate']) ? $_GET['endDate'] : null;
MySpace::displayResumeLP($startDate, $endDate);
break;
case 'accessoverview':
$courseId = isset($_GET['course_id']) ? (int) $_GET['course_id'] : 0;
$sessionId = isset($_GET['session_id']) ? (int) $_GET['session_id'] : 0;
$studentId = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0;
MySpace::displayTrackingAccessOverView($courseId, $sessionId, $studentId);
break;
}
Display::display_footer();