Exemplo n.º 1
0
<?php

//This file cannot be called directly, only included.
if (str_replace(DIRECTORY_SEPARATOR, "/", __FILE__) == $_SERVER['SCRIPT_FILENAME']) {
    exit;
}
$smarty->assign("T_OPTION", $_GET['option']);
try {
    if (isset($_GET['sel_course'])) {
        require_once $path . "includes/statistics/stats_filters.php";
        $directionsTree = new EfrontDirectionsTree();
        $directionsPaths = $directionsTree->toPathString();
        $course_id = $_GET['sel_course'];
        $infoCourse = new EfrontCourse($_GET['sel_course']);
        $infoCourse->course['num_lessons'] = $infoCourse->countCourseLessons();
        $constraints = array('table_filters' => $stats_filters);
        //$infoCourse -> course['num_students']   = sizeof($infoCourse -> getStudentUsers(false, $constraints));
        //$infoCourse -> course['num_professors'] = sizeof($infoCourse -> getProfessorUsers(false, $constraints));
        $infoCourse->course['category_path'] = $directionsPaths[$infoCourse->course['directions_ID']];
        $smarty->assign("T_CURRENT_COURSE", $infoCourse);
        $smarty->assign("T_STATS_ENTITY_ID", $_GET['sel_course']);
        try {
            $result = eF_getTableData("user_times ut join users_to_courses uc on ut.users_LOGIN=uc.users_LOGIN and ut.courses_ID=uc.courses_ID", "sum(time) as sum, count(distinct uc.users_LOGIN) as count", "completed=1 and uc.archive=0 and ut.courses_ID=" . $infoCourse->course['id'], "", "");
            if ($result[0]['sum']) {
                $smarty->assign("T_AVERAGE_COMPLETION_TIME", EfrontTimes::formatTimeForReporting($result[0]['sum'] / $result[0]['count']));
            }
            $roles = EfrontLessonUser::getLessonsRoles(true);
            $smarty->assign("T_ROLES_ARRAY", $roles);
            $rolesBasic = EfrontLessonUser::getLessonsRoles();
            $smarty->assign("T_BASIC_ROLES_ARRAY", $rolesBasic);
            foreach ($rolesBasic as $key => $role) {