本文整理汇总了PHP中Schedule::addSchedule方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::addSchedule方法的具体用法?PHP Schedule::addSchedule怎么用?PHP Schedule::addSchedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::addSchedule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_schedule
public static function update_schedule()
{
$Connection = new Connection();
$query = "SELECT * FROM schedule";
try {
$sth = Connection::$db->prepare($query);
$sth->execute();
} catch (PDOException $e) {
return "error : " . $e->getMessage() . "\n";
}
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
Schedule::addSchedule($row['ident'], $row['departure_airport_icao'], $row['departure_airport_time'], $row['arrival_airport_icao'], $row['arrival_airport_time']);
}
}
示例2: Connection
function get_Schedule($id, $ident)
{
global $globalDebug;
// Get schedule here, so it's done only one time
$Connection = new Connection();
$dbc = $Connection->db;
$Spotter = new Spotter($dbc);
$Schedule = new Schedule($dbc);
$Translation = new Translation($dbc);
$operator = $Spotter->getOperator($ident);
if ($Schedule->checkSchedule($operator) == 0) {
$operator = $Translation->checkTranslation($ident);
if ($Schedule->checkSchedule($operator) == 0) {
$schedule = $Schedule->fetchSchedule($operator);
if (count($schedule) > 0) {
if ($globalDebug) {
echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
}
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
$this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
// FIXME : Check if route schedule = route from DB
if ($schedule['DepartureAirportIATA'] != '') {
if ($this->all_flights[$id]['departure_airport'] != $Spotter->getAirportIcao($schedule['DepartureAirportIATA'])) {
$airport_icao = $Spotter->getAirportIcao($schedule['DepartureAirportIATA']);
if ($airport_icao != '') {
$this->all_flights[$id]['departure_airport'] = $airport_icao;
if ($globalDebug) {
echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
}
}
}
}
if ($schedule['ArrivalAirportIATA'] != '') {
if ($this->all_flights[$id]['arrival_airport'] != $Spotter->getAirportIcao($schedule['ArrivalAirportIATA'])) {
$airport_icao = $Spotter->getAirportIcao($schedule['ArrivalAirportIATA']);
if ($airport_icao != '') {
$this->all_flights[$id]['arrival_airport'] = $airport_icao;
if ($globalDebug) {
echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
}
}
}
}
$Schedule->addSchedule($operator, $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['arrival_airport_time'], $schedule['Source']);
}
}
}
//$Connection->db = null;
}
示例3: get_Schedule
static function get_Schedule($id, $ident)
{
global $globalDebug;
// Get schedule here, so it's done only one time
$operator = Spotter::getOperator($ident);
if (Schedule::checkSchedule($operator) == 0) {
$operator = Translation::checkTranslation($ident);
if (Schedule::checkSchedule($operator) == 0) {
$schedule = Schedule::fetchSchedule($operator);
if (count($schedule) > 0) {
if ($globalDebug) {
echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
}
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
// FIXME : Check if route schedule = route from DB
if ($schedule['DepartureAirportIATA'] != '') {
if (self::$all_flights[$id]['departure_airport'] != Spotter::getAirportIcao($schedule['DepartureAirportIATA'])) {
$airport_icao = Spotter::getAirportIcao($schedule['DepartureAirportIATA']);
if ($airport_icao != '') {
self::$all_flights[$id]['departure_airport'] = $airport_icao;
if ($globalDebug) {
echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
}
}
}
}
if ($schedule['ArrivalAirportIATA'] != '') {
if (self::$all_flights[$id]['arrival_airport'] != Spotter::getAirportIcao($schedule['ArrivalAirportIATA'])) {
$airport_icao = Spotter::getAirportIcao($schedule['ArrivalAirportIATA']);
if ($airport_icao != '') {
self::$all_flights[$id]['arrival_airport'] = $airport_icao;
if ($globalDebug) {
echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
}
}
}
}
Schedule::addSchedule($operator, self::$all_flights[$id]['departure_airport'], self::$all_flights[$id]['departure_airport_time'], self::$all_flights[$id]['arrival_airport'], self::$all_flights[$id]['arrival_airport_time'], $schedule['Source']);
}
}
}
}
示例4: add
//.........这里部分代码省略.........
Reg. : F-GRHG - Ident : AF6040 - Label : 80 - Message : /RSYGXAF.VER/071/A319/M
SCH/AF6040/LFPO/LFML/09MAR/1715
FTX
DESOLE NOUS NE COMPREN
ONS PAS LE MESSAGE ...
*/
if (!$found) {
// example message : "FST01EGLLLIRFN047599E0033586390 55 25- 4C 74254 487 2059194"
//FIX : Reg. : G-DOCF - Ident : BA2599 - Label : 15 - Message : FST01LIPXEGKKN478304E006124636000500057M057C060334309304372OA13431246
// FST01MMMXEGKKN376904W079449733007380380 019061 XA1237 => wind direction and velocity (019/061)
//$n = sscanf($message, "FST01%4c%4c%c%06d%c%07d%*11[0-9a-zA-Z ]-%02dC", $dair, $darr, $lac, $la, $lnc, $ln, $temp);
$n = sscanf($message, "FST01%4c%4c%c%06d%c%07d%03d%*8[0-9a-zA-Z ]-%02dC", $dair, $darr, $lac, $la, $lnc, $ln, $alt, $temp);
if ($n > 5 && ($lac == 'N' || $lac == 'S') && ($lnc == 'E' || $lnc == 'W')) {
$latitude = $la / 10000.0;
$longitude = $ln / 10000.0;
if ($lac == 'S') {
$latitude = '-' . $latitude;
}
if ($lnc == 'W') {
$longitude = '-' . $longitude;
}
// Temp not always available
if ($globalDebug) {
echo 'latitude : ' . $latitude . ' - longitude : ' . $longitude . ' - airport depart : ' . $dair . ' - airport arrival : ' . $darr . ' - température : ' . $temp . "°C\n";
}
if ($temp == '') {
$decode = array('Latitude' => $latitude, 'Longitude' => $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr, 'Altitude' => $alt);
} else {
$decode = array('Latitude' => $latitude, 'Longitude' => $longitude, 'Departure airport' => $dair, 'Arrival airport' => $darr, 'Altitude' => 'FL' . $alt, 'Temperature' => $temp . '°C');
}
//$icao = ACARS->ident2icao($ident);
$icao = $Translation->checkTranslation($ident);
$Schedule->addSchedule($icao, $dair, '', $darr, '', 'ACARS');
$found = true;
}
}
if (!$found && $label == '10') {
$n = sscanf($message, "ARR01 %4[A-Z]%4d %4[A-Z]%4d", $dair, $dhour, $darr, $ahour);
if ($n == 4 && strlen($darr) == 4) {
if ($dhour != '') {
$dhour = substr(sprintf('%04d', $dhour), 0, 2) . ':' . substr(sprintf('%04d', $dhour), 2);
}
if ($ahour != '') {
$ahour = substr(sprintf('%04d', $ahour), 0, 2) . ':' . substr(sprintf('%04d', $ahour), 2);
}
if ($globalDebug) {
echo 'departure airport : ' . $dair . ' - arrival airport : ' . $darr . ' - departure hour : ' . $dhour . ' - arrival hour : ' . $ahour . "\n";
}
//$icao = ACARS->ident2icao($ident);
$icao = $Translation->checkTranslation($ident);
$Schedule->addSchedule($icao, $dair, $dhour, $darr, $ahour, 'ACARS');
$decode = array('Departure airport' => $dair, 'Departure hour' => $dhour, 'Arrival airport' => $darr, 'Arrival hour' => $ahour);
$found = true;
} elseif ($n == 2 || $n == 4) {
if ($dhour != '') {
$dhour = substr(sprintf('%04d', $dhour), 0, 2) . ':' . substr(sprintf('%04d', $dhour), 2);
}
if ($globalDebug) {
echo 'airport arrival : ' . $dair . ' - arrival hour : ' . $dhour . "\n";
}
//$icao = ACARS->ident2icao($ident);
$icao = $Translation->checkTranslation($ident);
$decode = array('Arrival airport' => $dair, 'Arrival hour' => $dhour);
$found = true;
} elseif ($n == 1) {