Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/main/inc/update_course_tracking.php

32 lines
910 B

<?php
$noajax=true;
include("global.inc.php");
require('common_course_tracking.ajax.php');
function updateCourseTracking($i_user_id){
$objResponse = new xajaxResponse();
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
//We select the last record for the current course in the course tracking table
$sql="SELECT course_access_id FROM $course_tracking_table WHERE user_id='$i_user_id' ORDER BY login_course_date DESC LIMIT 0,1";
$result=api_sql_query($sql,__FILE__,__LINE__);
$i_course_access_id = mysql_result($result,0,0);
//We update the course tracking table
$sql="UPDATE $course_tracking_table " .
"SET logout_course_date = NOW() " .
"WHERE course_access_id='$i_course_access_id'";
api_sql_query($sql,__FILE__,__LINE__);
return $objResponse;
}
$xajax_course_tracking->processRequests();
?>