当前位置: 首页>>代码示例>>PHP>>正文


PHP Table::getSelectedElement方法代码示例

本文整理汇总了PHP中Table::getSelectedElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getSelectedElement方法的具体用法?PHP Table::getSelectedElement怎么用?PHP Table::getSelectedElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table::getSelectedElement方法的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('&', '&amp;', $object_glos->back_url) . '&amp;mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_GLOSSARY') . ' : ' . $title . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=glossary&amp;op=modglossary&amp;idGlossary=' . $object_glos->getId() . '&amp;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&amp;op=modterm&amp;idTerm=' . $idTerm . '&amp;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&amp;op=delterm&amp;idTerm=' . $idTerm . '&amp;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&amp;op=addterm&amp;idGlossary=' . $object_glos->getId() . '&amp;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&amp;op=modglossarygui' . '&amp;idGlossary=' . $object_glos->getId() . '&amp;back_url=' . $back_coded);
     $GLOBALS['page']->add($tableGlossary->getTable() . $tableGlossary->getNavBar($ini, $num_of_term) . '</div>', 'content');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:28,代码来源:glossary.php

示例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&amp;op=view&amp;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&amp;op=edit_preferences&amp;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&amp;op=edit_menu&amp;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&amp;op=assign_tree&amp;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&amp;op=edit_course&amp;adminidst=' . $arr_admin_idst[$index] . '&amp;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');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:51,代码来源:public_admin_manager.php

示例3: 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&amp;op=show">
					<em>' . Lang::t('_ACTIVE', 'conference') . '</em>
				</a>
			</li>
			<li class="selected">
				<a href="index.php?modname=conference&amp;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&amp;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&amp;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&amp;op=log&amp;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&amp;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&amp;op=list', $lang->def('_BACK')), 'content');
    }
    cout('<div class="nofloat"></div></div></div>', 'content');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:55,代码来源:conference.php

示例4: 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&amp;op=classroom&amp;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&amp;op=modclassroom&amp;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&amp;op=delclassroom&amp;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&amp;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&amp;op=reservation&amp;active_tab=subscribed_user', $lang->def('_BACK')));
     $out->add($tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . '</div>');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:57,代码来源:reservation.php

示例5: 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&amp;op=classroom_to_edition&amp;edition_id={$edition_id}" . '&amp;of_loc=' . $of_loc . '&amp;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&amp;op=classroom_to_edition&amp;edition_id=" . $edition_id . "&amp;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&amp;op=classroom_to_edition&amp;edition_id=" . $edition_id . "&amp;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&amp;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&amp;op=course_list', $lang->def('_BACK')) . $form->openForm('assignEditionClassroom', 'index.php?modname=course&amp;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');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:65,代码来源:course.php

示例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&amp;op=org_chart', "&lt;&lt;" . $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&amp;op=org_chart', "&lt;&lt;" . $lang->def('_BACK')));
     $out->add('</div>');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:49,代码来源:class.directory.php

示例7: create

