本文整理汇总了PHP中Table::getNavBar方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getNavBar方法的具体用法?PHP Table::getNavBar怎么用?PHP Table::getNavBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::getNavBar方法的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: loadCoursepathSelector
function loadCoursepathSelector($noprint = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('coursepath', 'lms');
$output = '';
// Filter
$this->filter['coursepath_name'] = isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '';
if ($this->show_filter === true) {
/*
$form = new Form();
$output .= $form->getOpenFieldset($lang->def('_COURSEPATH_FILTER'))
.Form::getTextfield($lang->def('_NAME'), 'coursepath_filter_name', 'coursepath_filter_name', '255',
( isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '' ))
.$form->openButtonSpace()
.$form->getButton('coursepath_filter', 'coursepath_filter', $lang->def('_SEARCH'))
.$form->closeButtonSpace()
.$form->getCloseFieldset();*/
$output .= '<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "coursepath_filter_name", "coursepath_filter_name", Get::req('coursepath_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("coursepath_filter", "coursepath_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
}
// End Filter
$tb = new Table(Get::sett('visuItem'), $lang->def('_COURSE_PATH_CAPTION'), $lang->def('_COURSE_PATH_SUMMARY'));
$tb->initNavBar('ini_cpath', 'button');
$ini = $tb->getSelectedElement();
$select = "\r\n\t\tSELECT id_path, path_name, path_descr ";
$query_coursepath = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_coursepath\r\n\t\tWHERE 1 ";
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());
if (isset($admin_courses['course'][0])) {
$all_courses = true;
}
if (isset($admin_courses['course'][-1])) {
$query = "SELECT id_path" . " FROM %lms_coursepath_user" . " WHERE idUser = '" . $id_user . "'";
$result = sql_query($query);
$admin_courses['coursepath'] = array();
while (list($id_path) = sql_fetch_row($result)) {
$admin_courses['coursepath'][$id_path] = $id_path;
}
if (!empty($admin_courses['coursepath']) && Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
}
if (!$all_courses) {
if (empty($admin_courses['coursepath'])) {
$query_coursepath .= " AND 0 ";
} else {
$query_coursepath .= " AND id_path IN (" . implode(',', $admin_courses['coursepath']) . ") ";
}
}
}
if ($this->filter['coursepath_name'] != '') {
$query_coursepath .= " AND path_name LIKE '%" . $this->filter['coursepath_name'] . "%'";
}
list($tot_coursepath) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_coursepath));
$query_coursepath .= "\r\n\t\tORDER BY path_name\r\n\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
$re_coursepath = sql_query($select . $query_coursepath);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_SELECT') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id_path, $name, $descr) = sql_fetch_row($re_coursepath)) {
$tb_content = array(Form::getInputCheckbox('new_coursepath_selected_' . $id_path, 'new_coursepath_selected[' . $id_path . ']', $id_path, isset($this->current_selection[$id_path]), ''), '<label for="new_coursepath_selected_' . $id_path . '">' . $name . '</label>', '<label for="new_coursepath_selected_' . $id_path . '">' . $descr . '</label>');
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_path])) {
unset($this->current_selection[$id_path]);
}
}
$output .= $tb->getTable() . $tb->getNavBar($ini, $tot_coursepath) . $this->stateSelection();
if ($noprint) {
return $output;
} else {
cout($output, 'content');
}
}
示例4: showHistory
function showHistory()
{
checkPerm('mod');
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('conference', 'lms');
$conference = new Conference_Manager();
cout('<div class="yui-navset yui-navset-top tab_block">
<ul class="yui-nav">
<li class="first">
<a href="index.php?modname=conference&op=show">
<em>' . Lang::t('_ACTIVE', 'conference') . '</em>
</a>
</li>
<li class="selected">
<a href="index.php?modname=conference&op=history">
<em>' . Lang::t('_HISTORY', 'conference') . '</em>
</a>
</li>
</ul>
<div class="yui-content">', 'content');
$tb = new Table(10, $lang->def('_OLD_ROOMS'), $lang->def('_OLD_ROOM'));
$tb->initNavBar('ini', 'button');
$ini = $tb->getSelectedElement();
if (isset($_POST['unset_filter'])) {
unset($_POST['filter_date']);
}
$date_filter = Get::req('filter_date', DOTY_MIXED, '');
$rooms = $conference->getOldRoom($_SESSION['idCourse'], $ini);
$rooms_number = $conference->getOldRoomNumber($_SESSION['idCourse']);
if ($rooms_number == 0) {
$GLOBALS['page']->add(Form::openForm('history_table', 'index.php?modname=conference&op=history') . Form::openElementSpace() . Form::getDatefield($lang->def('_DATE'), 'filter_date', 'filter_date', $date_filter) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('unset_filter', 'unset_filter', $lang->def('_UNDO')) . Form::closeElementSpace() . Form::closeForm() . '<strong id="noroom">' . $lang->def('_NO_ROOM_AVAILABLE') . '</strong>' . '<br/>' . getBackUi('index.php?modname=conference&op=list', $lang->def('_BACK')), 'content');
} else {
$cont_h = array($lang->def('_VIDEOCONFERENCE'), $lang->def('_START_DATE'), $lang->def('_MEETING_HOURS'), '');
$type_h = array('table_main_colum', 'align_center nowrap', 'align_center nowrap', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
foreach ($rooms as $room_info) {
$room_id = $room_info['id'];
$cont = array();
$cont[] = $room_info['name'] . " (" . $room_info['room_type'] . ")";
$cont[] = Format::date(date('Y-m-d H:i:s', $room_info['starttime']), 'datetime');
$cont[] = $room_info['meetinghours'];
$now = time();
if ($room_info['room_type'] == 'teleskill') {
$cont[] = '<a href="index.php?modname=conference&op=log&id=' . $room_info['id'] . '" ' . 'title="' . $lang->def('_LOG') . ' : ' . strip_tags($room_info['name']) . '"><img src="' . getPathImage() . '/standard/edit.png' . '" /></a>';
} else {
$cont[] = '';
}
$tb->addBody($cont);
}
cout(Form::openForm('history_table', 'index.php?modname=conference&op=history') . Form::openElementSpace() . Form::getDatefield($lang->def('_DATE'), 'filter_date', 'filter_date', $date_filter) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('unset_filter', 'unset_filter', $lang->def('_UNDO')) . Form::closeElementSpace() . Form::closeForm() . $tb->getTable() . $tb->getNavBar($ini, $rooms_number) . '<br/>' . getBackUi('index.php?modname=conference&op=list', $lang->def('_BACK')), 'content');
}
cout('<div class="nofloat"></div></div></div>', 'content');
}
示例5: 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>');
}
示例6: 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');
}
示例7: 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>');
}
示例8: view_report_certificate
//.........这里部分代码省略.........
}
//$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');
$cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::img('course/certificate.png', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::img('standard/delete.png', Lang::t('_DEL', 'certificate')));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$acl_man =& $GLOBALS['current_user']->getAclManager();
$arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND'));
//foreach($report_info as $info_report)
while ($info = sql_fetch_assoc($res)) {
$cont = array();
$can_assign = (bool) ($info['on_date'] == '');
$input_id = $info['id_user'];
$sel_cell_content = '';
$label_open = '';
$label_close = '';
if ($can_assign) {
$input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> ';
if (in_array($input_id, $total_selection)) {
$checked = ' checked="checked"';
} else {
$checked = '';
}
$sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>';
$label_open = '<label for="selected_' . $input_id . '">';
$label_close = '</label>';
}
$userid = $acl_man->relativeId($info['userid']);
$cont[] = $sel_cell_content;
$cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close;
$cont[] = $arr_status[$info['status']];
$cont[] = $info['date_complete'];
$cont[] = $info['on_date'];
$url = 'index.php?modname=pcertificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $info['id_user'];
$dl_url = $url . "&op=send_certificate";
if ($can_assign) {
$downloadables[] = 'dl_single_' . $input_id;
}
$cont[] = '<a href="' . ($can_assign ? "javascript:;" : $dl_url) . '" id="dl_single_' . $input_id . '">' . Get::img('course/certificate.png', Lang::t('_TITLE_VIEW_CERT', 'certificate')) . ($can_assign ? $lang->def('_GENERATE') : $lang->def('_DOWNLOAD')) . '</a>';
$cont[] = $can_assign ? "" : '<a href="' . $url . '&op=del_report_certificate">' . Get::img('standard/delete.png', Lang::t('_DEL', 'certificate')) . '</a>';
$tb->addBody($cont);
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_report_certificate]');
$form = new Form();
$form_url = "index.php?modname=pcertificate&op=view_report_certificate&id_certificate=" . (int) $id_certificate . "&id_course=" . (int) $id_course;
$out->add($form->openForm("certificates_emission", $form_url));
$out->add($form->getHidden('old_selection', 'old_selection', implode(',', $total_selection)));
//search filter ...
$release_options = array($lang->def('_ALL') => 0, $lang->def('_ONLY_RELEASED') => 1, $lang->def('_ONLY_TO_RELEASE') => 2);
/*
$out->add($form->getOpenFieldset($lang->def('_SEARCH_FILTER')));
$out->add($form->getTextfield($lang->def('_FILTER'), "filter", "filter", 255, $search_filter));
$out->add($form->getRadioSet($lang->def('_RELEASE_OPTIONS'), 'only_released', 'only_released', $release_options, $only_released).'<div class="no_float"></div>');
$out->add($form->openButtonSpace());
$out->add($form->getButton("search_button", "search_button", $lang->def('_SEARCH')));
$out->add($form->getButton("reset_button", "reset_button", $lang->def('_UNDO')));
$out->add($form->closeButtonSpace());
$out->add($form->getCloseFieldset());
*/
$print_button_1 = '<div><a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a></div>';
$print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a></div>';
cout('<div class="quick_search_form">' . Form::getInputTextfield("_FILTER", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '<br />' . '<br />' . $lang->def('_RELEASE_OPTIONS') . ': ' . Form::getInputRadio('only_released_0', 'only_released', '0', $only_released == 0, '') . ' <label class="label_normal" for="only_released_0">' . Lang::t('_ALL', 'certificate') . '</label>' . ' ' . Form::getInputRadio('only_released_1', 'only_released', '1', $only_released == 1, '') . ' <label class="label_normal" for="only_released_1">' . Lang::t('_ONLY_RELEASED', 'certificate') . '</label>' . ' ' . Form::getInputRadio('only_released_2', 'only_released', '2', $only_released == 2, '') . ' <label class="label_normal" for="only_released_2">' . Lang::t('_ONLY_TO_RELEASE', 'certificate') . '</label>' . Form::closeForm() . '</div>', 'content');
$navbar = $tb->getNavBar($ini, $totalrows);
$out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2);
$out->add($form->closeForm());
} else {
$out->add($lang->def('_NO_USER_FOR_CERTIFICATE'));
}
$out->add($back_ui . '</div>');
addCss('style_menu', 'lms');
Util::get_js(Get::rel_path('lms') . '/modules/pcertificate/pcertificate.js', true, true);
$script = 'var ajax_url="ajax.server.php?plf=lms&mn=pcertificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&', '&', isset($form_url) ? $form_url : '') . '", _ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '";';
$out->add('<script type="text/javascript">' . $script . '</script>', 'page_head');
}
示例9: codeList
function codeList()
{
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('code');
$id_code_group = Get::req('id_code_group', DOTY_INT, '0');
$code_manager = new CodeManager();
$acl_man = Docebo::user()->getAclManager();
cout(getTitleArea(array('index.php?modname=code&op=list' => $lang->def('_CODE'), $lang->def('_CODE_LIST'))) . '<div class="std_block">');
if (isset($_POST['undo_filter'])) {
unset($_POST['code_filter']);
}
cout('<div class="quick_search_form">' . Form::openForm('code_list_filter', 'index.php?modname=code&op=code_list&id_code_group=' . $id_code_group) . Form::getInputTextfield("search_t", "code_filter", "code_filter", isset($_POST['code_filter']) ? $_POST['code_filter'] : '', '', 255, '') . Form::getButton("filter", "filter", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("undo_filter", "undo_filter", Lang::t('_RESET', 'standard'), "reset_b") . Form::closeForm() . '</div>');
$result = Get::req('result', DOTY_STRING, '');
switch ($result) {
case 'ok':
UIFeedback::info($lang->def('_OPERATION_SUCCESSFUL'));
break;
case 'err':
UIFeedback::error($lang->def('_OPERATION_FAILURE'));
break;
case 'err_dup':
UIFeedback::error($lang->def('_DUPLICATED_CODE'));
break;
}
$tot_code = $code_manager->getCodeNumber($id_code_group, isset($_POST['undo_filter']) ? $_POST['undo_filter'] : false);
if ($tot_code) {
$tb = new Table('20');
$tb->initNavBar('ini', 'link');
$tb->setLink('index.php?modname=code&op=code_list&id_code_group=' . $id_code_group);
$ini = $tb->getSelectedElement();
$cont_h = array($lang->def('_CODE'), $lang->def('_USED'), $lang->def('_USERNAME'), $lang->def('_UNLIMITED_USE'), '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />');
$type_h = array('', 'image', '', 'image', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$array_code = $code_manager->getCodeList($id_code_group, $ini);
foreach ($array_code as $code_info) {
$cont = array();
$cont[] = $code_info['code'];
if ($code_info['used']) {
$cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_USED') . '" />';
$user_info = $acl_man->getUser($code_info['id_user'], false);
if ($user_info) {
$cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]);
} else {
$user_info = $acl_man->getTempUserInfo($code_info['id_user'], false);
$cont[] = $acl_man->relativeId($user_info['userid']);
}
if ($code_info['unlimited_use'] == '1') {
$cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_UNLIMITED_USE') . '" />';
} else {
$cont[] = '-';
}
$cont[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
} else {
$cont[] = '-';
$cont[] = $lang->def('_NONE');
if ($code_info['unlimited_use'] == '1') {
$cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_UNLIMITED_USE') . '" />';
} else {
$cont[] = '-';
}
$cont[] = '<a href="index.php?modname=code&op=mod_code&id_code_group=' . $id_code_group . '&code=' . $code_info['code'] . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
}
$cont[] = '<a href="index.php?modname=code&op=del_code&id_code_group=' . $id_code_group . '&code=' . $code_info['code'] . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
$tb->addBody($cont);
}
$tb->addActionAdd('<a href="index.php?modname=code&op=add_code&id_code_group=' . $id_code_group . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
$tb->addActionAdd('<a class="ico-wt-sprite subs_xls" title="' . Lang::t('_EXPORT_XLS', 'report') . '" ' . 'href="index.php?modname=code&op=export&id_code_group=' . $id_code_group . '&format=xls">' . '<span>' . Lang::t('_EXPORT_XLS', 'report') . '</span></a>');
$tb->addActionAdd('<a class="ico-wt-sprite subs_csv" title="' . Lang::t('_EXPORT_CSV', 'report') . '" ' . 'href="index.php?modname=code&op=export&id_code_group=' . $id_code_group . '&format=csv">' . '<span>' . Lang::t('_EXPORT_CSV', 'report') . '</span></a>');
cout($tb->getTable() . $tb->getNavBar($ini, $tot_code));
setupHrefDialogBox('a[href*=del_code]');
} else {
cout($lang->def('_NO_CODE_FOUND') . '<br/>' . '<a href="index.php?modname=code&op=add_code&id_code_group=' . $id_code_group . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
}
cout('<br/><br/>' . getBackUi('index.php?modname=code&op=list', $lang->def('_BACK')) . '</div>');
}
示例10: forumsearchmessage
//.........这里部分代码省略.........
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']) {
$action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/demoderate.png" alt="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEMODERATE') . '</a> ';
} else {
$action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MODERATE') . '</a> ';
}
}
if (!$locked_t && !$locked_f || $mod_perm || $moderate) {
$action .= '<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/reply.png" alt="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_QUOTE') . '</a>';
}
if ($moderate || $mod_perm || $m_author == getLogUserId()) {
$action .= '<a href="index.php?modname=forum&op=modmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MOD_MESSAGE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MOD') . '</a>' . '<a href="index.php?modname=forum&op=delmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEL') . '</a> ';
}
$tb->addBodyExpanded($action, 'forum_action');
}
if (!$locked_t && !$locked_f || $mod_perm || $moderate) {
$tb->addActionAdd('<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&ini=' . $ini_page . '" title="' . $lang->def('_REPLY') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_REPLY') . '</a>');
}
$GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . Form::openForm('search_forum', 'index.php?modname=forum&op=search&idThread=' . $id_thread) . '<div class="quick_search_form">' . '<label for="search_arg">' . $lang->def('_SEARCH_LABEL') . '</label> ' . Form::getInputTextfield('search_t', 'search_arg', 'search_arg', $search_arg, $lang->def('_SEARCH'), 255, '') . '<input class="search_b" type="submit" id="search_button" name="search_button" value="' . $lang->def('_SEARCH') . '" />' . '</div>' . Form::closeForm(), 'content');
if ($moderate || $mod_perm) {
$GLOBALS['page']->add('<div class="forum_action_top">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content');
}
$GLOBALS['page']->add($tb->getTable(), 'content');
if ($moderate || $mod_perm) {
$GLOBALS['page']->add('<div class="forum_action_bottom">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content');
}
$GLOBALS['page']->add($tb->getNavBar($ini, $tot_message) . '</div>', 'content');
}
示例11: view_report_certificate
//.........这里部分代码省略.........
} else {
$back_ui = getBackUi('index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate, $lang->def('_BACK'));
$out->add(getTitleArea(array('index.php?modname=certificate&op=certificate' => $lang->def('_TITLE_CERTIFICATE'), 'index.php?modname=certificate&op=report_certificate&id_certificate=' . (int) $id_certificate => $lang->def('_COURSES'), $lang->def('_CERTIFICATE_VIEW_CAPTION')), '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');
$cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::sprite('subs_pdf', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::sprite('subs_del', Lang::t('_DEL', 'certificate')));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$acl_man =& $GLOBALS['current_user']->getAclManager();
$arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND'));
//foreach($report_info as $info_report)
while ($info = sql_fetch_assoc($res)) {
$cont = array();
$can_assign = (bool) ($info['on_date'] == '');
$input_id = $info['id_user'];
$sel_cell_content = '';
$label_open = '';
$label_close = '';
if ($can_assign) {
$input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> ';
if (in_array($input_id, $total_selection)) {
$checked = ' checked="checked"';
} else {
$checked = '';
}
$sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>';
$label_open = '<label for="selected_' . $input_id . '">';
$label_close = '</label>';
}
$userid = $acl_man->relativeId($info['userid']);
$cont[] = $sel_cell_content;
$cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close;
$cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close;
$cont[] = $arr_status[$info['status']];
$cont[] = $info['date_complete'];
$cont[] = $info['on_date'];
$url = 'index.php?modname=certificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $info['id_user'];
$dl_url = $url . "&op=send_certificate";
if ($can_assign) {
$downloadables[] = 'dl_single_' . $input_id;
}
$cont[] = $can_assign ? '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="javascript:;" title="' . $lang->def('_GENERATE') . '"><span>' . $lang->def('_GENERATE') . '</span></a>' : '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="' . $dl_url . '" title="' . $lang->def('_DOWNLOAD') . '"><span>' . $lang->def('_DOWNLOAD') . '</span></a>';
$cont[] = $can_assign ? '' : Get::sprite_link('subs_del', $url . '&op=del_report_certificate', Lang::t('_DEL', 'certificate'));
$tb->addBody($cont);
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_report_certificate]');
//search filter ...
$release_options = array($lang->def('_ALL') => 0, $lang->def('_RELEASED') => 1, $lang->def('_TO_RELEASE') => 2);
//search and store all non-available certificates
$all_selection = array();
$query = "SELECT cu.idUser as id_user " . " 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 . "' " . ($search_filter != '' ? " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') " : "") . " AND ca.on_date IS NULL ";
$res = sql_query($query);
while (list($id_user) = sql_fetch_row($res)) {
$all_selection[] = $id_user;
}
//---
$form = new Form();
$submit_url = "index.php?modname=certificate&op=view_report_certificate&id_certificate=" . (int) $id_certificate . "&id_course=" . (int) $id_course;
$out->add($form->openForm("certificates_emission", $submit_url) . $form->getHidden('old_selection', 'old_selection', implode(',', $total_selection)) . $form->getHidden('all_selection', 'all_selection', implode(',', $all_selection)) . $form->getHidden('active_text_filter', 'active_text_filter', $search_filter) . $form->getHidden('active_only_released', 'active_only_released', $only_released) . $form->getHidden('active_ini', 'active_ini', $ini_param) . '<div class="quick_search_form">' . '<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '</div>' . '<a id="advanced_search" class="advanced_search" href="javascript:;">' . Lang::t("_ADVANCED_SEARCH", 'standard') . '</a>' . '<div id="certificate_release_as" class="advanced_search_options" style="display: ' . ($only_released != 0 ? 'block' : 'none') . '">' . Form::getRadioHoriz(Lang::t('_FILTER', 'certificate'), 'only_released', 'only_released', $release_options, $only_released) . '</div>' . '</div>' . '<script type="text/javascript">' . 'YAHOO.util.Event.addListener("advanced_search", "click", function(e){
var el = YAHOO.util.Dom.get("certificate_release_as");
if (el.style.display != \'block\') el.style.display = \'block\';
else el.style.display = \'none\';
});' . '</script>', 'content');
$delgen_url = 'index.php?modname=certificate&op=del_gen_certificate' . '&id_certificate=' . (int) $id_certificate . '&id_course=' . (int) $id_course;
$delgen_txt = Lang::t('_DELETE_ALL_GENERATED', 'certificate');
$print_button_1 = '<div>' . '<a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
$print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
$print_button_1 .= Lang::t('_SELECT', 'directory') . ': ';
$print_button_2 .= Lang::t('_SELECT', 'directory') . ': ';
/*
$print_button_1 .= ' <a href="javascript:;" id="select_page_1">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
$print_button_2 .= ' <a href="javascript:;" id="select_page_2">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
$print_button_1 .= ' <a href="javascript:;" id="unselect_page_1">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
$print_button_2 .= ' <a href="javascript:;" id="unselect_page_2">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
*/
$print_button_1 .= ' <a href="javascript:;" id="select_all_1">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
$print_button_2 .= ' <a href="javascript:;" id="select_all_2">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
$print_button_1 .= ' <a href="javascript:;" id="unselect_all_1">' . Lang::t('_NONE', 'directory') . '</a>';
$print_button_2 .= ' <a href="javascript:;" id="unselect_all_2">' . Lang::t('_NONE', 'directory') . '</a>';
$navbar = $tb->getNavBar($ini, $totalrows);
$out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2);
$out->add($form->closeForm());
} else {
$out->add($lang->def('_NO_CONTENT'));
}
$out->add($back_ui . '</div>');
addCss('style_menu', 'lms');
Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
Util::get_js(Get::rel_path('lms') . '/admin/modules/certificate/certificate.js?rnd=' . time(), true, true);
//addJs($GLOBALS['where_lms_relative'].'/admin/modules/certificate/', 'certificate.js');
$script = 'var ajax_url="ajax.adm_server.php?plf=lms&mn=certificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&', '&', isset($submit_url) ? $submit_url : '') . '", ' . '_ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '", ' . '_AREYOUSURE="' . Lang::t('_AREYOUSURE', 'standard') . '";';
$out->add('<script type="text/javascript">' . $script . '</script>', 'page_head');
}
示例12: loadCourseSelector
//.........这里部分代码省略.........
//$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]);
}
}
$output .= $tb->getTable() . $tb->getNavBar($ini, $tot_course) . $this->stateSelection();
//, 'content');
if ($noprint) {
return $output;
} else {
cout($output);
}
}
示例13: 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');
}
示例14: 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;
}
示例15: 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>');
}