dokeos-statistics
[ class tree: dokeos-statistics ] [ index: dokeos-statistics ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. // $Id: index.php 8216 2006-11-3 18:03:15 NushiFirefox $
  3. /*
  4. ==============================================================================
  5.     Dokeos - elearning and course management software
  6.  
  7.     Copyright (c) 2006 Bart Mollet <bart.mollet@hogent.be>
  8.  
  9.     For a full list of contributors, see "credits.txt".
  10.     The full license can be read in "license.txt".
  11.  
  12.     This program is free software; you can redistribute it and/or
  13.     modify it under the terms of the GNU General Public License
  14.     as published by the Free Software Foundation; either version 2
  15.     of the License, or (at your option) any later version.
  16.  
  17.     See the GNU General Public License for more details.
  18.  
  19.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  20. ==============================================================================
  21. */
  22. /**
  23. ==============================================================================
  24. * This tool allows the use statistics
  25. @package dokeos.statistics
  26. ==============================================================================
  27. */
  28. // name of the language file that needs to be included
  29. $language_file=array('admin','tracking');
  30. $cidReset true;
  31.  
  32. include('../../inc/global.inc.php');
  33.  
  34. $interbreadcrumb[array ("url" => "../index.php""name" => get_lang('PlatformAdmin'));
  35.  
  36. $tool_name get_lang('ToolName');
  37. Display::display_header($tool_name);
  38.  
  39. if(!$_configuration['tracking_enabled'])
  40. {
  41.     Display::display_warning_message(get_lang('TrackingDisabled'));
  42.     exit;
  43. }
  44. require_once ('statistics.lib.php');
  45.  
  46.  
  47. $strCourse  get_lang('Courses');
  48. $strUsers get_lang('Users');
  49.  
  50.  
  51. $tools[$strCourse]['action=courses'get_lang('CountCours');
  52. $tools[$strCourse]['action=tools'get_lang('PlatformToolAccess');
  53. $tools[$strCourse]['action=courselastvisit'get_lang('LastAccess');
  54. $tools[$strCourse]['action=coursebylanguage'get_lang('CountCourseByLanguage');
  55.  
  56.  
  57. $tools[$strUsers]['action=users'get_lang('CountUsers');
  58. $tools[$strUsers]['action=recentlogins'get_lang('Logins');
  59. $tools[$strUsers]['action=logins&amp;type=month'get_lang('Logins').' ('.get_lang('PeriodMonth').')';
  60. $tools[$strUsers]['action=logins&amp;type=day'get_lang('Logins').' ('.get_lang('PeriodDay').')';
  61. $tools[$strUsers]['action=logins&amp;type=hour'get_lang('Logins').' ('.get_lang('PeriodHour').')';
  62. $tools[$strUsers]['action=pictures'get_lang('CountUsers').' ('.get_lang('UserPicture').')';
  63.  
  64.  
  65.  
  66. echo '<table><tr>';
  67. foreach($tools as $section => $items)
  68. {
  69.     echo '<td valign="top">';
  70.     echo '<b>'.$section.'</b>';
  71.     echo '<ul>';
  72.     foreach($items as $key => $value)
  73.     {
  74.             echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>';
  75.     }
  76.     echo '</ul>';
  77.     echo '</td>';
  78. }
  79. echo '</tr></table>';
  80. $course_categories statistics::get_course_categories();
  81. echo '<br/><br/>';
  82. switch($_GET['action'])
  83. {
  84.     case 'courses':
  85.         // total amount of courses
  86.         foreach($course_categories as $code => $name)
  87.         {
  88.             $courses[$namestatistics::count_courses($code);
  89.         }
  90.         // courses for each course category
  91.         statistics::print_stats(get_lang('CountCours'),$courses);
  92.  
  93.         break;
  94.     case 'users':
  95.         // total amount of users
  96.         statistics::print_stats(
  97.                 get_lang('NumberOfUsers'),
  98.                 array(
  99.                     get_lang('Teachers'=> statistics::count_users(1,null,$_GET['count_invisible_courses']),
  100.                     get_lang('Students'=> statistics::count_users(5,null,$_GET['count_invisible_courses'])
  101.                 )
  102.             );
  103.         foreach($course_categories as $code => $name)
  104.         {
  105.             $name str_replace(get_lang('Department'),"",$name);
  106.             $teachers[$namestatistics::count_users(1,$code,$_GET['count_invisible_courses']);
  107.             $students[$namestatistics::count_users(5,$code,$_GET['count_invisible_courses']);
  108.         }
  109.         // docents for each course category
  110.         statistics::print_stats(get_lang('Teachers'),$teachers);
  111.         // students for each course category
  112.         statistics::print_stats(get_lang('Students'),$students);
  113.  
  114.         break;
  115.     case 'coursebylanguage':
  116.         statistics::print_course_by_language_stats();
  117.         break;
  118.     case 'logins':
  119.         statistics::print_login_stats($_GET['type']);
  120.         break;
  121.     case 'tools':
  122.         statistics::print_tool_stats();
  123.         break;
  124.     case 'courselastvisit':
  125.         statistics::print_course_last_visit();
  126.         break;
  127.     case 'recentlogins':
  128.         statistics::print_recent_login_stats();
  129.         break;
  130.     case 'pictures':
  131.         statistics::print_user_pictures_stats();
  132.         break;
  133. }
  134.  
  135. ?>

Documentation generated on Thu, 12 Jun 2008 13:49:24 -0500 by phpDocumentor 1.4.1