22); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } // isbasewindow: // On Open while( ($__action == "" or $__action == "executedonopen") and (empty($_x) or in('onopen', $_x)) ) { $__action = "executedonopen"; if( !isset($riuulkjkljfe) ) die(""); $cfgfile = "servers/$server.cfg"; if( file_exists($cfgfile) ) { $slaves = readProperty($cfgfile, "replicate_slaves"); $tables = readProperty($cfgfile, "replicate_tables"); $aslaves = StringTokenize($slaves, ','); $atables = StringTokenize($tables, ','); } if( isset($all) ) { error_reporting(E_ALL); ini_set('display_errors', 1); //$dumper = new Ifsnop\Mysqldump\Mysqldump("mysql:host=localhost;dbname=" + MYSQL_DB, MYSQL_USER, MYSQL_PASS); $dumpsettings = array( "include-tables" => array("cmvehiculo"), "complete-insert" => true, "no-create-info" => true, "skip-comments" => true, "skip-dump-date" => true, "skip-triggers" => true, "skip-definer" => true ); //print_r($dumpsettings); $dumper = new Ifsnop\Mysqldump\Mysqldump("mysql:host=localhost;dbname=fconsorcios", MYSQL_USER, MYSQL_PASS, $dumpsettings); $dumper->setTableWheres(array( "cmvehiculo" => "unidad in (select id from Unidades where emprendimientoid = 'Dorrego') and patente is not null and patente != ''" )); $filename = "replicate-" . rand(1, 10000) . ".sql"; $dumper->start($filename); //print(file_get_contents($filename)); $handle = fopen($filename, "r"); if ($handle) { while (($line = fgets($handle)) !== false) { // process the line read. if( startsWith($line, "INSERT ") ) print($line . chr(13) . chr(10)); } fclose($handle); } unlink($filename); exit(0); } print("

Master $server

"); // Tabla rplog print("

rplog table

"); if( istable($Link, "rplog") ) { print("Already"); } else { print("Creating ..."); sqlexec($Link, "create table rplog(id int not null default auto_increment, fecha timestamp, modo char(1), idregistro int, primary key(id))"); print("OK"); } print("
"); // Triggers print("

Triggers

"); foreach($atable as $table) { print("$table
"); print("Insert trigger... "); $sql = "create trigger {$table}_insert_after after insert on $table for each row begin insert into rplog(modo, idregistro) values('I', new.id); end;"; sqlexec($Link, $sql); print("OK
"); print("Update trigger... "); $sql = "create trigger {$table}_update_after after update on $table for each row begin insert into rplog(modo, idregistro) values('U', new.id); end;"; sqlexec($Link, $sql); print("OK
"); print("Delete trigger... "); $sql = "create trigger {$table}_delete_after after delete on $table for each row begin insert into rplog(modo, idregistro) values('D', old.id); end;"; sqlexec($Link, $sql); print("OK
"); } // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } break; } // PHP Vars while( ($__action == "" or $__action == "executedonopen") and isset($_GET['_x']) and empty($_x) ) { $__row0 = array(); $_result['morevars'] = $__row0; break; } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { require_once('../include/fpdfreport.php'); $_pdf = new PDF((isset($_orientation) ? $_orientation : 'P'),'pt', (isset($_size) ? $_size : 'A4' )); $_pdf->initialPage = ($_page != '' ? $_page : 1); //$_pdf->SetAutoPageBreak(true); $_pdf->title = ""; $_pdf->SetTopMargin(50); $_pdf->AliasNbPages(); $_pdf->AddPage(); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->Output(); } ?> '); //echo(''); echo(''); ?> class="popup" >