<?php
require_once('common/custom-config.php');
require_once(CUSTOM_SERVER_CONFIG);

require_once(LIB_PATH.DS.'session.class.php');
ob_start();
if(!empty($_POST['table'])){
		$tableName = $_POST['table'];
}else{
		die("Please select a table!");   
}

print_r($_FILES);
die;
$table = new Table($tableName);
$id = $table->save($_POST);
if($id !== false){
		 $session->message("@success@Saved!"); 
		 echo $id !== true ? $id : '';
}else{
		 $session->message("Failed to save! Perhaps you didn't change anything?");   
}
$redPage = $_SERVER['HTTP_REFERER'];
redirect_to($redPage);
?>