diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index e58856814d..2d07bb910e 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -2246,14 +2246,14 @@ function get_terms() $total_time = ' '; if (!empty($_REQUEST['exeId'])) { $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); - require_once ('../reservation/rsys.php'); + $safe_exe_id = Database::escape_string($_REQUEST['exeId']); $sql = 'SELECT start_date,exe_date FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.(int)$safe_exe_id; $res = api_sql_query($sql,__FILE__,__LINE__); $row_dates = Database::fetch_array($res); - $rsys = new Rsys(); - $time_start_date = $rsys->mysql_datetime_to_timestamp($row_dates['start_date']); - $time_exe_date = $rsys->mysql_datetime_to_timestamp($row_dates['exe_date']); + + $time_start_date = convert_mysql_date($row_dates['start_date']); + $time_exe_date = convert_mysql_date($row_dates['exe_date']); $mytime = ((int)$time_exe_date-(int)$time_start_date); $total_time =" total_time = ".$mytime.", "; } diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index 6e41dc63ca..693b8b978f 100644 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -33,7 +33,6 @@ require_once('learnpath.class.php'); require_once ('resourcelinker.inc.php'); require_once ('../inc/lib/tracking.lib.php'); require_once ('../inc/lib/course.lib.php'); -require_once ('../reservation/rsys.php'); if(empty($_SESSION['_course']['id']) && isset($_GET['course'])) @@ -362,9 +361,9 @@ foreach ($list as $my_item_id) { $my_exe_id = $row_attempts['exe_id']; $my_orig_lp = $row_attempts['orig_lp_id']; $my_orig_lp_item = $row_attempts['orig_lp_item_id']; - $rsys = new Rsys(); - $mktime_start_date = $rsys->mysql_datetime_to_timestamp($row_attempts['start_date']); - $mktime_exe_date = $rsys->mysql_datetime_to_timestamp($row_attempts['exe_date']); + + $mktime_start_date = convert_mysql_date($row_attempts['start_date']); + $mktime_exe_date = convert_mysql_date($row_attempts['exe_date']); $mytime = ((int)$mktime_exe_date-(int)$mktime_start_date); $time_attemp = learnpathItem :: get_scorm_time('js', $mytime); $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp);