Source for file access_details.php
Documentation is available at access_details.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Furio Petrossi
Copyright (c) 2008 Dokeos SPRL
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, rue du Corbeau, 108, B-1030 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
* This is the tracking library for Dokeos.
* Include/require it in your code to use its functionality.
* @package dokeos.library
==============================================================================
* Calculates the time spent on the course
* @param integer $user_id the user id
* @param string $course_code the course code
* Funzione scritta da Mario per testare cose
$language_file = array ('registration', 'index', 'tracking');
require_once('../inc/global.inc.php');
* Gets the connections to a course as an array of login and logout time
$sql = 'SELECT login_course_date, logout_course_date FROM ' . $tbl_track_course . '
WHERE user_id = ' . intval($user_id) . '
AND course_code="' . $course_code . '"ORDER BY login_course_date';
$s_login_date = $a_connections['login_course_date'];
$s_logout_date = $a_connections['logout_course_date'];
$i_timestamp_login_date = strtotime($s_login_date);
$i_timestamp_logout_date = strtotime($s_logout_date);
$connections[] = array('login'=> $i_timestamp_login_date, 'logout'=> $i_timestamp_logout_date);
* Transforms seconds into a time format
$hours = floor($seconds / 3600);
$min = floor(($seconds - ($hours * 3600)) / 60);
$sec = $seconds - ($hours * 3600) - ($min * 60);
return $hours. get_lang('HourShort'). ' '. $min. ':'. $sec;
$user_id = (int) $_REQUEST['student'];
echo '<strong>',get_lang('User'),': ',$mainUserInfo['firstName'],' ',$mainUserInfo['lastName'],'</strong> <br />';
echo '<strong>'. get_lang('Course'). ': ',$course_code,' - ',$_course['name'],'</strong><br />';
echo '<strong>',get_lang('DateAndTimeOfAccess'),' - ',get_lang('Duration'),'</strong><br />';
/* Login time against logout time
foreach ($connections as $key=>$data)
echo ("<tr><td>".date("d-m-Y (H:i:s)",$data['login'])."</td><td>".date("d-m-Y (H:i:s)",$data['logout'])."</td></tr>");
foreach ($connections as $key=>$data)
echo ("<tr><td>".date("d-m-Y (H:i:s)",$data['login'])."</td><td>".calculHours($data['logout']-$data['login'])."</td></tr>");
foreach ($connections as $key=> $data)
echo ' '. date('d-m-Y (H:i:s)',$data['login']). ' - '. calculHours($data['logout']- $data['login']). '<br />'. "\n";
|