<?php define('TO_ROOT', '../../..'); include TO_ROOT . "/includes/main.inc.php"; $Page = new ListingPattern('Catalog'); $DbConnection = DbConnection::getInstance(); $config = parse_ini_file(TO_ROOT . "/configs/catalog.ini", true); $tables = $config['tables']; $rows_number = count($tables['table_name']); $rows = array(); for ($x = 0; $x < $rows_number; $x++) { $rows[] = array('table_name' => $tables['table_name'][$x], 'description' => $tables['description'][$x]); } $Page->setRows($rows); $Page->setName('table_name', 'Tabla'); $Page->addAction('table_name', 'list_table.php', 'Ver Registros', 'images/toolbars/list.png'); $Page->display();
<?php define('TO_ROOT', '../../..'); include TO_ROOT . "/includes/main.inc.php"; $Page = new ListingPattern(); if (!empty($_GET['table_name'])) { $table_name = $_GET['table_name']; } else { $Page->goToPage('index.php', "Esa tabla no existe"); } $Page->setPageName("Editar tabla: {$table_name}"); $DbConnection = DbConnection::getInstance(); $sql = "SELECT * FROM {$table_name};"; $rows = $DbConnection->getAllRows($sql); $Page->setRows($rows); $Page->hideField("{$table_name}_id"); //$Page->addLink("{$table_name}_id","{$table_name}_id", "edit.php?table_name=$table_name",'Editar Registro'); $Page->addAction("{$table_name}_id", "edit.php?table_name={$table_name}", 'Editar Registro', 'images/toolbars/edit.png'); $Page->addGeneralAction("javascript:history.back()", 'Back', '', 0, 'images/toolbars/undo.png'); $Page->addGeneralAction("edit.php?table_name={$table_name}", 'Add Register', "{$table_name}_id", 0, 'images/toolbars/add.png'); $Page->display();