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