|
|
|
@ -63,21 +63,30 @@ Display::display_header(get_lang('UserOnlineListSession')); |
|
|
|
|
$session_is_coach[$session['id']] = $session; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$result = Database::query("SELECT DISTINCT id, |
|
|
|
|
$sql = "SELECT DISTINCT id, |
|
|
|
|
name, |
|
|
|
|
date_start, |
|
|
|
|
date_end |
|
|
|
|
FROM $tbl_session as session |
|
|
|
|
WHERE session.id_coach = ".$_user['user_id']." |
|
|
|
|
ORDER BY date_start, date_end, name"); |
|
|
|
|
ORDER BY date_start, date_end, name"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
while ($session = Database:: fetch_array($result)) { |
|
|
|
|
$session_is_coach[$session['id']] = $session; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (empty($time_limit)) { |
|
|
|
|
$time_limit = api_get_setting('time_limit_whosonline'); |
|
|
|
|
} else { |
|
|
|
|
$time_limit = 60; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$online_time = time() - $time_limit*60; |
|
|
|
|
$current_date = api_get_utc_datetime($online_time); |
|
|
|
|
|
|
|
|
|
$students_online = array(); |
|
|
|
|
foreach ($session_is_coach as $session) { |
|
|
|
|
$sql = "SELECT DISTINCT |
|
|
|
|
last_access.access_user_id, |
|
|
|
|
$sql = "SELECT DISTINCT last_access.access_user_id, |
|
|
|
|
last_access.access_date, |
|
|
|
|
last_access.c_id, |
|
|
|
|
last_access.access_session_id, |
|
|
|
@ -87,7 +96,7 @@ Display::display_header(get_lang('UserOnlineListSession')); |
|
|
|
|
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user |
|
|
|
|
ON user.user_id = last_access.access_user_id |
|
|
|
|
WHERE access_session_id='".$session['id']."' |
|
|
|
|
AND NOW()-access_date<1000 |
|
|
|
|
AND access_date >= '$current_date' |
|
|
|
|
GROUP BY access_user_id"; |
|
|
|
|
|
|
|
|
|
$result = Database::query($sql); |
|
|
|
|