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 allows the use statistics
* @package dokeos.statistics
==============================================================================
*/
Header("Cache-Control: must-revalidate");
$offset = 60 * 3;
$ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
Header($ExpStr);
$langFile='admin';
$cidReset = true;
include('../inc/global.inc.php');
require_once ('statistics.lib.php');
if($is_subPlatformAdmin)
{
$interbredcrump[]=array("url" => "../subadmin/index.php","name" => get_lang('Management'));
}
else
{
$interbredcrump[] = array ("url" => "../../../main/admin/index.php", "name" => get_lang('AdministrationTools'));
}
$tool_name = get_lang('Statistics_no_existing_courses');
Display::display_header($tool_name);
api_display_tool_title($tool_name);
?>
';
foreach($tools as $section => $items)
{
echo '';
echo ''.$section.'';
echo '';
foreach($items as $key => $value)
{
echo '- '.$value.'
';
}
echo ' ';
echo ' | ';
}
echo '
';
$faculties = statistics::get_faculties();
echo '
';
switch($_GET['action'])
{
case $strCourse:
// total amount of courses
statistics::print_stats(
get_lang('Statistics_NumberOfCourses'),
array(
get_lang('Statistics_CurriculumCourses') => statistics::count_courses(true,null,$_GET['count_invisible_courses']),
get_lang('Statistics_CommonCourses') => statistics::count_courses(false,null,$_GET['count_invisible_courses'])
)
);
foreach($faculties as $code => $name)
{
$name = str_replace(get_lang('Statistics_Department'),"",$name);
$cur_courses[$name] = statistics::count_courses(true,$code,$_GET['count_invisible_courses']);
$alg_courses[$name] = statistics::count_courses(false,$code,$_GET['count_invisible_courses']);
}
// curriculum-course for each department
statistics::print_stats(get_lang('Statistics_CurriculumCourses'),$cur_courses);
// general course for each department
statistics::print_stats(get_lang('Statistics_CommonCourses'),$alg_courses);
break;
case $strUsers:
// total amount of users
statistics::print_stats(
get_lang('NumberOfUsers'),
array(
get_lang('Teachers') => statistics::count_users(1,null,$_GET['count_invisible_courses']),
get_lang('Students') => statistics::count_users(5,null,$_GET['count_invisible_courses'])
)
);
foreach($faculties as $code => $name)
{
$name = str_replace(get_lang('Department'),"",$name);
$teachers[$name] = statistics::count_users(1,$code,$_GET['count_invisible_courses']);
$students[$name] = statistics::count_users(5,$code,$_GET['count_invisible_courses']);
}
// docents for each departerment
statistics::print_stats(get_lang('Teachers'),$teachers);
// students for each departement
statistics::print_stats(get_lang('Students'),$students);
break;
case 'logins':
statistics::print_login_stats($_GET['type']);
break;
case 'tools':
statistics::print_tool_stats();
break;
case 'accessoldcourses':
statistics::print_access_to_old_courses_stats();
break;
case 'courselastvisit':
statistics::print_course_last_visit();
break;
case 'recentlogins':
statistics::print_recent_login_stats();
break;
case 'pictures':
statistics::print_user_pictures_stats();
break;
case 'curriculum_courses':
statistics::print_curriculum_courses_stats_by_year();
statistics::print_curriculum_courses_stats_by_category();
break;
}
Display::display_footer();
?>