示例#1
0
function get_count_users()
{
    $sleepingDays = isset($_GET['sleeping_days']) ? intval($_GET['sleeping_days']) : null;
    $active = isset($_GET['active']) ? $_GET['active'] : 1;
    $keyword = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null;
    $status = isset($_GET['status']) ? Security::remove_XSS($_GET['status']) : null;
    $lastConnectionDate = null;
    if (!empty($sleepingDays)) {
        $lastConnectionDate = api_get_utc_datetime(strtotime($sleepingDays . ' days ago'));
    }
    return SessionManager::getCountUserTracking($keyword, $active, $lastConnectionDate, null, null, $status);
}
示例#2
0
function get_count_users()
{
    $keyword = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null;
    $active = isset($_GET['active']) ? intval($_GET['active']) : 1;
    $sleepingDays = isset($_GET['sleeping_days']) ? intval($_GET['sleeping_days']) : null;
    $lastConnectionDate = null;
    if (!empty($sleepingDays)) {
        $lastConnectionDate = api_get_utc_datetime(strtotime($sleepingDays . ' days ago'));
    }
    $count = SessionManager::getCountUserTracking($keyword, $active, $lastConnectionDate, null, null, api_is_student_boss() ? null : STUDENT);
    return $count;
}
示例#3
0
if ($export_csv) {
    //csv part
    $csv_content[] = array(get_lang('Students'));
    $csv_content[] = array(get_lang('InactivesStudents'), $nb_inactive_students);
    $csv_content[] = array(get_lang('AverageTimeSpentOnThePlatform'), $avg_time_spent);
    $csv_content[] = array(get_lang('AverageCoursePerStudent'), $avg_courses_per_student);
    $csv_content[] = array(get_lang('AverageProgressInLearnpath'), is_null($avg_total_progress) ? null : round($avg_total_progress, 2) . '%');
    $csv_content[] = array(get_lang('AverageResultsToTheExercices'), is_null($avg_results_to_exercises) ? null : round($avg_results_to_exercises, 2) . '%');
    $csv_content[] = array(get_lang('AveragePostsInForum'), $nb_posts);
    $csv_content[] = array(get_lang('AverageAssignments'), $nb_assignments);
    $csv_content[] = array();
} else {
    $lastConnectionDate = api_get_utc_datetime(strtotime('15 days ago'));
    $countActiveUsers = SessionManager::getCountUserTracking(null, 1, null, array(), array());
    $countSleepingTeachers = SessionManager::getTeacherTracking(api_get_user_id(), 1, $lastConnectionDate, true, $sessionIdList);
    $countSleepingStudents = SessionManager::getCountUserTracking(null, 1, $lastConnectionDate, $sessionIdList, $studentIds);
    $form = new FormValidator('search_user', 'get', api_get_path(WEB_CODE_PATH) . 'mySpace/student.php');
    $form = Tracking::setUserSearchForm($form);
    $form->display();
    // html part
    echo '<div class="report_section">
            <table class="table table-bordered table-striped">
                <tr>
                    <td>' . get_lang('AverageCoursePerStudent') . '</td>
                    <td align="right">' . (is_null($avg_courses_per_student) ? '' : round($avg_courses_per_student, 2)) . '</td>
                </tr>
                <tr>
                    <td>' . get_lang('InactivesStudents') . '</td>
                    <td align="right">' . $nb_inactive_students . '</td>
                </tr>
                <tr>