function addZimmerModal($hotelid, $hotelname) { $zarray = array("Zimmer-ID", "m<sup>2</sup>", "Typ", "Bettenzahl", "Preisfaktor"); echo '<div> <div id="' . $hotelid . '" class="modalDialog2"> <div> <a href="#close" title="Close" class="close">X</a> <h2>' . $hotelname . ' (' . getHotelZimmerzahl($hotelid, TRUE) . ' gesamt)</h2> <table id="myTable" class="tablesorter"> <thead> <tr> '; echo addTable($zarray, 2); echo ' </tr> </thead> <tbody> '; echo getZimmerTableData($hotelid); echo ' </tbody> </table> <input type="button" class="popup" name="neuesZimmer" value="neues Zimmer hinzufügen" onclick=\'window.location.href = "../phpdata/zimmerHinzufuegen.php?0=' . $hotelid . '#openModal"\'/> </div> </div> </div>'; }
static function sqlInstall() { global $sql_tables; foreach ($sql_tables as $table => &$query) { if (self::tableExists($table) === true) { continue; } else { addTable($table); } } }
} else { if ($_POST['view'] === 'add') { echo '<div class="form-group">'; echo sprintf('<label for="%s">%s</label>', $key, $key); echo sprintf('<input type="%s" name="%s" class="form-control" maxlength="%s" %s>', $type, $key, $maxLength, $required); echo '</div>'; } else { echo '<div class="form-group">'; echo sprintf('<label for="%s">%s</label>', $key, $key); echo sprintf('<input type="%s" name="%s" class="form-control" maxlength="%s" %s>', $type, $key, $maxLength, $required); echo '</div>'; } } } if (isset($_POST['add'])) { if (addTable()) { $path = sprintf('location: ' . HTTP_PATH . 'public/views/%s.php', $_POST['page']); header($path); } else { echo 'something went wrong!'; } var_dump($_POST); die; } if (isset($_POST['edit'])) { if (editTable()) { $path = sprintf('location: ' . HTTP_PATH . 'public/views/%s.php', $_POST['page']); unset($_POST['edit']); header($path); die; } else {
<?php genMenu(); ?> </div> <div class="container2" > <div class="ueberschrift"> <p style="font-size:20px;"> Hotels </p> <div class="flugLabel"> <table id="myTable" class="tablesorter"> <thead> <tr> <?php addTable($larray, 2); ?> </tr> </thead> <tbody> <?php addTableData(); ?> </tbody> </table> </div> </div> <?php addZimmer(); ?> <div class="clear"></div>
} ### Dispatch actions $action = getRequestedAction(); if (!$action || $action == 'listTables') { if (@$_REQUEST['newOrder']) { updateMenuOrder(); } if (@$action == '' && !alert()) { createMissingSchemaTablesAndFields(); } // skip if action specified or alerts, such as when user is redirected back to this page showInterface('database/listTables.php'); } elseif ($action == 'addTable') { include "lib/menus/database/addTable.php"; } elseif ($action == 'addTable_save') { addTable(); } elseif ($action == 'editTable') { include "lib/menus/database/editTable.php"; } elseif ($action == 'adminHome') { showInterface('admin/home.php'); } elseif ($action == 'recreateThumbnails') { recreateThumbnails(); } elseif ($action == 'previewDefaultDate') { previewDefaultDate(); } else { alert("Unknown action '" . htmlencode($action) . "'"); showInterface('admin/home.php'); } // function updateMenuOrder() {
<?php genMenu(); ?> </div> <div class="container2" > <div class="ueberschrift"> <p style="font-size:20px;"> Autos </p> <div class="flugLabel"> <table id="myTable" class="tablesorter"> <thead> <tr> <?php addTable($larray); ?> <th></th> <th></th> </tr> </thead> <tbody> <?php addTableData(); ?> </tbody> </table> </div> </div> <div class="clear"></div> </div>
function migrate($options) { if (!isset($options['action'])) { die("Usage: php zombie.php migrate action=<action>\n" . "Actions:\n" . "\tadd-column\n" . "\tadd-table\n" . "\tapply\n" . "\tnew\n" . "\trun\n"); } if ($options['action'] == "apply") { applyMigration($options['name']); } else { if ($options['action'] == "run") { runMigrations(); } else { if ($options['action'] == "new") { if (!isset($options['name'])) { die("Usage: php zombie.php migrate action=new name=<name>\n"); } newMigration($options['name']); } else { if ($options['action'] == "add-table") { if (!isset($options['name']) || !isset($options['table'])) { die("Usage: php zombie.php migrate action=add-table name=<name> table=<table>\n"); } addTable($options['name'], $options['table']); } else { if ($options['action'] == "add-column") { if (!isset($options['name']) || !isset($options['table']) || !isset($options['column']) || !isset($options['type'])) { die("Usage: php zombie.php migrate action=add-column name=<name> " . "table=<table> column=<column> type=<type> [extra=<extra>]\n"); } if (!isset($options['extra'])) { $options['extra'] = ''; } addColumn($options['name'], $options['table'], $options['column'], $options['type'], $options['extra']); } else { die("Error: Unkown action '" . $options['action'] . "'.\n"); } } } } } }
genMenu(); ?> </div> <div class="container2" > <div class="ueberschrift"> <p style="font-size:20px;"> Flüge </p> <div class="flugLabel"> <table id="myTable" class="tablesorter"> <thead> <tr> <!--Tabelle einfügen(Überschriften, leere Spalten)--> <?php addTable($larray, 0); ?> </tr> </thead> <tbody> <?php addTableData(); ?> </tbody> </table> </div> </div> <div class="clear"></div> </div> <div> <a class="button" href="#openModal">neuen Flug hinzufügen</a>
ini_set('display_errors', 'On'); // connect to db server $connection = @mysql_connect($config["host"]["name"], $config["host"]["user"], $config["host"]["password"]) or die('Couldn\'t connect: ' . mysql_error()); // create a new database if (createDB($connection, $config["db"]["name"]) == "") { // select this database if (mysql_select_db($config["db"]["name"])) { // // initial setup // // get some information about the database environment echo "<h2>Displaying databases</h2>"; listDBTables($connection); // create tables foreach ($db_schema as $table => $keys) { $tableResult = addTable($connection, $table, $keys); // if there's an error, show it if ($tableResult) { echo $tableResult; } } // populate tables foreach ($db_data as $table => $items) { $tableResult = populateTable($connection, $table, $items); // if there's an error, show it if ($tableResult) { echo $tableResult; } } // display the tables on screen so we can see they were created echo "<h2>Showing script-created tables</h2>";