Esempio n. 1
0
<?php

if (isset($_COOKIE['userid'])) {
    $now = datetime();
    $online = WhoIsOnline($now);
    echo "<h3>Online Now:</h3><div id='users'>Registered users online: ";
    foreach ($online as $ol) {
        echo "<span>" . $ol[0] . "</span>,";
    }
    echo "</div>";
}
include 'views/footer.php';
 echo '<a href="' . api_get_self() . '?' . Security::remove_XSS($_SERVER['QUERY_STRING']) . '&export=csv"><img src="../img/excel.gif">&nbsp;' . get_lang('ExportAsCSV') . '</a>';
 if (!empty($a_infosUser['email'])) {
     $sendMail = Display::encrypted_mailto_link($a_infosUser['email'], get_lang('SendMail'));
 } else {
     $sendMail = Display::return_icon('send_mail.gif', get_lang('SendMail')) . ' ' . get_lang('SendMail');
 }
 echo $sendMail;
 if (!empty($_GET['student']) && !empty($_GET['course'])) {
     //only show link to connection details if course and student were defined in the URL
     echo '<a href="access_details.php?student=' . Security::remove_XSS($_GET['student']) . '&course=' . Security::remove_XSS($_GET['course']) . '&amp;origin=' . Security::remove_XSS($_GET['origin']) . '&amp;cidReq=' . Security::remove_XSS($_GET['course']) . '">' . Display::return_icon('statistics.gif', get_lang('AccessDetails')) . ' ' . get_lang('AccessDetails') . '</a>';
 }
 echo '</div>';
 // is the user online ?
 $statistics_database = Database::get_statistic_database();
 $student_on_line = Security::remove_XSS($_GET['student']);
 $a_usersOnline = WhoIsOnline($student_on_line, $statistics_database, 30);
 foreach ($a_usersOnline as $a_online) {
     if (in_array($_GET['student'], $a_online)) {
         $online = get_lang('Yes');
         break;
     } else {
         $online = get_lang('No');
     }
 }
 $avg_student_progress = $avg_student_score = $nb_courses = 0;
 $sql = 'SELECT course_code FROM ' . $tbl_course_user . ' WHERE user_id=' . Database::escape_string($a_infosUser['user_id']);
 $rs = api_sql_query($sql, __FILE__, __LINE__);
 $a_courses = array();
 while ($row = Database::fetch_array($rs)) {
     $a_courses[$row['course_code']] = $row['course_code'];
 }