<?php
    require_once('../../../server/api-adodb/config.php');
    require_once(LIB_PATH.DS.'loggedin.php');
    ob_start();
    if(!empty($_POST['table'])){
        $tableName = $_POST['table'];
    }else{
        die("Please select a table!");
    }

    $table = new Table($tableName);
    $id = $table->save($_POST);
    if($id !== false){

        echo $id !== true ? 'Created!' : 'Updated!';
    }else{
        $session->message("Failed to save! Perhaps you didn't change anything?");
        echo'Nothing changed!';
    }
?>