* @package prafda2 * @author Pieter van den Hombergh * $Id: literature.php 1723 2014-01-03 08:34:59Z hom $ */ include_once "peerutils.inc"; include_once 'navigation2.inc'; include_once "utils.inc"; include_once "ste.php"; $navTitle = "Course literature" . $PHP_SELF . " on DB " . $db_name; $page = new PageContainer(); $page->setTitle('Literature'); $ste = new SimpleTableEditor($dbConn, $page); $ste->setFormAction($PHP_SELF); $ste->setRelation('literature'); $ste->setMenuName('literature'); $ste->setKeyColumns(array('literature_id')); $ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(column_name,' ')"); $ste->setOrderList(array('literature_code')); $ste->setFormTemplate('templates/literature.html'); $page_opening = "Literature for all courses"; $nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening); $page->addBodyComponent($nav); $ste->render(); $page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: literature.php 1723 2014-01-03 08:34:59Z hom $ -->')); $page->show(); ?>
* @author Pieter van den Hombergh * $Id: menu.php 1723 2014-01-03 08:34:59Z hom $ */ include_once "peerutils.inc"; include_once 'navigation2.inc'; include_once "utils.inc"; include_once "ste.php"; $navTitle = "Peerweb testscript " . $PHP_SELF . " on DB " . $db_name; $page = new PageContainer(); $page->setTitle('Menu'); //$dbConn->setSqlAutoLog(true); $ste = new SimpleTableEditor($dbConn, $page); $ste->setFormAction($PHP_SELF); $ste->setRelation('menu'); $ste->setMenuName('menu'); $ste->setKeyColumns(array('menu_name', 'relation_name')); $ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(relation_name,' ')"); $ste->setOrderList(array('menu_name', 'relation_name')); $ste->setFormTemplate('templates/menu.html'); $ste->setListRowTemplate(array('menu_name', 'relation_name')); $page_opening = "Menu"; $nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening); $page->addBodyComponent($nav); if (isset($_POST['Insert'])) { /* try to insert menu,column_names into menu_items */ $menu_name = $_POST['menu_name']; $relation_name = $_POST['relation_name']; $sql = "insert into menu_item (menu_name,column_name,edit_type,capability,item_length) select '{$menu_name}' as menu_name, column_name," . " 'T' as edit_type, 32767 as capability, character_maximum_length" . " from information_schema.columns where table_name='{$relation_name}'"; $dbMessage = ''; $result = doUpdate($dbConn, $sql, $dbMessage); $page->addBodyComponent(new Component("<fieldset><legend>Create menu_items</legend>\n" . $dbMessage . "\n</fieldset>\n"));
<?php /** * The simple table editor for the tutor * @author Pieter van den Hombergh * $Id: presse.php 1723 2014-01-03 08:34:59Z hom $ */ include_once "ste.php"; requireCap(CAP_RECRUITER); $page = new PageContainer("Peerweb presse " . $PHP_SELF . " on DB " . $db_name); $ste = new SimpleTableEditor($dbConn, $page); $ste->setShowQuery(true); $ste->setFormAction($PHP_SELF); $ste->setRelation('presse'); $ste->setMenuName('presse'); $ste->setKeyColumns(array('presse_id')); $ste->setNameExpression("rtrim(firma)")->setListRowTemplate(array('firma', 'firmentype', 'ort', 'email_kontaktperson', 'telefon', 'telefax', 'website'))->setOrderList(array('firma'))->setFormTemplate('templates/presse.html')->show();
<?php /** * The simple table editor for the table menu. Menu is one of the tables that support * the simple table editor. * * @package prafda2 * @author Pieter van den Hombergh * $Id: curriculum_module.php 1723 2014-01-03 08:34:59Z hom $ */ require_once "ste.php"; $page = new PageContainer("Course (curriculum) module " . $PHP_SELF . " on DB " . $db_name); $ste = new SimpleTableEditor($dbConn, $page); $ste->setFormAction($PHP_SELF); $ste->setRelation('curriculum_module'); $ste->setMenuName('curriculum_module'); $ste->setKeyColumns(array('curriculum_module_id')); $ste->setNameExpression("rtrim(common_name,' ')||', '||rtrim(first_academic_year,' ')"); $ste->setOrderList(array('curriculum_module_code')); $ste->setFormTemplate('templates/curriculum_module.html'); $ste->show(); ?>