Fixing time to avoid negative values see BT#3627

skala
Julio Montoya 13 years ago
parent 3cab2a707e
commit c727e69e69
  1. 6
      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
FROM $tbl_track_course
WHERE course_code='$course_code' AND session_id = '$session_id' $condition_user";
$rs = Database::query($sql);
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);
$row = Database::fetch_array($rs);
return $row['nb_seconds'];
}

Loading…
Cancel
Save