require_once('../include/orm.php');
require_once('../include/globals.php');
require_once('../include/util.php');
$_import_enform_db_connected = $Link == '';
if($_import_enform_db_connected) $Link = connectDb();
define('DBCONNECTED', 1);
if( !isset($_x) ) {
?>
}
if( isset($_x) and !(has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2')) ) {
if( $errors != "" ) $_result['errors'] = $errors;
if( $messages != "" ) $_result['messages'] = $messages;
if( $alerts != "" ) $_result['alerts'] = $alerts;
if( empty($_x) )
$_snapshot = arrayExclude(get_defined_vars(), array("_*", "s_*", "GLOBALS", "Link", "thisname"));
else
$_snapshot = objectToStructure(getSomeElements(get_defined_vars(), array("unnamed3") ));
//debug('initialvars:');
//debug($_initialvars);
//debug('snapshot:');
//debug($_snapshot);
unset($_snapshot['GLOBALS']);
$_changes = arrayChanges($_snapshot, $_initialvars);
if( !empty($_changes) ) $_result['changes'] = $_changes;
//logToFile("Variables changed: " . print_r($_changes) );
//logToFile("RESULT TO BROWSER: " . print_r($_result, true));
header('Content-Type: application/json');
print(json_encode($_result));
}
if($_import_enform_db_connected)
disconnectDb($Link);
?>