function create()
{
    checkPerm('mod');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once _base_ . '/lib/lib.table.php';
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $id_certificate = importVar('id_certificate', true, 0);
    $id_meta = array();
    $acl_man =& Docebo::user()->getAclManager();
    $first = true;
    $tot_element = 0;
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $tb = new Table(Get::sett('visuItem'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION'));
    $tb->initNavBar('ini', 'button');
    $ini = $tb->getSelectedElement();
    $query = "SELECT idMetaCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta" . " WHERE idCertificate = '" . $id_certificate . "'";
    $result = sql_query($query);
    while (list($id_meta_temp) = sql_fetch_row($result)) {
        $id_meta[] = $id_meta_temp;
    }
    $query = "SELECT idCourse, idUser" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE status = '" . _CUS_END . "'";
    $result = sql_query($query);
    $user_course_completed = array();
    while (list($id_course_t, $id_user_t) = sql_fetch_row($result)) {
        $user_course_completed[$id_user_t][$id_course_t] = $id_course_t;
    }
    $query = "SELECT idMetaCertificate, title" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta";
    $result = sql_query($query);
    $array_title = array();
    while (list($id_meta_t, $title_t) = sql_fetch_row($result)) {
        $array_title[$id_meta_t] = $title_t;
    }
    $query = "SELECT idUser, idMetaCertificate, COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " GROUP BY idUser, idMetaCertificate";
    $result = sql_query($query);
    $array_control = array();
    while (list($id_user_t, $id_meta_t, $control_t) = sql_fetch_row($result)) {
        $array_control[$id_user_t][$id_meta_t] = $control_t;
    }
    if (isset($_POST['undo_filter_create'])) {
        unset($_POST['filter_username']);
        unset($_POST['filter_firstname']);
        unset($_POST['filter_lastname']);
        unset($_POST['filter_release_status']);
    }
    $query = "SELECT m.idUser, u.lastname, u.firstname, u.userid" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as m" . " JOIN " . $GLOBALS['prefix_fw'] . "_user as u ON u.idst = m.idUser" . " WHERE m.idMetaCertificate IN (" . implode(',', $id_meta) . ")" . (isset($_POST['filter_username']) ? "AND u.userid LIKE '%" . $_POST['filter_username'] . "%'" : '') . (isset($_POST['filter_firstname']) ? "AND u.firstname LIKE '%" . $_POST['filter_firstname'] . "%'" : '') . (isset($_POST['filter_lastname']) ? "AND u.lastname LIKE '%" . $_POST['filter_lastname'] . "%'" : '') . " GROUP BY m.idUser, u.lastname, u.firstname, u.userid" . " ORDER BY u.lastname, u.firstname, u.userid";
    $result = sql_query($query);
    while (list($id_user, $lastname, $firstname, $userid) = sql_fetch_row($result)) {
        foreach ($id_meta as $idmeta) {
            if (isset($array_control[$id_user][$idmeta]) && $array_control[$id_user][$idmeta]) {
                $title = strip_tags($array_title[$idmeta]);
                $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '" . $id_user . "'" . " AND idMetaCertificate = '" . $idmeta . "'";
                $result_int = sql_query($query);
                $control = true;
                while (list($id_course) = sql_fetch_row($result_int)) {
                    if (!isset($user_course_completed[$id_user][$id_course])) {
                        $control = false;
                    }
                }
                if ($control) {
                    $tot_element++;
                    if ($tot_element > $ini && $tot_element <= $ini + Get::sett('visuItem')) {
                        list($is_released) = sql_fetch_row(sql_query("SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '" . $id_user . "'" . " AND idMetaCertificate = '" . $idmeta . "'"));
                        if (!isset($_POST['filter_release_status']) || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == 0 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '1' && $is_released == 1 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '2' && $is_released == 0) {
                            if ($first) {
                                $first = false;
                                $type_h = array('', '', '', 'image', 'image', 'image');
                                $cont_h = array($lang->def('_FULLNAME'), $lang->def('_USERNAME'), $lang->def('_TITLE'), Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate')), Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate')), '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" />');
                                $tb->setColsStyle($type_h);
                                $tb->addHead($cont_h);
                            }
                            $cont = array();
                            $cont[] = $lastname . ' ' . $firstname;
                            $cont[] = $acl_man->relativeId($userid);
                            $cont[] = $title;
                            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=preview_cert&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser=' . $id_user . '">' . Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate') . ' : ' . strip_tags($title)) . '</a>';
                            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=release_cert&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser=' . $id_user . '">' . Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate') . ' : ' . strip_tags($title)) . '</a>';
                            if ($is_released) {
                                $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=del_released&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser=' . $id_user . '">' . '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" /></a>';
                            } else {
                                $cont[] = '';
                            }
                            $tb->addBody($cont);
                        }
                    }
                }
            }
        }
    }
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[href*=del_released]');
    $array_release_status = array($lang->def('_ALL') => '0', $lang->def('_ONLY_RELEASED') => '1', $lang->def('_ONLY_NOT_RELEASED') => '2');
    if ($first) {
        $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_CREATE'), 'certificate') . '<div class="std_block">');
        if (isset($_POST['filter'])) {
            $out->add(Form::openForm('meta_certificate_filter', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate) . Form::openElementSpace() . Form::getTextfield($lang->def('_USERNAME'), 'filter_username', 'filter_username', '255', isset($_POST['filter_username']) ? $_POST['filter_username'] : '') . Form::getTextfield($lang->def('_FIRSTNAME'), 'filter_firstname', 'filter_firstname', '255', isset($_POST['filter_firstname']) ? $_POST['filter_firstname'] : '') . Form::getTextfield($lang->def('_LASTNAME'), 'filter_lastname', 'filter_lastname', '255', isset($_POST['filter_lastname']) ? $_POST['filter_lastname'] : '') . Form::getRadioSet($lang->def('_RELEASE_STATUS_FILTER'), 'filter_release_status', 'filter_release_status', $array_release_status, isset($_POST['filter_release_status']) ? $_POST['filter_release_status'] : '0') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('undo_filter_create', 'undo_filter_create', $lang->def('_UNDO_FILTER')) . Form::closeButtonSpace() . Form::closeForm());
        }
        $out->add($lang->def('_NO_USER_FOUND') . getBackUi('index.php?modname=meta_certificate&amp;op=meta_certificate', $lang->def('_BACK')) . '</div>');
    } else {
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:meta_certificate.php

示例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 = $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&amp;id_course=' . (int) $id_course, $lang->def('_BACK'));
    $out->add(getTitleArea(array('index.php?r=lms/pcourse/certificate&amp;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');
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:pcertificate.php

示例9: 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&amp;op=searchmessage&amp;idThread=' . $id_thread . '&amp;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&amp;op=forum' => $lang->def('_FORUM'), 'index.php?modname=forum&amp;op=search&amp;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="&gt;" />&nbsp;' . '<a href="index.php?modname=forum&amp;op=viewprofile&amp;idMessage=' . $id_message . '&amp;ini=' . $ini_page . '&amp;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&amp;op=download&amp;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']) {
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:forum.php

示例10: 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);
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:certificate.php

示例11: 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>' . '&nbsp;&nbsp;&nbsp;&nbsp;' . '</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]);
         }
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:lib.course.php

