Minor - update to coding conventions

skala
Yannick Warnier 16 years ago
parent 203991f548
commit 06a0f3b67e
  1. 72
      main/admin/statistics/index.php

@ -1,29 +1,8 @@
<?php <?php
// $Id: index.php 8216 2006-11-3 18:03:15 NushiFirefox $ /* For licensing terms, see /license.txt */
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2006 Bart Mollet <bart.mollet@hogent.be>
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== * This tool show global statistics on general platform events
* This tool allows the use statistics * @package chamilo.statistics
* @package dokeos.statistics
==============================================================================
*/ */
// Language files that need to be included // Language files that need to be included
$language_file = array('admin', 'tracking'); $language_file = array('admin', 'tracking');
@ -39,8 +18,7 @@ $tool_name = get_lang('Statistics');
Display::display_header($tool_name); Display::display_header($tool_name);
api_display_tool_title($tool_name); api_display_tool_title($tool_name);
if(!$_configuration['tracking_enabled']) if (!$_configuration['tracking_enabled']) {
{
Display::display_warning_message(get_lang('TrackingDisabled')); Display::display_warning_message(get_lang('TrackingDisabled'));
Display::display_footer(); Display::display_footer();
exit; exit;
@ -76,27 +54,23 @@ $tools[$strSocial]['action=messagereceived'] = get_lang('MessagesReceived');
$tools[$strSocial]['action=friends'] = get_lang('CountFriends'); $tools[$strSocial]['action=friends'] = get_lang('CountFriends');
echo '<table><tr>'; echo '<table><tr>';
foreach($tools as $section => $items) foreach ($tools as $section => $items) {
{ echo '<td valign="top">';
echo '<td valign="top">'; echo '<b>'.$section.'</b>';
echo '<b>'.$section.'</b>'; echo '<ul>';
echo '<ul>'; foreach ($items as $key => $value) {
foreach($items as $key => $value) echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>';
{ }
echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>'; echo '</ul>';
} echo '</td>';
echo '</ul>';
echo '</td>';
} }
echo '</tr></table>'; echo '</tr></table>';
$course_categories = statistics::get_course_categories(); $course_categories = statistics::get_course_categories();
echo '<br/><br/>'; echo '<br/><br/>';
switch($_GET['action']) switch ($_GET['action']) {
{
case 'courses': case 'courses':
// total amount of courses // total amount of courses
foreach($course_categories as $code => $name) foreach ($course_categories as $code => $name) {
{
$courses[$name] = statistics::count_courses($code); $courses[$name] = statistics::count_courses($code);
} }
// courses for each course category // courses for each course category
@ -105,14 +79,13 @@ switch($_GET['action'])
case 'users': case 'users':
// total amount of users // total amount of users
statistics::print_stats( statistics::print_stats(
get_lang('NumberOfUsers'), get_lang('NumberOfUsers'),
array( array(
get_lang('Teachers') => statistics::count_users(1,null,$_GET['count_invisible_courses']), get_lang('Teachers') => statistics::count_users(1,null,$_GET['count_invisible_courses']),
get_lang('Students') => statistics::count_users(5,null,$_GET['count_invisible_courses']) get_lang('Students') => statistics::count_users(5,null,$_GET['count_invisible_courses'])
) )
); );
foreach($course_categories as $code => $name) foreach ($course_categories as $code => $name) {
{
$name = str_replace(get_lang('Department'),"",$name); $name = str_replace(get_lang('Department'),"",$name);
$teachers[$name] = statistics::count_users(1,$code,$_GET['count_invisible_courses']); $teachers[$name] = statistics::count_users(1,$code,$_GET['count_invisible_courses']);
$students[$name] = statistics::count_users(5,$code,$_GET['count_invisible_courses']); $students[$name] = statistics::count_users(5,$code,$_GET['count_invisible_courses']);
@ -159,4 +132,3 @@ switch($_GET['action'])
} }
Display::display_footer(); Display::display_footer();
?>
Loading…
Cancel
Save