function getHistoryTable($id_user, $id_obj) { require_once _base_ . '/lib/lib.table.php'; $tb = new Table(Get::sett('visu_course')); $id_org = Get::req('id_org', DOTY_INT, 0); $lang = DoceboLanguage::CreateInstance('organization', 'lms'); $h_type = array('', '', '', '', ''); $h_content = array($lang->def('_ATTEMPT'), $lang->def('_STATUS'), $lang->def('_SCORE'), $lang->def('_DATE'), $lang->def('_TIME')); $tb->setColsStyle($h_type); $tb->addHead($h_content); $qry = "SELECT t1.* FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking_history as t1 JOIN " . $GLOBALS['prefix_lms'] . "_scorm_tracking as t2 ON (t1.idscorm_tracking=t2.idscorm_tracking) " . " WHERE t2.idscorm_item={$id_obj} AND t2.idUser={$id_user} " . " ORDER BY t1.date_action ASC "; $res = sql_query($qry); $i = 1; while ($row = mysql_fetch_assoc($res)) { $line = array(); $line[] = $lang->def('_ATTEMPT') . ' ' . $i; $line[] = $row['lesson_status']; $line[] = $row['score_raw']; $line[] = Format::date($row['date_action']); $line[] = decodeSessionTime($row['session_time']); $tb->addBody($line); $i++; } //title cout(getTitleArea(''), 'content'); cout('<div class="std_block">', 'content'); //back button, back to treeview $back = getBackUi('index.php?modname=organization&op=scorm_track&id_user='******'&id_org=' . $id_org, $lang->def('_BACK')); //back button, back to treeview cout($back, 'content'); cout($tb->getTable(), 'content'); cout($back, 'content'); cout('</div>', 'content'); }
function getHistoryTable($id_user, $id_org, $idscorm_item, $idReference) { require_once _base_ . '/lib/lib.table.php'; $tb = new Table(Get::sett('visu_course')); $lang = DoceboLanguage::CreateInstance('organization', 'lms'); $h_type = array('', '', '', '', ''); $h_content = array($lang->def('_ATTEMPT'), $lang->def('_STATUS'), $lang->def('_SCORE'), $lang->def('_DATE'), $lang->def('_TIME')); $tb->setColsStyle($h_type); $tb->addHead($h_content); $qry = "SELECT t1.* FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking_history as t1 JOIN " . $GLOBALS['prefix_lms'] . "_scorm_tracking as t2 ON (t1.idscorm_tracking=t2.idscorm_tracking) " . " WHERE t2.idscorm_item={$idscorm_item} AND t2.idUser={$id_user} " . " ORDER BY t1.date_action ASC "; $res = sql_query($qry); $i = 1; while ($row = mysql_fetch_assoc($res)) { $line = array(); $line[] = $lang->def('_ATTEMPT') . ' ' . $i; $line[] = $row['lesson_status']; $line[] = $row['score_raw']; $line[] = Format::date($row['date_action']); $line[] = decodeSessionTime($row['session_time']); $tb->addBody($line); $i++; } //title cout($tb->getTable(), 'content'); }