本文整理汇总了PHP中Table::getTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getTable方法的具体用法?PHP Table::getTable怎么用?PHP Table::getTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::getTable方法的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: notes
function notes()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('notes', 'lms');
$nav_bar = new NavBar('ini', Get::sett('visuItem'), 0);
$ini = $nav_bar->getSelectedElement();
$ord = importVar('ord');
$inv = importVar('inv');
switch ($ord) {
case "tit":
$ord = $order = 'title';
if ($inv != 'y') {
$a_down = '&inv=y';
} else {
$order .= ' DESC';
$a_down = '';
}
break;
default:
$ord = $order = 'data';
if ($inv == 'y') {
$a_down = '';
} else {
$order .= ' DESC';
$a_down = '&inv=y';
}
}
$reNotes = sql_query("\r\n\tSELECT idNotes, data, title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "' \r\n\tORDER BY {$order} \r\n\tLIMIT {$ini}," . Get::sett('visuItem'));
list($num_notes) = sql_fetch_row(sql_query("SELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "' "));
$nav_bar->setElementTotal($num_notes);
$img_up = '<img class="valing-middle" src="' . getPathImage() . 'standard/up_arrow.png" alt="' . $lang->def('_UP') . '"/>';
$img_down = '<img class="valing-middle" src="' . getPathImage() . 'standard/down_arrow.png" alt="' . $lang->def('_DOWN') . '"/>';
$tb = new Table(Get::sett('visuItem'), $lang->def('_NOTES'), $lang->def('_NOTES'));
$contentH = array(($ord == 'data' ? $inv == 'y' ? $img_up : $img_down : '') . '<a href="index.php?modname=notes&op=notes' . $a_down . '"> ' . $lang->def('_DATE') . '</a>', ($ord == 'title' ? $inv == 'y' ? $img_up : $img_down : '') . '<a href="index.php?modname=notes&op=notes&ord=tit' . $a_down . '">' . $lang->def('_TITLE') . '</a>', '<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') . '" />');
$typeH = array('min-cell', '', 'image', 'image');
$tb->setColsStyle($typeH);
$tb->addHead($contentH);
while (list($idNotes, $data, $title) = sql_fetch_row($reNotes)) {
$content = array(Format::date($data), '<a href="index.php?modname=notes&op=displaynotes&idNotes=' . $idNotes . '" title="' . $lang->def('_MORET') . '">' . $title . '</a>', '<a href="index.php?modname=notes&op=modnotes&idNotes=' . $idNotes . '">
<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" /></a>', '<a id="delnotes_' . $idNotes . '"' . ' href="index.php?modname=notes&op=delnotes&idNotes=' . $idNotes . '"' . ' title="' . $lang->def('_TITLE') . ' : ' . strip_tags(str_replace(array('"', "'"), '', $title)) . '">
<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>');
$tb->addBody($content);
}
$tb->addActionAdd('<a href="index.php?modname=notes&op=addnotes">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_ADD') . '" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADD_NOTES') . '</a>');
$GLOBALS['page']->add(getTitleArea(array($lang->def('_NOTES')), 'notes') . '<div class="std_block">', 'content');
if (isset($_POST['result'])) {
switch ($_POST['result']) {
case "ok":
$GLOBALS['page']->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')), 'content');
case "err":
$GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE')), 'content');
}
}
$GLOBALS['page']->add($tb->getTable() . $nav_bar->getNavBar($ini), 'content');
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=delnotes]');
$GLOBALS['page']->add('</div>', 'content');
}
示例3: fileList
function fileList(&$url)
{
checkPerm('view');
require_once _base_ . '/lib/lib.tab.php';
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$file_man = new MyFile(getLogUserId());
$tab_man = new TabView('myfiles', '');
$lang =& DoceboLanguage::createInstance('myfiles');
$areas = $file_man->getFilesAreas();
while (list($id_page, $area_name) = each($areas)) {
$new_tab = new TabElemDefault($id_page, $lang->def($area_name), getPathImage('fw') . 'myfiles/' . $id_page . '.gif');
$tab_man->addTab($new_tab);
}
$tab_man->parseInput($_POST, $_SESSION);
$active_tab = $tab_man->getActiveTab();
if (!$active_tab) {
$active_tab = importVar('working_area', false, $file_man->getDefaultArea());
$tab_man->setActiveTab($active_tab);
}
$GLOBALS['page']->addStart(Form::openForm('tab_myfiles', $url->getUrl('op=myfiles')) . Form::getHidden('working_area', 'working_area', $active_tab) . $tab_man->printTabView_Begin('', false), 'content');
$GLOBALS['page']->addEnd($tab_man->printTabView_End() . Form::closeForm(), 'content');
$tb = new Table(0, $lang->def('_MYFILES_CAPTION'), $lang->def('_MYFILES_SUMMARY'));
$cont_h = array($lang->def('_TITLE'), $lang->def('_FILE_POLICY'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . '" alt="' . $lang->def('_DEL') . '" />');
$type_h = array('', 'image nowrap', 'image', 'image');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$re_files = $file_man->getFileList($active_tab, false, MYFILE_TITLE);
while ($file_info = $file_man->fetch_row($re_files)) {
$cont = array($file_info[MYFILE_TITLE]);
switch ($file_info[MYFILE_POLICY]) {
case MF_POLICY_FREE:
$cont[] = $lang->def('_MF_POLICY_FREE');
break;
case MF_POLICY_TEACHER:
$cont[] = $lang->def('_MF_POLICY_TEACHER');
break;
case MF_POLICY_FRIENDS:
$cont[] = $lang->def('_MF_POLICY_FRIENDS');
break;
case MF_POLICY_TEACHER_AND_FRIENDS:
$cont[] = $lang->def('_MF_POLICY_TEACHER_AND_FRIENDS');
break;
case MF_POLICY_NOONE:
$cont[] = $lang->def('_MF_POLICY_NOONE');
break;
}
$cont[] = '<a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab . '&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_MOD') . '" />' . '</a>';
$cont[] = '<a href="' . $url->getUrl('op=delfiles&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_DEL') . '" />' . '</a>';
$tb->addBody($cont);
}
$tb->addActionAdd('<p class="new_elem_link"><a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab) . '">' . $lang->def('_ADD_' . $active_tab) . '</a></p>');
$tb->addActionAdd('<p>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user=' . getLogUserId() . '&ap=view_files&type=' . $active_tab . '&from=1') . '">' . '<img src="' . getPathImage('fw') . 'myfiles/' . $active_tab . '.gif" title="' . $lang->def($active_tab) . '" alt="' . $lang->def('_VIEW_' . $active_tab) . '" />' . '</a>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user=' . getLogUserId() . '&ap=view_files&type=' . $active_tab . '&from=1') . '">' . $lang->def('_VIEW_' . $active_tab) . '</a></p>');
$GLOBALS['page']->add($tb->getTable(), 'content');
}
示例4: getTableOf
/**
* Gets the corresponding table of a source
*
* @param $sourceId
* @return null|Table
*/
public static function getTableOf($sourceId)
{
try {
$dataTableEntry = ipDb()->selectRow(self::DATA_TABLE_REPOSITORY, '*', array('sourceId' => $sourceId));
if ($dataTableEntry == null) {
return null;
}
return Table::getTable(json_decode($dataTableEntry['tableMetaData'], true));
} catch (\Ip\Exception\Db $e) {
ipLog()->error("Could not get table of {$sourceId}. Message:" . $e->getMessage());
}
return null;
}
示例5: reportList
function reportList()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('report', 'framework');
$_SESSION['report_tempdata'] = array();
$can_mod = checkPerm('mod', true);
$acl_man = Docebo::aclm();
$public_admin_mod = true;
$query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId();
$tb = new Table();
$tb->initNavBar('ini', 'button');
$col_type = array('', 'align_center', 'align_center', 'image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />');
if ($public_admin_mod && $can_mod) {
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
$res = sql_query($query);
if ($res) {
while ($row = sql_fetch_assoc($res)) {
$id = $row['id_filter'];
$opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>';
$tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link);
if ($public_admin_mod && $can_mod) {
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
}
$tb->addBody($tb_content);
}
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_public_report]');
if ($public_admin_mod && $can_mod) {
$tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
}
cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content');
}
示例6: listroom
function listroom()
{
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('admin_config', 'scs');
$out =& $GLOBALS['page'];
$mod_perm = checkPerm('mod', true);
$out->setWorkingZone('content');
$out->add(getTitleArea($lang->def('_ROOM_MAN'), 'admin_conf') . '<div class="std_block">');
$tb_room = new Table(0, $lang->def('_ALL_ROOMS'), $lang->def('_ALL_ROOMS_SUMMARY'));
$cont_h = array($lang->def('_ROOM_NAME'), $lang->def('_ROOM_TYPE'));
$type_h = array('', 'align_center');
if ($mod_perm) {
$cont_h[] = '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
$type_h[] = 'image';
}
$tb_room->setColsStyle($type_h);
$tb_room->addHead($cont_h);
$query_rooms = "\r\n\tSELECT id_room, room_name, room_type \r\n\tFROM " . $GLOBALS['prefix_scs'] . "_rules_room ";
$re_rooms = sql_query($query_rooms);
while (list($id_room, $room_name, $room_type) = sql_fetch_row($re_rooms)) {
$cont = array($room_name);
switch ($room_type) {
case "course":
$cont[] = $lang->def('_COURSE');
break;
case "private":
$cont[] = $lang->def('_PRIVATE');
break;
case "public":
$cont[] = $lang->def('_PUBLIC');
break;
}
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=room&op=modroom&id_room=' . $id_room . '"' . ' title="' . $lang->def('_MOD') . ' : ' . $room_name . '">' . '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $room_name . '" /></a>';
$cont[] = '<a href="index.php?modname=room&op=delroom&id_room=' . $id_room . '"' . ' title="' . $lang->def('_DEL') . ' : ' . $room_name . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $room_name . '" /></a>';
}
$tb_room->addBody($cont);
}
if ($mod_perm) {
$tb_room->addActionAdd('<a href="index.php?modname=room&op=newroom">' . '<img src="' . getPathImage('fw') . 'standard/add.png" alt="' . $lang->def('_NEW_ROOM') . '" />' . ' ' . $lang->def('_NEW_ROOM') . '</a>');
}
$out->add($tb_room->getTable());
$out->add('</div>');
}
示例7: createPageList
/**
* Changes an array of pagenames into a table with "edit", "view" and "delete" options
*/
protected function createPageList($data)
{
$this->setState('CREATING_PAGE_LIST_TABLE');
//Create new Table item
$t = new Table();
//Create new Table
$t->createTable("Pagelist");
//Sets that there is no heading row.
$t->setHead(false);
//Loop Through each page
for ($i = 0; $i < count($data); $i++) {
//Add Page data for each row.
$t->addRow(array($data[$i], "<a href='?system=Editor&page=editor&active=" . $data[$i] . "'>" . $this->localize("Edit") . "</a>", "<a href='?page=" . $data[$i] . "'>" . $this->localize("View") . "</a>", "<a href='?system=Editor&page=delete&active=" . $data[$i] . "'>" . $this->localize("Delete") . "</a>"));
}
//Creates a table from inserted data
$t->runTable();
//Returns the created table.
return $t->getTable();
}
示例8: mycompetences
function mycompetences(&$url)
{
checkPerm('view');
$html = "";
$html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences');
$html .= '<div class="std_block">';
$cmodel = new CompetencesAdm();
$fmodel = new FunctionalrolesAdm();
$id_user = getLogUserId();
$ucomps = $cmodel->getUserCompetences($id_user);
$rcomps = $fmodel->getUserRequiredCompetences($id_user);
$ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps));
$language = getLanguage();
$_typologies = $cmodel->getCompetenceTypologies();
$_types = $cmodel->getCompetenceTypes();
$icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>';
$icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>';
//*******************
require_once _base_ . '/lib/lib.table.php';
$table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES'));
$style_h = array('', '', 'image', 'image', 'image', 'image', 'image');
$label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences'));
$table->addHead($label_h, $style_h);
foreach ($ucomps_info as $id_competence => $cinfo) {
$line = array();
$line[] = $cinfo->langs[$language]['name'];
$line[] = $_typologies[$cinfo->typology];
$line[] = $_types[$cinfo->type];
$line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv;
$line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime');
$line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : '';
$table->addBody($line);
}
$html .= $table->getTable();
$html .= '</div>';
$html .= Form::openForm('beck_url', 'index.php');
$html .= Form::openButtonSpace();
$html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard'));
$html .= Form::closeButtonSpace();
$html .= Form::closeform();
cout($html, 'content');
}
示例9: loadMaterials
function loadMaterials($idCourse)
{
$mod_perm = checkPerm('mod', true);
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('course');
$re_file = sql_query("\r\n\tSELECT id_file, title, path \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_file \r\n\tWHERE id_course='" . $idCourse . "'");
if (!mysql_num_rows($re_file) && !$mod_perm) {
return '';
}
$tb = new Table(0, $lang->def('_MATERIALS'), $lang->def('_MATERIALS_TABLE'));
$cont_h = array($lang->def('_TITLE'));
$type_h = array('');
if ($mod_perm) {
$cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
$type_h[] = 'image';
$cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
$type_h[] = 'image';
}
//$tb->setTableStyle('');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
$html = '<div class="floating_box">';
if (mysql_num_rows($re_file)) {
while (list($idFile, $title, $file) = sql_fetch_row($re_file)) {
$cont = array('<a href="index.php?modname=course&op=downloadcourse&id=' . $idFile . '">' . '<img src="' . getPathImage('fw') . mimeDetect($file) . '" alt="mime-type" /> ' . $title . '</a>');
if ($mod_perm) {
$cont[] = '<a href="index.php?modname=course&op=modfiles&id_file=' . $idFile . '" title="' . $lang->def('_MOD') . ' : ' . $title . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $title . '" /></a>';
$cont[] = '<a href="index.php?modname=course&op=remfiles&id_file=' . $idFile . '" title="' . $lang->def('_DEL') . ' : ' . $title . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $title . '" /></a>';
}
$tb->addBody($cont);
}
$html .= $tb->getTable();
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=remfiles]');
}
if ($mod_perm) {
$html .= '<br/>' . '<a class="ico-wt-sprite subs_add" href="index.php?modname=course&op=addfiles">' . '<span>' . $lang->def('_ADDFILE') . '</span></a>';
}
$html .= '</div>';
return $html;
}
示例10: createUsersList
/**
* Changes an array of pagenames into a table with "edit", "view" and "delete" options
*/
protected function createUsersList($data)
{
// Set the state and tell plugins.
$this->setState('CREATING_USER_TABLE');
$this->notifyObservers();
//Create new Table item
$t = new Table();
//Create new Table
$t->createTable("Userslist");
//Sets intial row as headings
$t->setHead(false);
//Loop Through each page
for ($i = 0; $i < count($data); $i++) {
//Add Page data for each row.
$t->addRow(array($data[$i], "<a href='?system=Users&page=edit&active=" . $data[$i] . "'>" . $this->localize("Edit") . "</a>", "<a href='?system=Users&page=delete&active=" . $data[$i] . "'>" . $this->localize("Delete") . "</a>"));
}
//Creates a table from inserted data
$t->runTable();
//Returns the created table.
return $t->getTable();
}
示例11: modlinkgui
function modlinkgui($object_link)
{
checkPerm('view', false, 'storage');
$lang =& DoceboLanguage::createInstance('link');
require_once _base_ . '/lib/lib.table.php';
$del_perm = checkPerm('view', false, 'storage');
$back_coded = htmlentities(urlencode($object_link->back_url));
$textQuery = "\r\n\tSELECT idLink, title, link_address, sequence \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link \r\n\tWHERE idCategory = '" . $object_link->getId() . "' \r\n\tORDER BY sequence";
$result = sql_query($textQuery);
$num_link = mysql_num_rows($result);
list($title_cat) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\tWHERE idCategory = '" . $object_link->getId() . "'"));
$GLOBALS['page']->add(getTitleArea($lang->def('_SECT_LINK'), 'link') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_link->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_TITLE') . ' : ' . $title_cat . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=link&op=modlinkcat&idCategory=' . $object_link->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');
$tableCat = new Table(0, '', $lang->def('_SUMMARY_LINK'));
$contentH = array($lang->def('_QUESTION'), $lang->def('_URL'), '<img src="' . getPathImage() . 'standard/down.png" alt="' . $lang->def('_DOWN') . '" title="' . $lang->def('_MOVE_DOWN') . '" />', '<img src="' . getPathImage() . 'standard/up.png" alt="' . $lang->def('_UP') . '" title="' . $lang->def('_MOVE_UP') . '" />', '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '" />');
$typeH = array('', 'image', 'image', 'image', 'image', 'image');
$tableCat->setColsStyle($typeH);
$tableCat->addHead($contentH);
$i = 1;
while (list($idLink, $title, $link_address, $seq) = sql_fetch_row($result)) {
$rowContent = array($seq . ') ' . $title, $link_address);
if ($i != $num_link) {
$rowContent[] = '<a href="index.php?modname=link&op=movedown&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/down.png" alt="' . $lang->def('_DOWN') . '" title="' . $lang->def('_MOVE_DOWN') . '" /></a>';
} else {
$rowContent[] = ' ';
}
if ($i != 1) {
$rowContent[] = '<a href="index.php?modname=link&op=moveup&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/up.png" alt="' . $lang->def('_UP') . '" title="' . $lang->def('_MOVE_UP') . '" /></a>';
} else {
$rowContent[] = ' ';
}
$rowContent[] = '<a href="index.php?modname=link&op=modlink&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '" /></a>';
$rowContent[] = '<a href="index.php?modname=link&op=dellink&idLink=' . $idLink . '&back_url=' . $back_coded . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '" /></a>';
$tableCat->addBody($rowContent);
++$i;
}
$tableCat->addActionAdd('<a href="index.php?modname=link&op=newlink&idCategory=' . $object_link->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDLINKT') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDLINK') . '</a>');
$GLOBALS['page']->add($tableCat->getTable() . '<span class="text_bold text_little">[ ' . '<a href="index.php?modname=link&op=fixsequence&idCategory=' . $object_link->getId() . '&back_url=' . $back_coded . '">' . $lang->def('_FIX_SEQUENCE') . '</a>' . ' ]</span>' . '</div>', 'content');
}
示例12: action
function action()
{
$where = " WHERE 1";
if (isset($_POST['b1']) && $_POST['b1'] == "Удалить" && isset($_REQUEST['id_check'])) {
foreach ($_REQUEST['id_check'] as $k => $v) {
DB::query("DELETE FROM `" . $this->table_name . "` WHERE `id` = '" . $v . "'");
}
}
$a = array();
$a['login'] = array('Логин', '20%', true);
$a['email'] = array('Email', '20%', true);
$a['passwd'] = array('Пароль', '10%', true);
$a['status'] = array('Статус', '10%', true);
$btn = array();
$btn[] = "Удалить";
if (isset($_GET['user_id'])) {
$where .= " && `id` = '" . DB::escape($_GET['user_id']) . "'";
}
if (isset($_GET['key'])) {
$where .= " && (\n\t\t\t`id` = '" . DB::escape($_GET['key']) . "' || \n\t\t\t`email` = '" . DB::escape($_GET['key']) . "' || \n\t\t\t`phone` = '" . DB::escape($_GET['key']) . "' \n\t\t\t)";
}
$oTable = new Table("admin.php?act=" . str_replace('action', '', __FUNCTION__) . "&page=");
return $this->InIndex('Пользователи', $oTable->getTable($this, $this->class_name, $this->table_name, $a, $this->links_per_page, $btn, $where . " ORDER BY `id` DESC"));
}
示例13: loadCatalogueSelector
function loadCatalogueSelector($noprint = false)
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
$lang =& DoceboLanguage::createInstance('catalogue', 'lms');
// Filter
$this->filter['catalogue_name'] = isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '';
if ($this->show_filter === true) {
$form = new Form();
/*$GLOBALS['page']->add(
$form->getOpenFieldset($lang->def('_SEARCH'))
.Form::getTextfield($lang->def('_NAME'), 'cat_filter_name', 'cat_filter_name', '255',
( isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '' ))
.$form->openButtonSpace()
.$form->getButton('catalogue_filter', 'catalogue_filter', $lang->def('_SEARCH'))
.$form->closeButtonSpace()
.$form->getCloseFieldset()
, 'content');
*/
cout('<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "cat_filter_name", "cat_filter_name", Get::req('cat_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("catalogue_filter", "catalogue_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>', 'content');
}
// End Filter
$tb = new Table(Get::sett('visuItem'), $lang->def('_CATALOGUE'), $lang->def('_CATALOGUE_SUMMARY'));
$tb->initNavBar('ini_cat', 'button');
$ini = $tb->getSelectedElement();
$select = "\r\n\t\tSELECT c.idCatalogue, c.name, c.description";
$query_catalogue = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue AS c\r\n\t\tWHERE 1";
// Retriving data
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])) {
require_once _lms_ . '/lib/lib.catalogue.php';
$cat_man = new Catalogue_Manager();
$admin_courses['catalogue'] = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
if (count($admin_courses['catalogue']) == 0 && Get::sett('on_catalogue_empty', 'off') == 'on') {
$all_courses = true;
}
}
if (!$all_courses) {
if (empty($admin_courses['catalogue'])) {
$query_catalogue .= " AND 0 ";
} else {
$query_catalogue .= " AND c.idCatalogue IN (0," . implode(',', $admin_courses['catalogue']) . ") ";
}
}
}
if ($this->filter['catalogue_name'] != '') {
$query_catalogue .= " AND c.name LIKE '%" . $this->filter['catalogue_name'] . "%'";
}
list($tot_catalogue) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_catalogue));
$query_catalogue .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
$re_catalogue = sql_query($select . $query_catalogue);
$type_h = array('image', '', '', '');
$cont_h = array('<span class="access-only">' . $lang->def('_CATALOGUE_SELECTION') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
while (list($id_catalogue, $name, $descr) = sql_fetch_row($re_catalogue)) {
$tb_content = array(Form::getInputCheckbox('new_catalogue_selected_' . $id_catalogue, 'new_catalogue_selected[' . $id_catalogue . ']', $id_catalogue, isset($this->current_selection[$id_catalogue]), ''), '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $name . '</label>', '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $descr . '</label>');
$tb->addBody($tb_content);
if (isset($this->current_selection[$id_catalogue])) {
unset($this->current_selection[$id_catalogue]);
}
}
$output = $tb->getTable() . $tb->getNavBar($ini, $tot_catalogue) . $this->stateSelection();
if ($noprint) {
return $output;
} else {
cout($output, 'content');
}
}
示例14: modTransaction
function modTransaction()
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.dialog.php';
require_once _lms_ . '/lib/lib.course.php';
require_once _lms_ . '/lib/lib.date.php';
$lang =& DoceboLanguage::createInstance('transaction');
$acl_man = Docebo::user()->getAclManager();
$man_transaction = new Man_Transaction();
$course_man = new Man_Course();
$date_man = new DateManager();
$id_transaction = Get::req('id', DOTY_INT, 0);
$transaction_info = $man_transaction->getTransactionInfo($id_transaction);
if (isset($_POST['update'])) {
$payment_status = Get::req('payment_status', DOTY_INT, 0);
$course_status = Get::req('course_status', DOTY_INT, 0);
$note = Get::req('note', DOTY_MIXED, '');
if ($man_transaction->updateTransaction($id_transaction, $payment_status, $course_status, $note)) {
if (isset($_POST['confirm'])) {
$activations = array();
foreach ($_POST['confirm'] as $id => $n) {
list($id_course, $id_date) = explode('_', $id);
if ($id_date != 0) {
$activations[$id_course]['dates'][$id_date] = $id_date;
} else {
$activations[$id_course] = $id_course;
}
}
if ($man_transaction->activateCourses($id_transaction, $transaction_info['id_user'], $activations)) {
Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
}
} else {
Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
}
}
Util::jump_to('index.php?modname=transaction&op=transaction&res=err_up');
}
$array_title = array('index.php?modname=transaction&op=transaction' => $lang->def('_TRANSACTION'), $lang->def('_MOD_TRANSACTION'));
//Status info & note
$array_payment_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
$array_course_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
cout(getTitleArea($array_title) . '<div class="std_block">' . Form::openForm('transaction_info', 'index.php?modname=transaction&op=mod&id=' . $id_transaction) . Form::openElementSpace() . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $transaction_info['payment_status']) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $transaction_info['course_status']) . Form::getSimpleTextarea($lang->def('_NOTES'), 'note', 'note', $transaction_info['note']) . Form::closeElementSpace());
//User info
$user_info = $acl_man->getUser($transaction_info['id_user'], false);
$tb_user = new Table(0, $lang->def('_USER_INFO'), $lang->def('_USER_INFO'));
$cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'));
$type_h = array('', '', '', '');
$tb_user->setColsStyle($type_h);
$tb_user->addHead($cont_h);
$tb_user->addBody(array($acl_man->relativeId($user_info[ACL_INFO_USERID]), $user_info[ACL_INFO_FIRSTNAME], $user_info[ACL_INFO_LASTNAME], $user_info[ACL_INFO_EMAIL]));
cout('<br />' . $tb_user->getTable());
//Payment info if we need it
//Product info
$tb_product = new Table(0, $lang->def('_PRODUCT_INFO'), $lang->def('_PRODUCT_INFO'));
$cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DATE_BEGIN'), $lang->def('_DATE_END'), $lang->def('_COURSE_PRIZE'), $lang->def('_CONFIRM_COURSE'));
$type_h = array('', '', '', '', '', '');
$tb_product->setColsStyle($type_h);
$tb_product->addHead($cont_h);
$transaction_course = $man_transaction->getTransactionCourses($id_transaction);
foreach ($transaction_course as $id_course => $details) {
if (is_array($details)) {
foreach ($details['dates'] as $id_date) {
$date_info = $date_man->getDateInfo($id_date);
$checked = false;
$other = '';
if ($man_transaction->controlActivation($id_transaction, $id_course, $id_date)) {
$checked = true;
$other = 'disabled="disabled"';
}
$tb_product->addBody(array($date_info['code'], $date_info['name'], Format::date($date_info['date_begin']), Format::date($date_info['date_end']), $date_info['price'], Form::getInputCheckbox($id_course . '_' . $id_date, 'confirm[' . $id_course . '_' . $id_date . ']', 1, $checked, $other)));
}
} else {
$course_info = $course_man->getCourseInfo($id_course);
$checked = false;
$other = '';
if ($man_transaction->controlActivation($id_transaction, $id_course)) {
$checked = true;
$other = 'disabled="disabled"';
}
$tb_product->addBody(array($course_info['code'], $course_info['name'], $course_info['date_begin'] !== '0000-00-00' ? Format::date($course_info['date_begin'], 'date') . ($course_info['hour_begin'] !== '-1' ? $course_info['hour_begin'] : '') : '', $course_info['date_end'] !== '0000-00-00' ? Format::date($course_info['date_end'], 'date') . ($course_info['hour_end'] !== '-1' ? $course_info['hour_end'] : '') : '', $course_info['prize'] == '' ? '0' : $course_info['prize'], Form::getInputCheckbox($id_course . '_0', 'confirm[' . $id_course . '_0]', 1, $checked, $other)));
}
}
cout('<br />' . $tb_product->getTable() . Form::openButtonSpace() . Form::getButton('update', 'update', $lang->def('_UPDATE')) . Form::getButton('back_mod', 'back_mod', $lang->def('_BACK')) . Form::closeButtonSpace() . Form::closeForm());
cout('</div>');
}
示例15: Table
<?php
Get::title(array('index.php?r=alms/enrollrules/show' => Lang::t('_ENROLLRULES', 'enrollrules'), 'index.php?r=alms/enrollrules/showlog' => Lang::t('_SHOW_LOGS', 'enrollrules'), Lang::t('_DETAILS', 'enrollrules')));
?>
<div class="std_block">
<?php
$tb = new Table();
$tb->addHead(array(Lang::t('_USERNAME', 'enrollrules'), Lang::t('_LASTNAME', 'enrollrules'), Lang::t('_FIRSTNAME', 'enrollrules'), Lang::t('_CODE', 'enrollrules'), Lang::t('_COURSE_NAME', 'enrollrules')), array('min-cell', '', '', 'min-cell', ''));
while (list(, $obj) = each($data)) {
$row = array(Docebo::aclm()->relativeId($obj->userid), $obj->lastname, $obj->firstname, $obj->code, $obj->name);
$tb->addBody($row);
}
echo $tb->getTable();
?>
</div>