From 3ed4068ee1428494f740f0ef78f88210c2a6726d Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 29 May 2006 09:03:13 +0000 Subject: [PATCH] Cleaned up admin reports a little --- admin/report/courseoverview/mod.php | 45 ++++++++++++++++++++++++++++- theme/standard/styles_color.css | 1 + 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/admin/report/courseoverview/mod.php b/admin/report/courseoverview/mod.php index 93df6234843..e75d975d188 100644 --- a/admin/report/courseoverview/mod.php +++ b/admin/report/courseoverview/mod.php @@ -5,7 +5,50 @@ } if (!empty($CFG->enablestats)) { - echo ''.get_string('courseoverview').''; + + $strreports = get_string('reports'); + $strcourseoverview = get_string('courseoverview'); + + print_heading("$strcourseoverview:"); + + require_once($CFG->dirroot.'/lib/statslib.php'); + + $report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT); + $time = optional_param('time', 0, PARAM_INT); + $numcourses = optional_param('numcourses', 20, PARAM_INT); + + $course = get_site(); + stats_check_uptodate($course->id); + + + $reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED); + + $tableprefix = $CFG->prefix.'stats_'; + + $earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1'); + $earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1'); + $earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1'); + + if (empty($earliestday)) $earliestday = time(); + if (empty($earliestweek)) $earliestweek = time(); + if (empty($earliestmonth)) $earliestmonth = time(); + + $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); + + $table->width = '*'; + $table->align = array('left','left','left','left','left','left'); + $table->data[] = array(get_string('statsreporttype'),choose_from_menu($reportoptions,'report',$report,'','','',true), + get_string('statstimeperiod'),choose_from_menu($timeoptions,'time',$time,'','','',true), + '', + '') ; + + echo '
'."\n"; + print_table($table); + echo '
'; } ?> diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index d72a0a5bfa9..1f3b3ae648c 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -520,6 +520,7 @@ body#course-user .section { border-color:#AAAAAA; } +#admin-report .plugin, #course-report .plugin, #course-import .plugin { margin-bottom: 20px;