function showLog() { require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('conference', 'lms'); $id = Get::req('id', DOTY_INT, 0); $conference = new Conference_Manager(); $room_info = $conference->roomInfo($id); $acl_man =& Docebo::user()->getAclManager(); cout(getTitleArea('') . '<div class="std_block">', 'content'); $room_log = array(); switch ($room_info['room_type']) { case 'teleskill': require_once $GLOBALS['where_scs'] . '/lib/lib.teleskill.php'; $teleskill = new Teleskill_Management(); $roomid = $teleskill->getRoomId($id); if (isset($_POST['update_log'])) { $teleskill->updateRoomLog($roomid); } $room_log = $teleskill->getRoomLog($roomid); break; } $tb = new Table(0, $lang->def('_ROOM_LOG'), $lang->def('_ROOM_LOG')); $cont_h = array($lang->def('_FULLNAME'), $lang->def('_ROLE'), $lang->def('_DATE'), $lang->def('_TOTAL_TIME'), $lang->def('_NUMBER_OF_ACCESS')); $type_h = array('', '', '', '', ''); $tb->setColsStyle($type_h); $tb->addHead($cont_h); foreach ($room_log as $log_row) { $user_info = $acl_man->getUser($log_row['idUser'], false); $cont = array(); if ($user_info[ACL_INFO_FIRSTNAME] !== '' && $user_info[ACL_INFO_LASTNAME]) { $cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' ' . $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } elseif ($user_info[ACL_INFO_FIRSTNAME] !== '') { $cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } elseif ($user_info[ACL_INFO_LASTNAME] !== '') { $cont[] = $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; } else { $cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]); } $cont[] = $log_row['role'] == 1 ? $lang->def('_USER_ROLE') : $lang->def('_TUTOR_ROLE'); $cont[] = Format::date($log_row['date'], 'datetime'); $duration_s = 0; $duration_m = 0; $duration_h = 0; $duration = $log_row['duration']; $duration_s = $duration % 60; $duration -= $duration_s; if ($duration) { $duration_m = $duration % 3600 / 60; $duration -= $duration_m * 60; if ($duration) { $duration_h = $duration / 3600; } } $cont[] = $duration_h . ' ' . $lang->def('_HOURS') . ' ' . $duration_m . ' ' . $lang->def('_MINUTS') . ' ' . $duration_s . ' ' . $lang->def('_SECONDS'); $cont[] = $log_row['access']; $tb->addBody($cont); } $tb->addActionAdd(Form::getButton('update_log', 'update_log', $lang->def('_UPDATE_LOG'))); cout(Form::openForm('log_table', 'index.php?modname=conference&op=log&id=' . $id) . $tb->getTable() . Form::closeForm() . '<br/>' . getBackUi('index.php?modname=conference&op=history', $lang->def('_BACK')), 'content'); cout('</div>', 'content'); }