Пример #1
0
<?php

require 'require/class.Connection.php';
require 'require/class.Spotter.php';
require 'require/class.METAR.php';
$Spotter = new Spotter();
if (isset($_GET['airport_icao'])) {
    $icao = filter_input(INPUT_GET, 'airport_icao', FILTER_SANITIZE_STRING);
    $spotter_array = $Spotter->getAllAirportInfo($icao);
    if (isset($globalMETAR) && $globalMETAR) {
        $METAR = new METAR();
        $metar_info = $METAR->getMETAR($icao);
        //print_r($metar_info);
        if (isset($metar_info[0]['metar'])) {
            $metar_parse = $METAR->parse($metar_info[0]['metar']);
        }
        //print_r($metar_parse);
    }
}
?>
<div class="alldetails">
<button type="button" class="close">&times;</button>
<?php 
$spotter_item = $spotter_array[0];
//print_r($spotter_item);
date_default_timezone_set('UTC');
if (isset($spotter_item['image_thumb']) && $spotter_item['image_thumb'] != "") {
    $image = $spotter_item['image_thumb'];
}
print '<div class="top">';
if (isset($image)) {
Пример #2
0
require dirname(__FILE__) . '/../install/class.update_db.php';
$update_db = new update_db();
if (isset($globalNOTAM) && $globalNOTAM && $update_db->check_last_notam_update()) {
    echo "updating NOTAM...";
    $update_db->update_notam();
    $update_db->insert_last_notam_update();
} elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) {
    echo "NOTAM are only updated once a day.\n";
}
if ($update_db->check_last_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    $update_db->update_all();
    require_once '../require/class.Spotter.php';
    $Spotter = new Spotter();
    $Spotter->updateFieldsFromOtherTables();
    $update_db->insert_last_update();
} elseif (isset($globalDebug) && $globalDebug && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n";
}
if (isset($globalMETAR) && isset($globalMETARcycle) && $globalMETAR && $globalMETARcycle) {
    echo "updating METAR...";
    require_once '../require/class.METAR.php';
    $METAR = new METAR();
    $METAR->addMETARCycle();
}
if (isset($globalOwner) && $globalOwner && $update_db->check_last_owner_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    echo "Updating private aircraft's owners...";
    $update_db->update_owner();
    $update_db->insert_last_owner_update();
} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalIVAO) || !$globalIVAO)) {
    echo "Owner are only updated every 15 days.\n";
}