Fixing time to avoid negative values see BT#3627

skala
Julio Montoya 13 years ago
parent 3cab2a707e
commit c727e69e69
  1. 4
      main/inc/lib/tracking.lib.php

@ -106,9 +106,9 @@ class Tracking {
$sql = "SELECT SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as nb_seconds $sql = "SELECT SUM(UNIX_TIMESTAMP(logout_course_date) - UNIX_TIMESTAMP(login_course_date)) as nb_seconds
FROM $tbl_track_course FROM $tbl_track_course
WHERE course_code='$course_code' AND session_id = '$session_id' $condition_user"; WHERE UNIX_TIMESTAMP(logout_course_date) > UNIX_TIMESTAMP(login_course_date) AND course_code='$course_code' AND session_id = '$session_id' $condition_user";
$rs = Database::query($sql); $rs = Database::query($sql);
$row = Database::fetch_array($rs); $row = Database::fetch_array($rs);
return $row['nb_seconds']; return $row['nb_seconds'];
} }

Loading…
Cancel
Save