Ejemplo n.º 1
0
            }
            $allentries[] = $tabledata[$tablelist[$globalkey][$table]['searchkey']];
        }
        //search for deleted entries
        unset($comma);
        foreach ($allentries as $searchkeys) {
            $exceptkeys .= $comma . $tablelist[$globalkey][$table]['searchkey'] . "!='" . mysql_real_escape_string($searchkeys) . "'";
            $comma = " AND ";
        }
        if ($exceptkeys) {
            $exceptkeys = "WHERE {$exceptkeys}";
        }
        $querytabledata_old = MYSQL_QUERY("SELECT " . $tablelist[$globalkey][$table]['searchkey'] . " FROM {$table} {$exceptkeys}", $dbold);
        $delentries = MYSQL_NUM_ROWS($querytabledata_old);
        while ($tabledata_old = MYSQL_FETCH_ASSOC($querytabledata_old)) {
            $sqldiff->write_cache("sql,{$globalkey},{$table},del," . $tabledata_old[$tablelist[$globalkey][$table]['searchkey']], $tabledata_old[$tablelist[$globalkey][$table]['searchkey']]);
            $content['del'] .= "<div class='bordered small'><b>DEL</b> {$table}/" . $tablelist[$globalkey][$table]['searchkey'] . " => " . $stringtable->get_string($tabledata_old[$tablelist[$globalkey][$table]['searchkey']]) . " (" . $tabledata_old[$tablelist[$globalkey][$table]['searchkey']] . ")</div>";
        }
        #---------------
        //any diffs made? if yes than set settings for later use, if no than ignore whole table
        if ($diffentries or $newentries or $delentries) {
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,searchkey", $tablelist[$globalkey][$table]['searchkey']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,ignore", $tablelist[$globalkey][$table]['ignore']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,columnnametable", $tablelist[$globalkey][$table]['columnnametable']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,parsexml", $tablelist[$globalkey][$table]['parsexml']);
            $finalcontent .= "\n\t\t\t\t\t<div class='subtitle' style='margin-top:12px;'>{$table} Diff: {$diffentries}/New: {$newentries}/Del: {$delentries}</div>\n\t\t\t\t\t{$content['diff']}\n\t\t\t\t\t{$content['new']}\n\t\t\t\t\t{$content['del']}\n\t\t\t\t";
        }
    }
}
$sqldiff->export_cache("{$florensia->root_abs}/sqldiff_" . $sqldiff->get_cache("timestamp") . ".php");
$florensia->output_page($finalcontent);