$body .= "<li>Dropping Triggers: {$controllerName}</li>\n"; $controller->dropTriggers(); } } foreach ($controllers as $controllerName => $controller) { $body .= "<li>Dropping Tables: {$controllerName}</li>\n"; $controller->dropTable(); } foreach (array_reverse($controllers) as $controllerName => $controller) { $body .= "<li>Creating Tables: {$controllerName}</li>\n"; $controller->createTable(); } foreach (array_reverse($controllers) as $controllerName => $controller) { if (method_exists($controller, 'createTriggers')) { $body .= "<li>Creating Triggers: {$controllerName}</li>\n"; $controller->createTriggers(); } } foreach (array_reverse($controllers) as $controllerName => $controller) { if (method_exists($controller, 'preLoadData')) { $body .= "<li>Pre-populating tables: {$controllerName}</li>\n"; $controller->preLoadData(); } } $body .= "</ul>\n<p>Done.</p>"; } catch (Exception $e) { $body .= "</ul>\n<p />Uncaught exception: " . $e->getMessage() . "\n"; } $page->setBody($body); $page->displayPage();
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ require_once "Libs/autoload.php"; $config = new Config(); $webPage = new PJSWebPage($config->getTitle() . ' - Delete Search'); $act = Tools::Param('act'); if ("Delete Search" === $act) { $searchModel = new SearchModel(); $searchModel->populateFromForm(); if (!$searchModel->validateForDelete()) { $searchView = new SearchFormView('Delete Search', $searchModel); $body = "<h2>Invalid data</h2>\n" . $searchView->getForm(); } else { $searchController = new SearchController(); $searchController->delete($searchModel); $body = "Deleted search # " . $searchModel->getId() . "<br />\n"; } } else { $searchController = new SearchController(); $searchModel = $searchController->get(Tools::param('id')); $searchView = new SearchFormView('Delete Search', $searchModel); $body = $searchView->getForm(); } $webPage->setBody($body); $webPage->displayPage();