Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/report/stats/user.php File Reference

Go to the source code of this file.

Namespaces

namespace  report

Variables

 $userid = required_param('id', PARAM_INT)
 $courseid = required_param('course', PARAM_INT)
 $user = $DB->get_record('user', array('id'=>$userid, 'deleted'=>0), '*', MUST_EXIST)
 $course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST)
 $coursecontext = context_course::instance($course->id)
 $personalcontext = context_user::instance($user->id)
 $stractivityreport = get_string('activityreport')
if(empty($CFG->enablestats)) $statsstatus = stats_check_uptodate($course->id)
if($statsstatus!==NULL) $earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_daily}')
 $earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_weekly}')
 $earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_monthly}')
if(empty($earliestday)) if(empty($earliestweek))
if(empty($earliestmonth)) 
$now = stats_get_base_daily()
 $lastweekend = stats_get_base_weekly()
 $lastmonthend = stats_get_base_monthly()
 $timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth)
if(empty($timeoptions)) $time = array_pop(array_keys($timeoptions))
 $param = stats_get_parameters($time,STATS_REPORT_USER_VIEW,$course->id,STATS_MODE_DETAILED)
 $params = $param->params
$param table = 'user_'.$param->table
 $sql
 $stats = $DB->get_records_sql($sql, $params)
 $table = new html_table()
$table align = array('left','center','center','center')
switch($param->table) $table head = array(get_string('periodending','moodle',$period),$param->line1,$param->line2,$param->line3)
 foreach ($stats as $stat)

Variable Documentation

Definition at line 33 of file user.php.

$coursecontext = context_course::instance($course->id)

Definition at line 35 of file user.php.

Definition at line 30 of file user.php.

if ($statsstatus!==NULL) $earliestday = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_daily}')

Definition at line 74 of file user.php.

$earliestmonth = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_monthly}')

Definition at line 76 of file user.php.

$earliestweek = $DB->get_field_sql('SELECT MIN(timeend) FROM {stats_user_weekly}')

Definition at line 75 of file user.php.

$lastmonthend = stats_get_base_monthly()

Definition at line 90 of file user.php.

$lastweekend = stats_get_base_weekly()

Definition at line 89 of file user.php.

if (empty($earliestday)) if (empty($earliestweek)) if (empty($earliestmonth)) $now = stats_get_base_daily()

Definition at line 88 of file user.php.

$params = $param->params

Definition at line 102 of file user.php.

$personalcontext = context_user::instance($user->id)

Definition at line 36 of file user.php.

$sql
Initial value:
 'SELECT timeend,'.$param->fields.' FROM {stats_'.$param->table.'} WHERE '
.(($course->id == SITEID) ? '' : ' courseid = '.$course->id.' AND ')
    .' userid = '.$user->id.' AND timeend >= '.$param->timeafter .$param->extras
    .' ORDER BY timeend DESC'

Definition at line 106 of file user.php.

if (empty($stats)) if (!empty($CFG->gdversion)) $stats = $DB->get_records_sql($sql, $params)

Definition at line 110 of file user.php.

if (empty($CFG->enablestats)) $statsstatus = stats_check_uptodate($course->id)

Definition at line 69 of file user.php.

$stractivityreport = get_string('activityreport')

Definition at line 54 of file user.php.

$table = new html_table()

Definition at line 123 of file user.php.

if (empty($timeoptions)) $time = array_pop(array_keys($timeoptions))

Definition at line 99 of file user.php.

$timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth)

Definition at line 92 of file user.php.

$user = $DB->get_record('user', array('id'=>$userid, 'deleted'=>0), '*', MUST_EXIST)

Definition at line 32 of file user.php.

Definition at line 29 of file user.php.

$table align = array('left','center','center','center')

Definition at line 124 of file user.php.

foreach($stats as $stat)

Definition at line 133 of file user.php.

switch ($param->table) $table head = array(get_string('periodending','moodle',$period),$param->line1,$param->line2,$param->line3)

Definition at line 132 of file user.php.

$param table = 'user_'.$param->table

A class to manage calendar events

This class provides the required functionality in order to manage calendar events. It was introduced as part of Moodle 2.0 and was created in order to provide a better framework for dealing with calendar events in particular regard to file handling through the new file API

if this page is not within a module.

Definition at line 104 of file user.php.

 All Data Structures Namespaces Files Functions Variables Enumerations