示例12: 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&amp;op=del_registration&amp;id_user=' . $info_user[ACL_INFO_IDST] . '&amp;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&amp;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&amp;op=excel&amp;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&amp;op=view_registration', $lang->def('_BACK')), 'content');
        $out->add('</div>', 'content');
    }
开发者ID:abhinay100,项目名称:forma_app,代码行数:62,代码来源:reservation.php

示例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[] = "&nbsp;";
     //$img;
     $img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" ";
     $img .= "title=\"" . $this->lang->def("_MOD") . "\" />";
     $head[] = "&nbsp;";
     //$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;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:73,代码来源:lib.wiki.php

示例14: 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');
     }
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:77,代码来源:lib.coursepath.php

示例15: 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&amp;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&amp;op=code_list&amp;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&amp;op=code_list&amp;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&amp;op=mod_code&amp;id_code_group=' . $id_code_group . '&amp;code=' . $code_info['code'] . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
            }
            $cont[] = '<a href="index.php?modname=code&amp;op=del_code&amp;id_code_group=' . $id_code_group . '&amp;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&amp;op=add_code&amp;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&amp;op=export&amp;id_code_group=' . $id_code_group . '&amp;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&amp;op=export&amp;id_code_group=' . $id_code_group . '&amp;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&amp;op=add_code&amp;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&amp;op=list', $lang->def('_BACK')) . '</div>');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:77,代码来源:code.php


注:本文中的Table::getSelectedElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。