function del() { global $globalDebug; // Delete old infos $SpotterLive = new SpotterLive(); foreach ($this->all_flights as $key => $flight) { if (isset($flight['lastupdate'])) { if ($flight['lastupdate'] < time() - 3000) { if (isset($this->all_flights[$key]['id'])) { if ($globalDebug) { echo "--- Delete old values with id " . $this->all_flights[$key]['id'] . "\n"; } $SpotterLive->deleteLiveSpotterDataById($this->all_flights[$key]['id']); } unset($this->all_flights[$key]); } } } }
function del() { global $globalDebug; // Delete old infos foreach ($this->all_flights as $key => $flight) { if (isset($flight['lastupdate'])) { if ($flight['lastupdate'] < time() - 3000) { if (isset($this->all_flights[$key]['id'])) { if ($globalDebug) { echo "--- Delete old values with id " . $this->all_flights[$key]['id'] . "\n"; } $SpotterLive = new SpotterLive(); $SpotterLive->deleteLiveSpotterDataById($this->all_flights[$key]['id']); $SpotterLive->db = null; // FIXME : Add check on ground if available $real_arrival = $this->arrival($key); $Spotter = new Spotter(); $result = $Spotter->updateLatestSpotterData($this->all_flights[$key]['id'], $this->all_flights[$key]['ident'], $this->all_flights[$key]['latitude'], $this->all_flights[$key]['longitude'], $this->all_flights[$key]['altitude'], $this->all_flights[$key]['ground'], $this->all_flights[$key]['speed'], $this->all_flights[$key]['datetime'], $real_arrival['airport_icao'], $real_arrival['airport_time']); if ($globalDebug && $result != 'success') { echo '!!! ERROR : ' . $result . "\n"; } $Spotter->db = null; } unset($this->all_flights[$key]); } } } }