$res = $db->sql_query($query); if ($res > 0) { echo "<br><br>"; $flight = new flight(); $i = 0; while ($row = mysql_fetch_assoc($res)) { // $flight=new flight(); $flight->getFlightFromDB($row["ID"]); if (!is_file($flight->getIGCFilename())) { echo "[" . $row['ID'] . "] IGC not found<BR>"; } else { echo "[" . $row['ID'] . "] "; flush2Browser(); $flight->checkAirspace(1); echo " Checked: " . $flight->airspaceCheckMsg . "<BR>"; flush2Browser(); } $i++; if ($i > $airspaceChunk) { break; } } } echo "<BR><br><BR>DONE !!!<BR>"; } else { if ($_GET['importFile']) { $fileToImport = $_GET['importFile']; DEBUG('AdminAirspace', 1, "Importing file {$fileToImport}<BR>"); require_once dirname(__FILE__) . '/FN_airspace_admin.php'; ReadAirspace($airspaceDir . '/' . $fileToImport); if (!putAirspaceToDB()) {
function processSyncEntry($ID, $logItem, $verbose = 1) { echo "Processing entry " . ($logItem['transactionID'] + 0) . " ... "; if ($verbose) { flush2Browser(); } // print_r($logItem); // return 1; list($result, $message) = logReplicator::processEntry($ID, $logItem, $this->data['sync_type']); if ($result < -10) { echo "<div class='error'>ERROR </div>: {$message} <BR>"; return 0; } else { // update the pointer // BUT only if it is > than the last one if ($logItem['transactionID'] > $this->lastPullUpdateID) { $this->lastPullUpdateID = $logItem['transactionID'] + 0; $this->putToDB(1); } echo "<div class='ok'>OK</div>: {$message}<BR>"; return 1; } }