本文整理汇总了PHP中Table::initNavBar方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::initNavBar方法的具体用法?PHP Table::initNavBar怎么用?PHP Table::initNavBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::initNavBar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modglossarygui
function modglossarygui($object_glos = NULL)
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('glossary');
require_once _base_ . '/lib/lib.table.php';
$tableGlossary = new Table(Get::sett('visuItem'), '', $lang->def('_GLOSSARY_SUMMARY'));
$tableGlossary->initNavBar('ini', 'link');
$ini = $tableGlossary->getSelectedElement();
$back_coded = htmlentities(urlencode($object_glos->back_url));
list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossary \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
$reTerm = sql_query("\r\n\tSELECT idTerm, term \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "' \r\n\tORDER BY term \r\n\tLIMIT {$ini}," . Get::sett('visuItem'));
list($num_of_term) = sql_fetch_row(sql_query("\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm\r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'"));
if ($title == '') {
$_SESSION['last_error'] = $lang->def('_FILEUNSPECIFIED');
Util::jump_to(Util::str_replace_once('&', '&', $object_glos->back_url) . '&create_result=0');
}
$GLOBALS['page']->add(getTitleArea($lang->def('_GLOSSARY'), 'glossary', $lang->def('_GLOSSARY')) . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_glos->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_GLOSSARY') . ' : ' . $title . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=glossary&op=modglossary&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD_TITLE') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD_TITLE') . '</a>' . '</div><br />', 'content');
$contentArray = array($lang->def('_TERM'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />');
$typeArray = array('', 'image', 'image');
$GLOBALS['page']->add($tableGlossary->addHead($contentArray, $typeArray));
while (list($idTerm, $term) = sql_fetch_row($reTerm)) {
$content = array($term, '<a href="index.php?modname=glossary&op=modterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /></a>', '<a href="index.php?modname=glossary&op=delterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_DEL') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>');
$tableGlossary->addBody($content);
}
$tableGlossary->addActionAdd('<a href="index.php?modname=glossary&op=addterm&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDTERM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDTERM') . '</a>');
$tableGlossary->setLink('index.php?modname=glossary&op=modglossarygui' . '&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded);
$GLOBALS['page']->add($tableGlossary->getTable() . $tableGlossary->getNavBar($ini, $num_of_term) . '</div>', 'content');
}
示例2: publicAdminManager_list
function publicAdminManager_list()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('adminrules', 'framework');
$lang =& DoceboLanguage::createInstance('public_admin_manager', 'framework');
$aclManager = new DoceboACLManager();
// get users to show --------------------------------------------------
$admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_PUBLICADMIN);
$arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst);
$arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst));
$pm =& PlatformManager::createInstance();
$lms_is_active = $pm->isLoaded("lms");
/*$cms_is_active = $pm->isLoaded("cms");*/
// print table --------------------------------------------------------
$table = new Table(Get::sett('visuItem'), $lang->def('_PUBLIC_ADMIN_USER'), $lang->def('_PUBLIC_ADMIN_USER'));
$table->initNavBar('ini', 'link');
$table->setLink('index.php?modname=public_admin_manager&op=view&ini=');
$ini = $table->getSelectedElement();
$GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content');
$contentH = array($lang->def('_USERNAME'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />');
$typeH = array('', 'image', 'image', 'image');
if ($lms_is_active) {
$contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />';
$typeH[] = 'image';
}
$table->setColsStyle($typeH);
$table->addHead($contentH);
$maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem');
for ($index = $ini; $index < $maxItem; $index++) {
$admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1);
$rowContent = array($admin_userid);
// Edit preferences
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_preferences&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit menu
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_menu&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit user
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=assign_tree&adminidst=' . $arr_admin_idst[$index] . '"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
// Edit course
if ($lms_is_active) {
$rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_course&adminidst=' . $arr_admin_idst[$index] . '&load=1"
title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>';
}
$table->addBody($rowContent);
}
$GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content');
$GLOBALS['page']->add('</div>', 'content');
}
示例3: reportList
function reportList()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('report', 'framework');
$_SESSION['report_tempdata'] = array();
$can_mod = checkPerm('mod', true);
$acl_man = Docebo::aclm();
$public_admin_mod = true;
$query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId();
$tb = new Table();
$tb->initNavBar('ini', 'button');
$col_type = array('', 'align_center', 'align_center', 'image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />');
if ($public_admin_mod && $can_mod) {
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
$res = sql_query($query);
if ($res) {
while ($row = sql_fetch_assoc($res)) {
$id = $row['id_filter'];
$opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>';
$tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link);
if ($public_admin_mod && $can_mod) {
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
}
$tb->addBody($tb_content);
}
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_public_report]');
if ($public_admin_mod && $can_mod) {
$tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
}
cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content');
}
示例4: classroomToEdition
function classroomToEdition()
{
require_once _base_ . '/lib/lib.form.php';
//require_once(_i18n_.'/lib.lang.php');
require_once _base_ . '/lib/lib.table.php';
require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
if (isset($_POST['classroom_to_edition'])) {
list($edition_id) = each($_POST['classroom_to_edition']);
} else {
$edition_id = importVar('edition_id', true, 0);
}
$of_loc = importVar('of_loc', false, '');
$of_name = importVar('of_name', false, '');
$form = new Form();
$query_course_name = "SELECT idCourse, name\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $edition_id . "'";
list($idCourse, $edition_name) = sql_fetch_row(sql_query($query_course_name));
$lang =& DoceboLanguage::CreateInstance('course', 'lms');
$tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'));
$tb->initNavBar('ini', 'link');
$tb->setLink("index.php?modname=course&op=classroom_to_edition&edition_id={$edition_id}" . '&of_loc=' . $of_loc . '&of_name=' . $of_name);
$ini = $tb->getSelectedElement();
$checked_class = checkAvailableClass($idCourse, $edition_id);
$classroom_order = "l.location, c.name ";
if ($of_loc == 'loc') {
$classroom_order = "l.location, c.name ";
}
if ($of_loc == 'locd') {
$classroom_order = "l.location DESC, c.name ";
}
if ($of_name == 'name') {
$classroom_order = "c.name, l.location ";
}
if ($of_name == 'namec') {
$classroom_order = "c.name DESC, l.location ";
}
if ($of_loc == '' && $of_name == '') {
$of_loc = 'loc';
}
//search query of classrooms ---------------------------------
$query_classroom = "\r\n\tSELECT c.idClassroom, c.name, c.description, l.location\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom AS c\r\n\t\tJOIN " . $GLOBALS['prefix_lms'] . "_class_location AS l\r\n\tWHERE l.location_id = c.location_id\r\n\tORDER BY " . $classroom_order . "\r\n\tLIMIT {$ini}," . Get::sett('visuItem');
$re_classroom = sql_query($query_classroom);
// search classrooms assigned --------------------------------
$query_class_assigned = "\r\n\tSELECT classrooms\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\twhere idCourseEdition= " . $edition_id . "";
list($assigned_classroom) = sql_fetch_row(sql_query($query_class_assigned));
$query_classroom_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom ";
list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot));
// table intestation
$type_h = array('', '', '', 'image');
$cont_h = array('<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_loc=" . ($of_loc == 'loc' ? 'locd' : 'loc') . '">' . ($of_loc == 'loc' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_loc == 'locd' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_LOCATION') . '</a>', '<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_name=" . ($of_name == 'name' ? 'named' : 'name') . '">' . ($of_name == 'name' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_name == 'named' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_CLASSROOM', 'course') . '</a>', $lang->def('_STATUS'), $lang->def('_USETHIS'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$class_room_to_edition = array();
while (list($idClassroom, $name, $descr, $location) = sql_fetch_row($re_classroom)) {
$cont = array('<label for="class_room_to_edition_' . $idClassroom . '">' . $location . '</label>', '<label for="class_room_to_edition_' . $idClassroom . '">' . $name . '</label>');
if (isset($checked_class[$idClassroom])) {
$cont[] = $lang->def('_CLASSROOM_OCCUPATED_YES');
} else {
$cont[] = '';
}
$cont[] = $form->getRadio('', 'class_room_to_edition_' . $idClassroom . '', 'class_room_to_edition', $idClassroom, $assigned_classroom == $idClassroom);
$tb->addBody($cont);
}
$page_title = array('index.php?modname=course&op=course_list' => $lang->def('_CLASSROOM'), $edition_name);
$GLOBALS['page']->add(getTitleArea($page_title, 'classroomtocourse', $lang->def('_CLASSROOM')) . '<div class="std_block">' . ($checked_class !== false ? getResultUi($lang->def('_CLASSROOM_OCCUPATED')) : '') . getBackUi('index.php?modname=course&op=course_list', $lang->def('_BACK')) . $form->openForm('assignEditionClassroom', 'index.php?modname=course&op=assignEditionClassroom', false, false, 'multipart/form-data') . $form->getHidden('edition_id', 'edition_id', $edition_id) . $form->getHidden('idCourse', 'idCourse', $idCourse) . $tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . $form->openButtonSpace() . $form->getButton('assignEditionClassroom', 'assignEditionClassroom', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}
示例5: get_schedulations_table
function get_schedulations_table($idrep = false)
{
checkPerm('view');
$can_mod = checkPerm('mod', true);
require_once _base_ . '/lib/lib.table.php';
Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
YuiLib::load('selector');
$acl_man =& Docebo::user()->getACLManager();
$level = Docebo::user()->getUserLevelId(getLogUserId());
$admin_cond = '';
switch ($level) {
case ADMIN_GROUP_GODADMIN:
case ADMIN_GROUP_ADMIN:
break;
case ADMIN_GROUP_PUBLICADMIN:
case ADMIN_GROUP_USER:
default:
$admin_cond .= " AND t1.id_creator=" . getLogUserId();
break;
}
$query = "SELECT t1.*, t3.userid as report_owner, t2.filter_name as report_name, " . "COUNT(t4.id_user) as num_users FROM " . $GLOBALS['prefix_lms'] . "_report_schedule as t1, " . $GLOBALS['prefix_lms'] . "_report_filter as t2, " . $GLOBALS['prefix_fw'] . "_user as t3, " . $GLOBALS['prefix_lms'] . "_report_schedule_recipient as t4 " . "WHERE t1.id_report_filter=t2.id_filter AND t3.idst=t1.id_creator " . "AND t4.id_report_schedule=t1.id_report_schedule " . $admin_cond . " " . ($idrep ? "AND t1.id_report_filter={$idrep} " : '') . "GROUP BY t1.id_report_schedule";
$lang =& DoceboLanguage::createInstance('report', 'framework');
$output = '';
$tb = new Table(Get::sett('visu_course'));
$tb->initNavBar('ini', 'button');
$col_type = array('align_center', 'align_center', 'align_center', 'align_center', 'align_center', 'align_center');
//,'image','image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR'), $lang->def('_CREATION_DATE'), $lang->def('_SEND'), $lang->def('_RECIPIENTS'), $lang->def('_ACTIVE'));
if ($can_mod) {
$col_type[] = 'image';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'standard') . '" title="' . $lang->def('_MOD') . '" />';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'standard') . '" title="' . $lang->def('_DEL') . '" />';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
$res = sql_query($query);
if ($res) {
while ($row = mysql_fetch_assoc($res)) {
$id = $row['id_report_schedule'];
$recipients_link = "ajax.adm_server.php?mn=report&plf=lms&op=show_recipients_window&idsched=" . $id;
$mod_link = '<a href="index.php?modname=report&op=sched_mod&id_sched=' . $id . '&idrep=' . $idrep . '" ' . ' title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />' . '</a>';
$rem_link = '<a href="index.php?modname=report&op=schedulelist&idrep=' . $idrep . '&action=sched_rem&id_sched=' . $id . '" ' . ' title="' . $lang->def('_DEL') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />' . '</a>';
$enabled = '<image class="handover" src="' . getPathImage('lms') . 'standard/' . ($row['enabled'] == 1 ? 'publish.png' : 'unpublish.png') . '" ' . 'onclick="enable_schedulation(this, ' . $row['id_report_schedule'] . ');" />' . '<input type="hidden" id="enable_value_' . $row['id_report_schedule'] . '" ' . 'value="' . ($row['enabled'] == 1 ? '0' : '1') . '" />';
$num_users = '<a href="' . $recipients_link . '" title="' . $lang->def('_RECIPIENTS') . '" ' . 'class="" id="show_recipients_' . $id . '">' . $row['num_users'] . '</a>';
$tb_content = array(_SCHED_KEY_NAME => $row['name'], _SCHED_KEY_CREATOR => $acl_man->relativeId($row['report_owner']), _SCHED_KEY_CREATION => Format::date($row['creation_date']), _SCHED_KEY_PERIOD => get_period_text($row['period']), _SCHED_KEY_NUMUSER => $num_users, _SCHED_KEY_ENABLED => $enabled);
if ($can_mod) {
$tb_content[_SCHED_KEY_MOD] = $mod_link;
$tb_content[_SCHED_KEY_REM] = $rem_link;
}
$tb->addBody($tb_content);
}
}
$tb->addActionAdd('
<a href="index.php?modname=report&op=report_schedule&idrep=' . $idrep . '">' . '<img src="' . getPathImage() . 'standard/add.png" ' . 'title="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADD') . '</a>');
$output .= $tb->getTable();
$output .= '<script type="text/javascript">
YAHOO.util.Event.onDOMReady(function() {
var links = YAHOO.util.Selector.query("a[id^=show_recipients_]");
YAHOO.util.Event.addListener(links, "click", function(e) {
CreateDialog("show_recipients_dialog", {
width: "600px",
modal: true,
close: true,
visible: false,
fixedcenter: false,
constraintoviewport: false,
draggable: true,
hideaftersubmit: true,
isDynamic: true,
confirmOnly: true,
ajaxUrl: this.href
}).call(this, e);
});
});
</script>';
return $output;
}
示例6: viewDeletedUser
function viewDeletedUser()
{
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('profile', 'framework');
$out =& $GLOBALS['page'];
$out->setWorkingZone('content');
$acl_man =& Docebo::user()->getAclManager();
$max_row = 10;
$tb = new Table($max_row);
$tb->initNavBar('ini', 'link');
$ini = $tb->getSelectedElement();
$query = "SELECT * FROM " . $this->_getTableDeletedUser() . "";
$result = sql_query($query);
$num_rows = mysql_num_rows($result);
//print_r($ini);
if ($ini) {
$limit = $ini;
} else {
$limit = 0;
}
$query = "SELECT d.idst, d.userid, d.firstname, d.lastname, d.email, d.lastenter, d.deletion_date, d.deleted_by, u.userid, u.firstname, u.lastname" . " FROM " . $this->_getTableDeletedUser() . " AS d JOIN" . " " . $this->_getTableUser() . " AS u ON d.deleted_by = u.idst" . " LIMIT " . $limit . ", " . $max_row . "";
$result = sql_query($query);
$out->add(getTitleArea($lang->def('_DELETED_USER_LIST')) . '<div class="std_block">');
$out->add(getBackUi('index.php?modname=directory&op=org_chart', "<<" . $lang->def('_BACK')));
if ($num_rows) {
$cont_h = array($lang->def('_IDST_DELETED_USER'), $lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'), $lang->def('_DELETION_DATE'), $lang->def('_USERID_DELETER'), $lang->def('_FIRSTNAME_DELETER'), $lang->def('_LASTNAME_DELETER'));
$type_h = array('', '', '', '', '', '', '', '', '', '', '');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($idst_deleted, $userid_deleted, $firstname_deleted, $lastname_deleted, $email_deleted, $last_enter_deleted, $deletion_date, $idst_deleter, $userid_deleter, $firstname_deleter, $lastname_deleter) = sql_fetch_row($result)) {
$count = array();
$count[] = $idst_deleted;
$count[] = $acl_man->relativeId($userid_deleted);
$count[] = $firstname_deleted;
$count[] = $lastname_deleted;
$count[] = $email_deleted;
$count[] = Format::date($deletion_date);
$count[] = $acl_man->relativeId($userid_deleter);
$count[] = $firstname_deleter;
$count[] = $lastname_deleter;
$tb->addBody($count);
}
$out->add($tb->getTable() . $tb->getNavBar($ini, $num_rows) . '</div>');
} else {
$out->add($lang->def('_EMPTY_SELECTION'));
}
$out->add(getBackUi('index.php?modname=directory&op=org_chart', "<<" . $lang->def('_BACK')));
$out->add('</div>');
}
示例7: transaction
function transaction()
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.dialog.php';
YuiLib::load();
$lang =& DoceboLanguage::createInstance('transaction');
$acl_man = Docebo::user()->getAclManager();
$man_transaction = new Man_Transaction();
cout(getTitleArea($lang->def('_TRANSACTION')) . '<div class="std_block">');
$tb = new Table(Get::sett('visuItem'), $lang->def('_TRANSACTION_TABLE'), $lang->def('_TRANSACTION_TABLE'));
$tb->initNavBar('ini', 'button');
$tb->setLink('index.php?modname=transaction&op=transaction');
$page = ($tb->getSelectedPage() - 1) * Get::sett('visuItem');
$status_filter = Get::req('payment_status', DOTY_INT, '-2');
$course_filter = Get::req('course_status', DOTY_INT, '-2');
$tran_filter = Get::req('tran', DOTY_MIXED, '');
$display = false;
if ($status_filter != -2) {
$display = true;
}
if ($course_filter != -2) {
$display = true;
}
$transactions = $man_transaction->getTransaction($page, $status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter);
$tot_transaction = $man_transaction->getTotTransaction($status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter);
if (count($transactions) > 0 || $display) {
$mod_img = '<img src="' . getPathImage() . '/standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />';
$del_img = '<img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />';
$cont_h = array($lang->def('_USER'), $lang->def('_DATE'), $lang->def('_COURSE_PRIZE'), $lang->def('_PAYMENT_METHOD'), $lang->def('_PAYMENT_STATUS'), $lang->def('COURSE_STATUS'), $mod_img, $del_img);
$type_h = array('', '', '', '', 'image', 'image', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
foreach ($transactions as $transaction_info) {
if ($transaction_info['firstname'] !== '' && $transaction_info['lastname'] !== '') {
$user = $transaction_info['firstname'] . ' ' . $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} elseif ($transaction_info['firstname'] !== '') {
$user = $transaction_info['firstname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} elseif ($transaction_info['lastname'] !== '') {
$user = $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')';
} else {
$user = $acl_man->relativeId($transaction_info['userid']);
}
switch ($transaction_info['payment_status']) {
case '-1':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />';
break;
case '0':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_WAITING_PAYMENT') . '" title="' . $lang->def('_WAITING_PAYMENT') . '" />';
break;
case '1':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_PARTIAL_PAID') . '" title="' . $lang->def('_PARTIAL_PAID') . '" />';
break;
case '2':
$payment_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_PAID') . '" title="' . $lang->def('_PAID') . '" />';
break;
}
switch ($transaction_info['course_status']) {
case '-1':
$course_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />';
break;
case '0':
$course_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_NO_COURSE_ACTIVATED') . '" title="' . $lang->def('_NO_COURSE_ACTIVATED') . '" />';
break;
case '1':
$course_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" title="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" />';
break;
case '2':
$course_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" title="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" />';
break;
}
$tb->addBody(array($user, Format::date($transaction_info['date']), $transaction_info['price'], $lang->def('_' . strtoupper($transaction_info['method'])), $payment_status, $course_status, '<a href="index.php?modname=transaction&op=mod&id=' . $transaction_info['id_transaction'] . '">' . $mod_img . '</a>', '<a href="index.php?modname=transaction&op=del&id=' . $transaction_info['id_transaction'] . '">' . $del_img . '</a>'));
}
$array_payment_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
$array_course_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
cout(Form::openForm('transaction_filter', 'index.php?modname=transaction&op=transaction') . $tb->getNavBar($page, $tot_transaction) . '<div class="quick_search_form">' . Form::getInputTextfield('search_t', 'tran', 'tran', $tran_filter, '', 255, '') . Form::getButton("filter", "filter", $lang->def('_FILTER'), "search_b") . '<br />' . '<a class="advanced_search" href="javascript:;" onclick="( this.nextSibling.style.display != \'block\' ? this.nextSibling.style.display = \'block\' : this.nextSibling.style.display = \'none\' );">' . $lang->def("_ADVANCED_SEARCH") . '</a>' . '<div class="overlay_menu" style="display:' . ($display ? 'block' : 'none') . '">' . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $status_filter) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $course_filter) . '</div>' . '</div>' . '<script type="text/javascript">' . 'var payment_status = YAHOO.util.Dom.get(\'payment_status\');' . 'var course_status = YAHOO.util.Dom.get(\'course_status\');' . 'var form = YAHOO.util.Dom.get(\'transaction_filter\');' . 'YAHOO.util.Event.on(payment_status, \'change\', function() { this.submit() } , form, true);' . 'YAHOO.util.Event.on(course_status, \'change\', function() { this.submit() } , form, true);' . '</script>' . $tb->getTable() . $tb->getNavBar($page, $tot_transaction) . Form::closeForm());
setupHrefDialogBox('a[href*=del]');
} else {
cout(Lang::t('_NO_CONTENT', 'transaction'));
}
cout('</div>');
}
示例8: view_report_certificate
function view_report_certificate()
{
checkPerm('view');
require_once _lms_ . '/lib/lib.certificate.php';
require_once _lms_ . '/lib/lib.course.php';
$out =& $GLOBALS['page'];
$out->setWorkingZone('content');
$lang =& DoceboLanguage::createInstance('certificate', 'lms');
$deletion = importVar('deletion', true, 0);
if ($deletion) {
switch ($deletion) {
case 1:
$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
break;
case 2:
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
case 3:
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
}
}
$certificate = new Certificate();
$id_certificate = importVar('id_certificate', true, 0);
$id_course = importVar('id_course', true, 0);
$selection = importVar('selection', false, array());
//all possible selected values
$selected = importVar('selected', false, array());
//effectively selected values with checkbox
$sel = importVar('old_selection', false, '');
//selected values from previous table pages
if ($sel != '') {
$total_selection = explode(',', $sel);
} else {
$total_selection = array();
}
//update total selection
foreach ($selection as $key => $val) {
if (in_array($val, $selected)) {
if (!in_array($val, $total_selection)) {
$total_selection[] = $val;
}
} else {
$index = array_search($val, $total_selection);
if ($index !== false) {
array_splice($total_selection, $index, 1);
}
}
}
$search_filter = importVar('filter', false, '');
$only_released = importVar('only_released', true, 0);
//which command?
if (importVar('search_button', false, false) !== false) {
}
if (importVar('reset_button', false, false) !== false) {
$search_filter = '';
$only_released = 0;
}
if (importVar('print_button', false, false) !== false) {
}
$numtablerows = Get::sett('visuItem', 25);
$tb = new Table($numtablerows, $lang->def('_CERTIFICATE_VIEW_CAPTION'), $lang->def('_CERTIFICATE_VIEW_CAPTION'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
$ini_param = Get::req('ini', DOTY_MIXED, array());
//floor($ini / Get::sett('visuItem', 25));
if (empty($ini_param)) {
$ini_param = 1;
} else {
list($ini_param) = each($ini_param);
}
$tca = $GLOBALS['prefix_lms'] . "_certificate_assign as ca";
$tcc = $GLOBALS['prefix_lms'] . "_certificate_course as cc";
$tcu = $GLOBALS['prefix_lms'] . "_courseuser as cu";
$tu = $GLOBALS['prefix_fw'] . "_user as u";
$where = "";
if ($search_filter != '') {
$where .= " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') ";
}
if ($only_released > 0) {
$where = " AND ca.on_date " . ($only_released == 1 ? "IS NOT" : "IS") . " NULL ";
}
//$where .= " AND ".$aval_status." ".($only_released==1 ? "<" : ">=")." cu.status ";
list($aval_status) = sql_fetch_row(sql_query("SELECT available_for_status FROM " . $tcc . " " . " WHERE id_certificate='" . (int) $id_certificate . "' AND id_course='" . (int) $id_course . "'"));
switch ($aval_status) {
case AVS_ASSIGN_FOR_ALL_STATUS:
$aval_status = " 1 ";
break;
case AVS_ASSIGN_FOR_STATUS_INCOURSE:
$aval_status = " cu.status = " . _CUS_BEGIN . " ";
break;
case AVS_ASSIGN_FOR_STATUS_COMPLETED:
$aval_status = " cu.status = " . _CUS_END . " ";
break;
}
list($totalrows) = sql_fetch_row(sql_query("SELECT COUNT(*) " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where));
$query = "SELECT u.userid, u.firstname, u.lastname, cu.date_complete, ca.on_date, cu.idUser as id_user, cu.status " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where . " ORDER BY u.userid LIMIT " . $ini . ", " . $numtablerows;
//cout('<pre>'.print_r($_POST, true).'</pre>');
//cout($query);
$res = sql_query($query);
//.........这里部分代码省略.........
示例9: loadCourseSelector
function loadCourseSelector($noprint = false, $with_assesment = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('course', 'lms');
$output = '';
$output .= $this->treeview->load();
// Filter
$this->filter['course_flat'] = isset($_POST['c_flatview']);
//$this->filter['course_code'] = ( isset($_POST['c_filter_code']) ? $_POST['c_filter_code'] : '' );
$this->filter['course_name'] = isset($_POST['c_filter_name']) ? $_POST['c_filter_name'] : '';
if ($this->show_filter === true) {
$output .= '<div class="quick_search_form">' . '<div class="common_options">' . Form::getInputCheckbox('c_flatview', 'c_flatview', '1', Get::req('c_flatview', DOTY_INT, '0') == '1' ? true : false, ' onclick="submit();" ') . ' <label class="label_normal" for="c_flatview">' . Lang::t('_DIRECTORY_FILTER_FLATMODE', 'admin_directory') . '</label>' . ' ' . '</div>' . '<div>' . Form::getInputTextfield("search_t", "c_filter_name", "c_filter_name", Get::req('c_filter_name', DOTY_ALPHANUM, ''), '', 255, '') . Form::getButton("c_filter_set", "c_filter_set", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
}
// End Filter
$tb = new Table(Get::sett('visu_course'), $lang->def('_COURSE_LIST'), $lang->def('_COURSE_LIST_SUMMARY'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
$category_selected = $this->treeview->getSelectedFolderId();
if ($this->filter['course_flat']) {
$id_categories = $this->treeDB->getDescendantsId($this->treeDB->getFolderById($category_selected));
$id_categories[] = $category_selected;
}
$select = "\r\n\t\tSELECT c.idCourse, c.code, c.name, c.description, c.status, c.difficult,\r\n\t\t\tc.subscribe_method, c.permCloseLo, c.show_rules, c.max_num_subscribe ";
$query_course = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course AS c\r\n\t\tWHERE " . ($with_assesment ? '1' : "c.course_type <> 'assessment'") . " AND c.idCategory IN ( " . (!$this->filter['course_flat'] ? $category_selected : implode(",", $id_categories)) . " )";
if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
$all_courses = false;
require_once _base_ . '/lib/lib.preference.php';
$adminManager = new AdminPreference();
$admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
$all_courses = false;
if (isset($admin_courses['course'][0])) {
$all_courses = true;
} elseif (isset($admin_courses['course'][-1])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
$user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
if (count($user_catalogue) > 0) {
$courses = array(0);
foreach ($user_catalogue as $id_cat) {
$catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
$courses = array_merge($courses, $catalogue_course);
}
foreach ($courses as $id_course) {
if ($id_course != 0) {
$admin_courses['course'][$id_course] = $id_course;
}
}
} elseif (Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
} else {
$array_courses = array();
$array_courses = array_merge($array_courses, $admin_courses['course']);
if (!empty($admin_courses['coursepath'])) {
require_once _lms_ . '/lib/lib.coursepath.php';
$path_man = new CoursePath_Manager();
$coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']);
$array_courses = array_merge($array_courses, $coursepath_course);
}
if (!empty($admin_courses['catalogue'])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
foreach ($admin_courses['catalogue'] as $id_cat) {
$catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
$array_courses = array_merge($array_courses, $catalogue_course);
}
}
$admin_courses['course'] = array_merge($admin_courses['course'], $array_courses);
}
if (!$all_courses) {
if (empty($admin_courses['course'])) {
$query_course .= " AND 0 ";
} else {
$query_course .= " AND c.idCourse IN (" . implode(',', $admin_courses['course']) . ") ";
}
}
}
/*
if($this->filter['course_code'] != '') {
$query_course .= " AND c.code LIKE '%".$this->filter['course_code']."%'";
}*/
if ($this->filter['course_name'] != '') {
$query_course .= " AND ( c.code LIKE '%" . $this->filter['course_name'] . "%' OR c.name LIKE '%" . $this->filter['course_name'] . "%' ) ";
}
list($tot_course) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_course));
$query_course .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem', 25);
$re_course = sql_query($select . $query_course);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_COURSE_SELECTION') . '</span>', $lang->def('_CODE'), $lang->def('_COURSE_NAME'), $lang->def('_STATUS'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$status_array = array(CST_PREPARATION => Lang::t('_CST_PREPARATION', 'course'), CST_AVAILABLE => Lang::t('_CST_AVAILABLE', 'course'), CST_EFFECTIVE => Lang::t('_CST_CONFIRMED', 'course'), CST_CONCLUDED => Lang::t('_CST_CONCLUDED', 'course'), CST_CANCELLED => Lang::t('_CST_CANCELLED', 'course'));
while (list($id_course, $code, $name, $desc, $status, $difficult, $auto_sub, $end_mode, $show_rules, $max_user_sub) = sql_fetch_row($re_course)) {
$tb_content = array(Form::getInputCheckbox('new_course_selected_' . $id_course, 'new_course_selected[' . $id_course . ']', $id_course, isset($this->current_selection[$id_course]), ''), '<label for="new_course_selected_' . $id_course . '">' . $code . '</label>', '<label for="new_course_selected_' . $id_course . '">' . $name . '</label>');
$tb_content[] = $status_array[$status];
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_course])) {
unset($this->current_selection[$id_course]);
}
//.........这里部分代码省略.........
示例10: forumsearchmessage
function forumsearchmessage()
{
checkPerm('view');
$search_arg = $_SESSION['forum']['search_arg'];
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('forum', 'lms');
$id_thread = importVar('idThread', true, 0);
$ini_thread = importVar('ini_thread');
$sema_perm = checkPerm('sema', true);
$moderate = checkPerm('moderate', true);
$mod_perm = checkPerm('mod', true);
$acl_man =& Docebo::user()->getAclManager();
$tb = new Table(Get::sett('visuItem'), $lang->def('_CAPTION_FORUM_MESSAGE'), $lang->def('_CAPTION_FORUM_MESSAGE'));
$tb->initNavBar('ini', 'link');
$tb->setLink('index.php?modname=forum&op=searchmessage&idThread=' . $id_thread . '&ini_thread=' . $ini_thread);
$ini = $tb->getSelectedElement();
$ini_page = $tb->getSelectedPage();
// Some info about forum and thread
$thread_query = "\r\n\tSELECT idForum, title, num_post, locked, erased\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\tWHERE idThread = '" . $id_thread . "'";
list($id_forum, $thread_title, $tot_message, $locked_t, $erased_t) = sql_fetch_row(sql_query($thread_query));
$forum_query = "\r\n\tSELECT title, locked\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum\r\n\tWHERE idForum = '" . $id_forum . "'";
list($forum_title, $locked_f) = sql_fetch_row(sql_query($forum_query));
++$tot_message;
//set as readed if needed
if (isset($_SESSION['unreaded_forum'][$_SESSION['idCourse']][$id_forum][$id_thread])) {
unset($_SESSION['unreaded_forum'][$_SESSION['idCourse']][$id_forum][$id_thread]);
}
if ($ini == 0 && !isset($_GET['result'])) {
sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\t\tSET num_view = num_view + 1\r\n\t\tWHERE idThread = '" . $id_thread . "'");
}
$page_title = array('index.php?modname=forum&op=forum' => $lang->def('_FORUM'), 'index.php?modname=forum&op=search&ini=' . $ini_thread => $thread_title, $lang->def('_SEARCH_RESULT_FOR') . ' : ' . $search_arg);
if ($erased_t && !$mod_perm && !$moderate) {
$GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . $lang->def('_CANNOTENTER') . '</div>', 'content');
return;
}
// Who have semantic evaluation
$re_sema = sql_query("\r\n\tSELECT DISTINCT idmsg\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum_sema");
while (list($msg_sema) = sql_fetch_row($re_sema)) {
$forum_sema[$msg_sema] = 1;
}
// Find post
$messages = array();
$authors = array();
$authors_names = array();
$authors_info = array();
$re_message = sql_query("\r\n\tSELECT idMessage, posted, title, textof, attach, locked, author, modified_by, modified_by_on\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\tWHERE idThread = '" . $id_thread . "'\r\n\tORDER BY posted\r\n\tLIMIT {$ini}, " . Get::sett('visuItem'));
while ($record = mysql_fetch_assoc($re_message)) {
$messages[$record['idMessage']] = $record;
$authors[$record['author']] = $record['author'];
if ($record['modified_by'] != 0) {
$authors[$record['modified_by']] = $record['modified_by'];
}
}
$authors_names =& $acl_man->getUsers($authors);
$level_name = CourseLevel::getLevels();
// Retriving level and number of post of th authors
$re_num_post = sql_query("\r\n\tSELECT u.idUser, u.level, COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage AS m, " . $GLOBALS['prefix_lms'] . "_courseuser AS u\r\n\tWHERE u.idCourse = '" . (int) $_SESSION['idCourse'] . "' AND m.author = u.idUser AND m.author IN ( " . implode($authors, ',') . " )\r\n\tGROUP BY u.idUser, u.level");
while (list($id_u, $level_u, $num_post_a) = sql_fetch_row($re_num_post)) {
$authors_info[$id_u] = array('num_post' => $num_post_a, 'level' => $level_name[$level_u]);
}
$type_h = array('forum_sender', 'forum_text');
$cont_h = array($lang->def('_AUTHOR'), $lang->def('_TEXTOF'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
// Compose messagges display
$path = $GLOBALS['where_files_relative'] . '/appCore/' . Get::sett('pathphoto');
while (list($id_message, $message_info) = each($messages)) {
// sender info
$m_author = $message_info['author'];
if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '') {
$img_size = @getimagesize($path . $authors_names[$m_author][ACL_INFO_AVATAR]);
}
$sender = '<div class="forum_author">' . (isset($authors_names[$m_author]) ? $authors_names[$m_author][ACL_INFO_LASTNAME] . $authors_names[$m_author][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$m_author][ACL_INFO_USERID]) : $authors_names[$m_author][ACL_INFO_LASTNAME] . ' ' . $authors_names[$m_author][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . '</div>' . '<div class="forum_level">' . $lang->def('_LEVEL') . ' : ' . $authors_info[$m_author]['level'] . '</div>' . (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '' ? '<img class="forum_avatar' . ($img_size[0] > 150 || $img_size[1] > 150 ? ' image_limit' : '') . '" src="' . $path . $authors_names[$m_author][ACL_INFO_AVATAR] . '" alt="' . $lang->def('_AVATAR') . '" />' : '') . '<div class="forum_numpost">' . $lang->def('_NUMPOST') . ' : ' . (isset($authors_info[$m_author]['num_post']) ? $authors_info[$m_author]['num_post'] : 0) . '</div>' . '<img src="' . getPathImage() . 'standard/identity.png" alt=">" /> ' . '<a href="index.php?modname=forum&op=viewprofile&idMessage=' . $id_message . '&ini=' . $ini_page . '&idThread=' . $id_thread . '">' . $lang->def('_VIEW_PROFILE') . '</a>';
// msg info
$msgtext = '';
$msgtext .= '<div class="forum_post_posted">' . $lang->def('_DATE') . ' : ' . Format::date($message_info['posted']) . ' ( ' . loadDistance($message_info['posted']) . ' )' . '</div>';
if ($message_info['locked']) {
$msgtext .= '<div class="forum_post_locked">' . $lang->def('_LOCKEDMESS') . '</div>';
} else {
if ($message_info['attach'] != '') {
$msgtext .= '<div class="forum_post_attach">' . '<a href="index.php?modname=forum&op=download&id=' . $id_message . '">' . $lang->def('_ATTACHMENT') . ' : ' . '<img src="' . getPathImage() . mimeDetect($message_info['attach']) . '" alt="' . $lang->def('_ATTACHMENT') . '" /></a>' . '</div>';
}
$textof = str_replace('[quote]', '<blockquote class="forum_quote">', str_replace('[/quote]', '</blockquote>', $message_info['textof']));
$msgtext .= '<div class="forum_post_title">' . $lang->def('_SUBJECT') . ' : ' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $message_info['title']) : $message_info['title']) . '</div>';
$msgtext .= '<div class="forum_post_text">' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $textof) : $textof) . '</div>';
if ($message_info['modified_by'] != 0) {
$modify_by = $message_info['modified_by'];
$msgtext .= '<div class="forum_post_modified_by">' . $lang->def('_MODIFY_BY') . ' : ' . (isset($authors_names[$modify_by]) ? $authors_names[$modify_by][ACL_INFO_LASTNAME] . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$modify_by][ACL_INFO_USERID]) : $authors_names[$modify_by][ACL_INFO_LASTNAME] . ' ' . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . ' ' . $lang->def('_ON') . ' : ' . Format::date($message_info['modified_by_on']) . '</div>';
}
if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_SIGNATURE] != '') {
$msgtext .= '<div class="forum_post_sign_separator"></div>' . '<div class="forum_post_sign">' . $authors_names[$m_author][ACL_INFO_SIGNATURE] . '</div>';
}
}
$content = array($sender, $msgtext);
$tb->addBody($content);
// some action that you can do with this message
$action = '';
if ($moderate || $mod_perm) {
if ($message_info['locked']) {
//.........这里部分代码省略.........
示例11: viewUserEvent
function viewUserEvent()
{
checkPerm('view');
require_once _base_ . '/lib/lib.navbar.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('reservation');
$id_event = importVar('id_event', true, 0);
$mod_perm = checkPerm('mod', true);
$out = $GLOBALS['page'];
$out->setWorkingZone('content');
$man_res = new Man_Reservation();
$acl =& Docebo::user()->getAcl();
$acl_man =& Docebo::user()->getAclManager();
$user_idst = getLogUserId();
$user_subscribed = array();
$user_sunscribed = $man_res->getSubscribedUserIdst($id_event);
$user_info = array();
$user_info =& $acl_man->getUsers($user_sunscribed);
$out->add(getTitleArea($lang->def('_VIEW_EVENT_USER'), '', $lang->def('_EVENT')) . '<div class="std_block">');
$error = importVar('error', false, '');
if ($error !== '') {
switch ($error) {
case 'del_registration':
$out->add(getErrorUi($lang->def('_DEL_REGISTRATION_ERROR')));
break;
}
}
if ($user_info) {
$tb = new Table(10, $lang->def('_RESERVATION_CAPTION'), $lang->def('_RESERVATION_SUMMARY'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
$cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'));
$type_h = array('', '', '', '');
if ($mod_perm) {
$cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'), '<img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_REM_USER') . '" alt="' . $lang->def('_REM_USER') . '" />');
$type_h = array('', '', '', '', 'img');
}
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
if ($user_info) {
foreach ($user_info as $info_user) {
$count = array();
$count[] = $acl_man->relativeId($info_user[ACL_INFO_USERID]);
$count[] = $info_user[ACL_INFO_FIRSTNAME];
$count[] = $info_user[ACL_INFO_LASTNAME];
$count[] = $info_user[ACL_INFO_EMAIL];
$count[] = '<a href="index.php?modname=reservation&op=del_registration&id_user=' . $info_user[ACL_INFO_IDST] . '&id_event=' . $id_event . '"><img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_REM_USER') . '" alt="' . $lang->def('_REM_USER') . '" /></a>';
$tb->addBody($count);
}
}
if ($mod_perm) {
$tb->addActionAdd('<a href="index.php?modname=reservation&op=add_event">
<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW_EVENT') . '" alt="' . $lang->def('_NEW_EVENT') . '" /> ' . $lang->def('_NEW_EVENT') . '</a>');
}
$out->add($tb->getTable() . $tb->getNavBar($ini, count($user_info)));
$out->add('<a href="index.php?modname=reservation&op=excel&id_event=' . $id_event . '" target="_blank">' . $lang->def('_EXPORT_XLS') . '</a>', 'content');
} else {
$out->add($lang->def('_NO_USERS_FOUND'), 'content');
}
$out->add(getBackUi('index.php?modname=reservation&op=view_registration', $lang->def('_BACK')), 'content');
$out->add('</div>', 'content');
}
示例12: get_report_table
//.........这里部分代码省略.........
$_SESSION['report_admin_filter']['author'] = 0;
$_SESSION['report_admin_filter']['name'] = '';
$_SESSION['report_admin_filter']['type'] = 0;
}
$dropdown_onclick = 'onchange="javascript:setReportFilter();"';
$output .= Form::openForm('report_searchbox_form', 'index.php?modname=report&op=reportlist&of_platform=lms', false, 'POST');
$output .= Form::getHidden('op', 'op', 'reportlist');
$output .= Form::getHidden('modname', 'modname', 'report');
$output .= '<div class="quick_search_form">
<div>
<div class="simple_search_box" id="report_searchbox_simple_filter_options" style="display: block;">' . Form::getInputDropdown('dropdown', 'report_searchbox_filter_author', 'filter_author', $authors, $_SESSION['report_admin_filter']['author'], $dropdown_onclick) . " " . Form::getInputTextfield("search_t", "report_searchbox_filter_name", "filter_name", $_SESSION['report_admin_filter']['name'], '', 255, '') . Form::getButton("report_searchbox_filter_set", "search", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("report_searchbox_filter_reset", "reset", Lang::t('_RESET', 'standard'), "reset_b") . '</div>
</div>
</div>';
$output .= Form::closeForm();
//end filter
//compose search query
$qconds = array();
$query = "SELECT t1.*, t2.userid FROM %lms_report_filter as t1 LEFT JOIN %adm_user as t2 ON t1.author=t2.idst ";
switch ($level) {
case ADMIN_GROUP_GODADMIN:
if ($_SESSION['report_admin_filter']['author'] > 0) {
$qconds[] = " t1.author = " . $_SESSION['report_admin_filter']['author'] . " ";
}
break;
case ADMIN_GROUP_ADMIN:
case ADMIN_GROUP_PUBLICADMIN:
case ADMIN_GROUP_USER:
default:
if ($_SESSION['report_admin_filter']['author'] > 0) {
$qconds[] = " ( t1.author = " . $_SESSION['report_admin_filter']['author'] . " AND t1.is_public = 1 ) ";
} else {
$qconds[] = " ( t1.author = " . Docebo::user()->getIdst() . " OR t1.is_public = 1 ) ";
}
break;
}
if (trim($_SESSION['report_admin_filter']['name']) != "") {
$qconds[] = " t1.filter_name LIKE '%" . $_SESSION['report_admin_filter']['name'] . "%' ";
}
if (trim($_SESSION['report_admin_filter']['type']) > 0) {
//$qconds[] = " t1.filter_name LIKE '".$_SESSION['report_admin_filter']['name']."' ";
}
if (!empty($qconds)) {
$query .= " WHERE " . implode(" AND ", $qconds);
}
//$_SESSION['report_admin_filter']['type']
//end query
$tb = new Table(Get::sett('visu_course'));
$tb->initNavBar('ini', 'button');
$col_type = array('', '', 'align_center', 'image', 'image', 'img-cell', 'img-cell', 'image');
//,'image','image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR'), $lang->def('_CREATION_DATE'), $lang->def('_TAB_REP_PUBLIC'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_VIEW') . '" title="' . $lang->def('_VIEW') . '" />', '<span class="ico-sprite subs_csv"><span>' . Lang::t('_EXPORT_CSV', 'report') . '</span></span>', '<span class="ico-sprite subs_xls"><span>' . Lang::t('_EXPORT_XLS', 'report') . '</span></span>', '<img src="' . getPathImage() . 'standard/wait_alarm.png" alt="' . $lang->def('_SCHEDULE') . '" title="' . $lang->def('_SCHEDULE') . '" />');
if ($is_admin || $can_mod) {
$col_type[] = 'image';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '" />';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '" />';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
if ($res = sql_query($query)) {
while ($row = sql_fetch_assoc($res)) {
$id = $row['id_filter'];
$opn_link = '<a href="index.php?modname=report&op=show_results&idrep=' . $id . '" ' . ' title="' . $lang->def('_VIEW') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_VIEW') . '" />' . '</a>';
$sch_link = '<a href="index.php?modname=report&op=schedulelist&idrep=' . $id . '" ' . ' title="' . $lang->def('_SCHEDULE') . '">' . '<img src="' . getPathImage() . 'standard/wait_alarm.png" alt="' . $lang->def('_SCHEDULE') . '" />' . '</a>';
$mod_link = '<a href="' . $url . '&action=modify&idrep=' . $id . '" ' . ' title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />' . '</a>';
$rem_link = '<a href="' . $url . '&action=delete&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL') . ' : ' . ($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name']) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
//.
'</a>';
$can_public = $can_mod ? true : ($is_admin && $row['author'] == Docebo::user()->getIdst() ? true : false);
$public = '<image ' . ($can_public ? 'class="handover"' : '') . ' src="' . getPathImage('lms') . 'standard/' . ($row['is_public'] == 1 ? '' : 'un') . 'publish.png' . '" ' . ($is_admin || $can_mod ? 'onclick="public_report(this, ' . $row['id_filter'] . ');" ' : '') . ' />' . '<input type="hidden" id="enable_value_' . $row['id_filter'] . '" ' . 'value="' . ($row['is_public'] == 1 ? '0' : '1') . '" />';
$export_url = 'index.php?modname=report&op=show_results&idrep=' . (int) $id;
$export_link_csv = '<a class="ico-sprite subs_csv" href="' . $export_url . '&dl=csv" title="' . Lang::t('_EXPORT_CSV', 'report') . '"><span></span>' . Lang::t('_EXPORT_CSV', 'report') . '</a>';
$export_link_xls = '<a class="ico-sprite subs_xls" href="' . $export_url . '&dl=xls" title="' . Lang::t('_EXPORT_XLS', 'report') . '"><span></span>' . Lang::t('_EXPORT_XLS', 'report') . '</a>';
$_name = $row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'];
if (trim($_SESSION['report_admin_filter']['name']) != "") {
$_name = Layout::highlight($_name, $_SESSION['report_admin_filter']['name']);
}
$tb_content = array(_REP_KEY_NAME => $_name, _REP_KEY_CREATOR => $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), _REP_KEY_CREATION => Format::date($row['creation_date']), _REP_KEY_PUBLIC => $public, _REP_KEY_OPEN => $opn_link, $export_link_csv, $export_link_xls, _REP_KEY_SCHED => $sch_link);
if ($is_admin || $can_mod) {
if ($row['author'] == Docebo::user()->getIdst() || $can_mod) {
$tb_content[_REP_KEY_MOD] = $mod_link;
$tb_content[_REP_KEY_REM] = $rem_link;
} else {
$tb_content[_REP_KEY_MOD] = ' ';
$tb_content[_REP_KEY_REM] = ' ';
}
}
$tb->addBody($tb_content);
}
}
if ($is_admin || $can_mod) {
//if ($can_mod) {
$tb->addActionAdd('
<a href="index.php?modname=report&op=report_category">' . '<img src="' . getPathImage() . 'standard/add.png" ' . 'title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
}
$output .= $tb->getTable();
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=delete]');
return $output;
}
示例13: wikiPageHistory
function wikiPageHistory($vis_item = FALSE)
{
require_once _base_ . '/lib/lib.table.php';
require_once $GLOBALS["where_framework"] . "/lib/lib.wiki_revision.php";
require_once _base_ . "/lib/lib.form.php";
$res = "";
$wiki_id = $this->getWikiId();
$page_code = $this->getPageCode();
$wiki_lang = $this->getWikiLanguage();
$page_info = $this->wikiManager->getPageInfo($wiki_id, $wiki_lang, $page_code);
$wiki_lang = $this->getWikiLanguage();
$form = new Form();
$rev = new WikiRevisionManager(array($wiki_id, $page_info["page_id"], $wiki_lang));
if ($vis_item === FALSE) {
$vis_item = Get::sett('visuItem');
}
$table_caption = $this->lang->def("_HISTORY");
$table_summary = $this->lang->def("_HISTORY");
$um =& UrlManager::getInstance();
$tab = new Table($vis_item, $table_caption, $table_summary);
$head = array($this->lang->def("_VERSION"));
$head[] = $this->lang->def("_AUTHOR");
$head[] = $this->lang->def("_DATE");
$img = "<img src=\"" . getPathImage('fw') . "wiki/show.png\" alt=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" ";
$img .= "title=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" />";
$head[] = " ";
//$img;
$img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" ";
$img .= "title=\"" . $this->lang->def("_MOD") . "\" />";
$head[] = " ";
//$img;
$head_type = array("", "", "", "image", "image");
$tab->setColsStyle($head_type);
$tab->addHead($head);
$tab->initNavBar('ini', 'link');
$tab->setLink($um->getUrl());
$ini = $tab->getSelectedElement();
$data_info = $rev->getRevisionList($ini, $vis_item);
$data_arr = $data_info["data_arr"];
$tot = count($data_arr);
if ($tot != 0) {
$user_arr = $data_info["user"];
}
$db_tot = $data_info["data_tot"];
for ($i = 0; $i < $tot; $i++) {
$rowcnt = array();
$version = $data_arr[$i]["version"];
//rc// $rowcnt[]=$form->getRadio("", "previous_ver_".$version, "previous_ver", $version);
//rc// $rowcnt[]=$form->getRadio("", "current_ver_".$version, "current_ver", $version);;
$rowcnt[] = $version;
$user_idst = $data_arr[$i]["author"];
$rowcnt[] = $user_arr[$user_idst];
$rowcnt[] = Format::date($data_arr[$i]["rev_date"]);
$img = "<img src=\"" . getPathImage('fw') . "wiki/show.png\" alt=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" ";
$img .= "title=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" />";
$url = $um->getUrl("page=" . $page_code . "&version=" . $version);
$rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
$img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" ";
$img .= "title=\"" . $this->lang->def("_MOD") . "\" />";
$url = $um->getUrl("op=edit&page=" . $page_code . "&version=" . $version);
$rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n";
$tab->addBody($rowcnt);
}
$url = $um->getUrl("op=history&page=" . $page_code);
//rc// $res.=$form->openForm("main_form", $url);
$tab->setLink($url);
$res .= $tab->getTable() . $tab->getNavBar($ini, $db_tot);
//rc// $res.=$form->openButtonSpace();
//rc// $res.=$form->getButton("compare", "compare", $this->lang->def("_COMPARE_SEL_VER"));
//rc// $res.=$form->closeButtonSpace();
//rc// $res.=$form->closeForm();
return $res;
}
示例14: classroom
function classroom()
{
checkPerm('view');
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$mod_perm = true;
// create a language istance for module admin_classroom
$lang =& DoceboLanguage::createInstance('admin_classroom', 'lms');
$out =& $GLOBALS['page'];
$out->setWorkingZone('content');
$tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOM_CAPTION'), $lang->def('_CLASSROOM_SUMMARY'));
$tb->initNavBar('ini', 'link');
$tb->setLink('index.php?modname=reservation&op=classroom&id_course=' . $_SESSION['idCourse']);
$ini = $tb->getSelectedElement();
//search query of classrooms
$query_classroom = "\r\n\t\tSELECT idClassroom, name, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom\r\n\t\tORDER BY name\r\n\t\tLIMIT {$ini}," . Get::sett('visuItem');
$query_classroom_tot = "\r\n\t\tSELECT COUNT(*)\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom";
$re_classroom = sql_query($query_classroom);
list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot));
$type_h = array('', 'news_short_td', "image", "image");
$cont_h = array($lang->def('_NAME'), $lang->def('_DESCRIPTION'));
if ($mod_perm) {
$cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_TITLE_MOD_CLASSROOM') . '" ' . 'alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" ' . 'alt="' . $lang->def('_DEL') . '"" />';
$type_h[] = 'image';
}
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($idClassroom, $name, $descr) = sql_fetch_row($re_classroom)) {
$cont = array($name, $descr);
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=reservation&op=modclassroom&idClassroom=' . $idClassroom . '" ' . 'title="' . $lang->def('_TITLE_MOD_CLASSROOM') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $name . '" /></a>';
$cont[] = '<a href="index.php?modname=reservation&op=delclassroom&idClassroom=' . $idClassroom . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $name . '" /></a>';
}
$tb->addBody($cont);
}
if ($mod_perm) {
$tb->addActionAdd('<a href="index.php?modname=reservation&op=addclassroom" title="' . $lang->def('_TITLE_NEW_CLASSROOM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_NEW_CLASSROOM') . '</a>');
}
$out->add(getTitleArea($lang->def('_TITLE_CLASSROOM'), 'classroom', $lang->def('_ALT_TITLE_CLASSROOM')) . '<div class="std_block">');
if (isset($_GET['result'])) {
switch ($_GET['result']) {
case "ok":
$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
break;
case "err":
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
case "err_del":
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
}
}
$out->add(getBackUi('index.php?modname=reservation&op=reservation&active_tab=subscribed_user', $lang->def('_BACK')));
$out->add($tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . '</div>');
}
示例15: view_report_certificate
function view_report_certificate()
{
checkPerm('view');
require_once _lms_ . '/lib/lib.certificate.php';
require_once _lms_ . '/lib/lib.course.php';
$out =& $GLOBALS['page'];
$out->setWorkingZone('content');
$lang =& DoceboLanguage::createInstance('certificate', 'lms');
$deletion = importVar('deletion', true, 0);
if ($deletion) {
switch ($deletion) {
case 1:
$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
break;
case 2:
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
case 3:
$out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
break;
}
}
$certificate = new Certificate();
$id_certificate = importVar('id_certificate', true, 0);
$id_course = importVar('id_course', true, 0);
$selection = importVar('selection', false, array());
//all possible selected values
$selected = importVar('selected', false, array());
//effectively selected values with checkbox
$sel = importVar('old_selection', false, '');
//selected values from previous table pages
if ($sel != '') {
$total_selection = explode(',', $sel);
} else {
$total_selection = array();
}
//update total selection
foreach ($selection as $key => $val) {
if (in_array($val, $selected)) {
if (!in_array($val, $total_selection)) {
$total_selection[] = $val;
}
} else {
$index = array_search($val, $total_selection);
if ($index !== false) {
array_splice($total_selection, $index, 1);
}
}
}
$search_filter = importVar('filter', false, '');
$only_released = importVar('only_released', true, 0);
//which command?
if (importVar('search_button', false, false) !== false) {
}
if (importVar('reset_button', false, false) !== false) {
$search_filter = '';
$only_released = 0;
}
if (importVar('print_button', false, false) !== false) {
}
$numtablerows = $GLOBALS['framework']['visuItem'];
$tb = new Table($numtablerows, $lang->def('_CERTIFICATE_VIEW_CAPTION'), $lang->def('_CERTIFICATE_VIEW_CAPTION'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
$tca = $GLOBALS['prefix_lms'] . "_certificate_assign as ca";
$tcc = $GLOBALS['prefix_lms'] . "_certificate_course as cc";
$tcu = $GLOBALS['prefix_lms'] . "_courseuser as cu";
$tu = $GLOBALS['prefix_fw'] . "_user as u";
$where = "";
if ($search_filter != '') {
$where .= " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') ";
}
if ($only_released > 0) {
$where = " AND ca.on_date " . ($only_released == 1 ? "IS NOT" : "IS") . " NULL ";
}
//$where .= " AND ".$aval_status." ".($only_released==1 ? "<" : ">=")." cu.status ";
list($aval_status) = sql_fetch_row(sql_query("SELECT available_for_status FROM " . $tcc . " " . " WHERE id_certificate='" . (int) $id_certificate . "' AND id_course='" . (int) $id_course . "'"));
switch ($aval_status) {
case AVS_ASSIGN_FOR_ALL_STATUS:
$aval_status = " 1 ";
break;
case AVS_ASSIGN_FOR_STATUS_INCOURSE:
$aval_status = " cu.status = " . _CUS_BEGIN . " ";
break;
case AVS_ASSIGN_FOR_STATUS_COMPLETED:
$aval_status = " cu.status = " . _CUS_END . " ";
break;
}
list($totalrows) = sql_fetch_row(sql_query("SELECT COUNT(*) " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where));
$query = "SELECT u.userid, u.firstname, u.lastname, cu.date_complete, ca.on_date, cu.idUser as id_user, cu.status " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where . " ORDER BY u.userid LIMIT " . $ini . ", " . $numtablerows;
$res = sql_query($query);
$from = Get::req('from', DOTY_MIXED, '');
$back_ui = getBackUi('index.php?r=lms/pcourse/certificate&id_course=' . (int) $id_course, $lang->def('_BACK'));
$out->add(getTitleArea(array('index.php?r=lms/pcourse/certificate&id_course=' . (int) $id_course => $lang->def('_CERTIFICATE_ASSIGN_STATUS', 'course'), $lang->def('_CERTIFICATE_REPORT_COURSE_CERT')), 'certificate'));
$out->add('<div class="std_block">' . $back_ui);
$numrows = sql_num_rows($res);
$downloadables = array();
if ($numrows > 0) {
$clang =& DoceboLanguage::CreateInstance('course', 'lms');
$type_h = array('image', '', '', '', '', '', '', 'image', 'image');
//.........这里部分代码省略.........