Example #1
0
function removePublishTable(PublishTable $table)
{
    global $config_db;
    $sql = "DELETE FROM db_tables WHERE id = " . $table->getTableID();
    $config_db->exec($sql);
    // Reload Database Connections
    loadPublishedTables();
}
Example #2
0
include_once '../common/config.database.php';
include_once '../common/class.users.php';
include_once '../common/class.connection.php';
include_once '../common/class.publish.php';
// Setup connection
$table = new PublishTable();
// Setup
if (isset($_SESSION['login_user'])) {
    InitializeConfig();
    $user = getUser($_SESSION['login_user']);
} else {
    header("Location: logout.php");
}
// Test for Update
if (isset($_GET['id'])) {
    loadPublishedTables();
    foreach ($db_tables as $gTbl) {
        if ($gTbl->getTableID() == $_GET['id']) {
            $table = $gTbl;
        }
    }
}
// Set Variables - Overwrite existing values
if (isset($_POST['name'])) {
    $tmp = split(":", $_POST['name']);
    $table->setConnID($tmp[0]);
    $table->setName($tmp[1]);
}
if (isset($_POST['desc'])) {
    $table->setDesc($_POST['desc']);
}