示例#1
0
     $line = '';
     //Total
     $sql = "SELECT count(*)\n                FROM {$TABLETRACK_ACCESS}\n                WHERE c_id = {$courseId}\n                    AND access_tool IS NULL";
     $count = StatsUtils::getOneResult($sql);
     $line .= get_lang('CountToolAccess') . " ; " . $count . "\n";
     // last 31 days
     $sql = "SELECT count(*)\n                FROM {$TABLETRACK_ACCESS}\n                WHERE c_id = {$courseId}\n                    AND (access_date > DATE_ADD(CURDATE(), INTERVAL -31 DAY))\n                    AND access_tool IS NULL";
     $count = StatsUtils::getOneResult($sql);
     $line .= get_lang('Last31days') . " ; " . $count . "\n";
     // last 7 days
     $sql = "SELECT count(*)\n                FROM {$TABLETRACK_ACCESS}\n                WHERE c_id = {$courseId}\n                    AND (access_date > DATE_ADD(CURDATE(), INTERVAL -7 DAY))\n                    AND access_tool IS NULL";
     $count = StatsUtils::getOneResult($sql);
     $line .= get_lang('Last7days') . " ; " . $count . "\n";
     // today
     $sql = "SELECT count(*)\n                FROM {$TABLETRACK_ACCESS}\n                WHERE c_id = {$courseId}\n                    AND ( access_date > CURDATE() )\n                    AND access_tool IS NULL";
     $count = StatsUtils::getOneResult($sql);
     $line .= get_lang('ThisDay') . " ; " . $count . "\n";
 }
 /* 	Tools */
 $tempView = $view;
 if ($view[2] == '1') {
     $tempView[2] = '0';
     $title[1] = $nameTools;
     $line = '';
     $title_line = get_lang('ToolTitleToolnameColumn') . ";" . get_lang('ToolTitleUsersColumn') . ";" . get_lang('ToolTitleCountColumn') . "\n";
     $sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool )\n                FROM {$TABLETRACK_ACCESS}\n                WHERE access_tool IS NOT NULL\n                    AND c_id = {$courseId}\n                GROUP BY access_tool";
     $results = getManyResults3Col($sql);
     if (is_array($results)) {
         for ($j = 0; $j < count($results); $j++) {
             $line .= $results[$j][0] . "/" . get_lang($results[$j][0]) . ";" . $results[$j][1] . ";" . $results[$j][2] . "\n";
         }
示例#2
0
$line = '';
$title_line = '';
// check if uid is tutor of this group
if ($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse) {
    if (!$uInfo && !isset($uInfo)) {
        /*
         * Display list of user of this group
         */
        if ($is_allowedToTrackEverybodyInCourse) {
            // if user can track everybody : list user of course
            $sql = "SELECT count(user_id)\n                    FROM {$TABLECOURSUSER}\n                    WHERE c_id = '{$courseId}' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . "";
        } else {
            // if user can only track one group : list users of this group
            $sql = "SELECT count(user)\n                        FROM {$TABLECOURSE_GROUPSUSER}\n                        WHERE group_id = '{$_gid}'";
        }
        $userGroupNb = StatsUtils::getOneResult($sql);
        $step = 25;
        // number of student per page
        if ($userGroupNb > $step) {
            if (!isset($offset)) {
                $offset = 0;
            }
            $next = $offset + $step;
            $previous = $offset - $step;
            $navLink = "";
            if ($previous >= 0) {
            }
            if ($next < $userGroupNb) {
            }
        } else {
            $offset = 0;