@@ -1098,6 +1098,10 @@ discard block |
||
| 1098 | 1098 | else return array(); |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | + /** |
|
| 1102 | + * @param string $type |
|
| 1103 | + * @param string $rules |
|
| 1104 | + */ |
|
| 1101 | 1105 | public function addNOTAM($ref,$title,$type,$fir,$code,$rules,$scope,$lower_limit,$upper_limit,$center_latitude,$center_longitude,$radius,$date_begin,$date_end,$permanent,$text,$full_notam) { |
| 1102 | 1106 | $query = "INSERT INTO notam (ref,title,notam_type,fir,code,rules,scope,lower_limit,upper_limit,center_latitude,center_longitude,radius,date_begin,date_end,permanent,notam_text,full_notam) VALUES (:ref,:title,:type,:fir,:code,:rules,:scope,:lower_limit,:upper_limit,:center_latitude,:center_longitude,:radius,:date_begin,:date_end,:permanent,:text,:full_notam)"; |
| 1103 | 1107 | $query_values = array(':ref' => $ref,':title' => $title,':type' => $type,':fir' => $fir,':code' => $code,':rules' => $rules,':scope' => $scope,':lower_limit' => $lower_limit,':upper_limit' => $upper_limit,':center_latitude' => $center_latitude,':center_longitude' => $center_longitude,':radius' => $radius,':date_begin' => $date_begin,':date_end' => $date_end,':permanent' => $permanent,':text' => $text,':full_notam' => $full_notam); |
@@ -1179,6 +1183,10 @@ discard block |
||
| 1179 | 1183 | } |
| 1180 | 1184 | } |
| 1181 | 1185 | } |
| 1186 | + |
|
| 1187 | + /** |
|
| 1188 | + * @param string $filename |
|
| 1189 | + */ |
|
| 1182 | 1190 | public function updateNOTAMfromTextFile($filename) { |
| 1183 | 1191 | $alldata = $this->parseNOTAMtextFile($filename); |
| 1184 | 1192 | if (count($alldata) > 0) { |
@@ -1223,6 +1231,9 @@ discard block |
||
| 1223 | 1231 | } |
| 1224 | 1232 | } |
| 1225 | 1233 | |
| 1234 | + /** |
|
| 1235 | + * @param string $icao |
|
| 1236 | + */ |
|
| 1226 | 1237 | public function downloadNOTAM($icao) { |
| 1227 | 1238 | date_default_timezone_set("UTC"); |
| 1228 | 1239 | $Common = new Common(); |
@@ -1359,6 +1370,9 @@ discard block |
||
| 1359 | 1370 | return $result; |
| 1360 | 1371 | } |
| 1361 | 1372 | |
| 1373 | + /** |
|
| 1374 | + * @param string $code |
|
| 1375 | + */ |
|
| 1362 | 1376 | public function parse_code($code) { |
| 1363 | 1377 | $code = str_split($code); |
| 1364 | 1378 | $code_fp = $code[1].$code[2]; |
@@ -179,6 +179,10 @@ discard block |
||
| 179 | 179 | return 1; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | + /** |
|
| 183 | + * @param double $lat |
|
| 184 | + * @param integer $isodd |
|
| 185 | + */ |
|
| 182 | 186 | public function cprN($lat,$isodd) { |
| 183 | 187 | $nl = $this->cprNL($lat) - $isodd; |
| 184 | 188 | if ($nl > 1) return $nl; |
@@ -186,6 +190,10 @@ discard block |
||
| 186 | 190 | } |
| 187 | 191 | |
| 188 | 192 | |
| 193 | + /** |
|
| 194 | + * @param string $msg |
|
| 195 | + * @param string $bin |
|
| 196 | + */ |
|
| 189 | 197 | function parityCheck($msg, $bin) { |
| 190 | 198 | $modes_checksum_table = array( |
| 191 | 199 | 0x3935ea, 0x1c9af5, 0xf1b77e, 0x78dbbf, 0xc397db, 0x9e31e9, 0xb0e2f0, 0x587178, |
@@ -40,6 +40,10 @@ |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $id |
|
| 45 | + * @param string $ident |
|
| 46 | + */ |
|
| 43 | 47 | public function get_Schedule($id,$ident) { |
| 44 | 48 | global $globalDebug, $globalFork, $globalSchedulesFetch; |
| 45 | 49 | // Get schedule here, so it's done only one time |
@@ -125,6 +125,9 @@ discard block |
||
| 125 | 125 | public $tag_start = 0; |
| 126 | 126 | private $dom = null; |
| 127 | 127 | |
| 128 | + /** |
|
| 129 | + * @param simple_html_dom $dom |
|
| 130 | + */ |
|
| 128 | 131 | function __construct($dom) |
| 129 | 132 | { |
| 130 | 133 | $this->dom = $dom; |
@@ -1501,6 +1504,11 @@ discard block |
||
| 1501 | 1504 | } |
| 1502 | 1505 | |
| 1503 | 1506 | // parse attributes |
| 1507 | + |
|
| 1508 | + /** |
|
| 1509 | + * @param simple_html_dom_node $node |
|
| 1510 | + * @param string[] $space |
|
| 1511 | + */ |
|
| 1504 | 1512 | protected function parse_attr($node, $name, &$space) |
| 1505 | 1513 | { |
| 1506 | 1514 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1546,11 @@ discard block |
||
| 1538 | 1546 | } |
| 1539 | 1547 | |
| 1540 | 1548 | // link node's parent |
| 1549 | + |
|
| 1550 | + /** |
|
| 1551 | + * @param simple_html_dom_node $node |
|
| 1552 | + * @param boolean $is_child |
|
| 1553 | + */ |
|
| 1541 | 1554 | protected function link_nodes(&$node, $is_child) |
| 1542 | 1555 | { |
| 1543 | 1556 | $node->parent = $this->parent; |
@@ -1549,6 +1562,10 @@ discard block |
||
| 1549 | 1562 | } |
| 1550 | 1563 | |
| 1551 | 1564 | // as a text node |
| 1565 | + |
|
| 1566 | + /** |
|
| 1567 | + * @param string $tag |
|
| 1568 | + */ |
|
| 1552 | 1569 | protected function as_text_node($tag) |
| 1553 | 1570 | { |
| 1554 | 1571 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1576,18 @@ discard block |
||
| 1559 | 1576 | return true; |
| 1560 | 1577 | } |
| 1561 | 1578 | |
| 1579 | + /** |
|
| 1580 | + * @param string $chars |
|
| 1581 | + */ |
|
| 1562 | 1582 | protected function skip($chars) |
| 1563 | 1583 | { |
| 1564 | 1584 | $this->pos += strspn($this->doc, $chars, $this->pos); |
| 1565 | 1585 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
| 1566 | 1586 | } |
| 1567 | 1587 | |
| 1588 | + /** |
|
| 1589 | + * @param string $chars |
|
| 1590 | + */ |
|
| 1568 | 1591 | protected function copy_skip($chars) |
| 1569 | 1592 | { |
| 1570 | 1593 | $pos = $this->pos; |
@@ -1575,6 +1598,9 @@ discard block |
||
| 1575 | 1598 | return substr($this->doc, $pos, $len); |
| 1576 | 1599 | } |
| 1577 | 1600 | |
| 1601 | + /** |
|
| 1602 | + * @param string $chars |
|
| 1603 | + */ |
|
| 1578 | 1604 | protected function copy_until($chars) |
| 1579 | 1605 | { |
| 1580 | 1606 | $pos = $this->pos; |
@@ -1584,6 +1610,9 @@ discard block |
||
| 1584 | 1610 | return substr($this->doc, $pos, $len); |
| 1585 | 1611 | } |
| 1586 | 1612 | |
| 1613 | + /** |
|
| 1614 | + * @param string $char |
|
| 1615 | + */ |
|
| 1587 | 1616 | protected function copy_until_char($char) |
| 1588 | 1617 | { |
| 1589 | 1618 | if ($this->char===null) return ''; |
@@ -1602,6 +1631,9 @@ discard block |
||
| 1602 | 1631 | return substr($this->doc, $pos_old, $pos-$pos_old); |
| 1603 | 1632 | } |
| 1604 | 1633 | |
| 1634 | + /** |
|
| 1635 | + * @param string $char |
|
| 1636 | + */ |
|
| 1605 | 1637 | protected function copy_until_char_escape($char) |
| 1606 | 1638 | { |
| 1607 | 1639 | if ($this->char===null) return ''; |
@@ -1633,6 +1665,10 @@ discard block |
||
| 1633 | 1665 | |
| 1634 | 1666 | // remove noise from html content |
| 1635 | 1667 | // save the noise in the $this->noise array. |
| 1668 | + |
|
| 1669 | + /** |
|
| 1670 | + * @param string $pattern |
|
| 1671 | + */ |
|
| 1636 | 1672 | protected function remove_noise($pattern, $remove_tag=false) |
| 1637 | 1673 | { |
| 1638 | 1674 | global $debug_object; |
@@ -1658,6 +1694,10 @@ discard block |
||
| 1658 | 1694 | } |
| 1659 | 1695 | |
| 1660 | 1696 | // restore noise to html content |
| 1697 | + |
|
| 1698 | + /** |
|
| 1699 | + * @param string|null $text |
|
| 1700 | + */ |
|
| 1661 | 1701 | function restore_noise($text) |
| 1662 | 1702 | { |
| 1663 | 1703 | global $debug_object; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | /** |
| 15 | 15 | * Get SQL query part for filter used |
| 16 | 16 | * @param Array $filter the filter |
| 17 | - * @return Array the SQL part |
|
| 17 | + * @return string the SQL part |
|
| 18 | 18 | */ |
| 19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Get SQL query part for filter used |
| 13 | 13 | * @param Array $filter the filter |
| 14 | - * @return Array the SQL part |
|
| 14 | + * @return string the SQL part |
|
| 15 | 15 | */ |
| 16 | 16 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 17 | 17 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Get SQL query part for filter used |
| 17 | 17 | * @param Array $filter the filter |
| 18 | - * @return Array the SQL part |
|
| 18 | + * @return string the SQL part |
|
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | public function getFilter($filter = array(),$where = false,$and = false) { |
@@ -486,9 +486,6 @@ discard block |
||
| 486 | 486 | /** |
| 487 | 487 | * Update ident spotter data |
| 488 | 488 | * |
| 489 | - * @param String $flightaware_id the ID from flightaware |
|
| 490 | - * @param String $ident the flight ident |
|
| 491 | - * @return String success or false |
|
| 492 | 489 | * |
| 493 | 490 | */ |
| 494 | 491 | public function updateIdentTrackerData($famtrackid = '', $ident = '',$fromsource = NULL) |
@@ -510,10 +507,6 @@ discard block |
||
| 510 | 507 | /** |
| 511 | 508 | * Update latest spotter data |
| 512 | 509 | * |
| 513 | - * @param String $flightaware_id the ID from flightaware |
|
| 514 | - * @param String $ident the flight ident |
|
| 515 | - * @param String $arrival_airport_icao the arrival airport |
|
| 516 | - * @return String success or false |
|
| 517 | 510 | * |
| 518 | 511 | */ |
| 519 | 512 | public function updateLatestTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $groundspeed = NULL, $date = '') |
@@ -535,29 +528,6 @@ discard block |
||
| 535 | 528 | /** |
| 536 | 529 | * Adds a new spotter data |
| 537 | 530 | * |
| 538 | - * @param String $flightaware_id the ID from flightaware |
|
| 539 | - * @param String $ident the flight ident |
|
| 540 | - * @param String $aircraft_icao the aircraft type |
|
| 541 | - * @param String $departure_airport_icao the departure airport |
|
| 542 | - * @param String $arrival_airport_icao the arrival airport |
|
| 543 | - * @param String $latitude latitude of flight |
|
| 544 | - * @param String $longitude latitude of flight |
|
| 545 | - * @param String $waypoints waypoints of flight |
|
| 546 | - * @param String $altitude altitude of flight |
|
| 547 | - * @param String $heading heading of flight |
|
| 548 | - * @param String $groundspeed speed of flight |
|
| 549 | - * @param String $date date of flight |
|
| 550 | - * @param String $departure_airport_time departure time of flight |
|
| 551 | - * @param String $arrival_airport_time arrival time of flight |
|
| 552 | - * @param String $squawk squawk code of flight |
|
| 553 | - * @param String $route_stop route stop of flight |
|
| 554 | - * @param String $highlight highlight or not |
|
| 555 | - * @param String $ModeS ModesS code of flight |
|
| 556 | - * @param String $registration registration code of flight |
|
| 557 | - * @param String $pilot_id pilot id of flight (for virtual airlines) |
|
| 558 | - * @param String $pilot_name pilot name of flight (for virtual airlines) |
|
| 559 | - * @param String $verticalrate vertival rate of flight |
|
| 560 | - * @return String success or false |
|
| 561 | 531 | */ |
| 562 | 532 | public function addTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $comment = '', $type = '',$format_source = '', $source_name = '') |
| 563 | 533 | { |
@@ -1428,7 +1398,7 @@ discard block |
||
| 1428 | 1398 | /** |
| 1429 | 1399 | * Parses the direction degrees to working |
| 1430 | 1400 | * |
| 1431 | - * @param Float $direction the direction in degrees |
|
| 1401 | + * @param integer $direction the direction in degrees |
|
| 1432 | 1402 | * @return Array the direction information |
| 1433 | 1403 | * |
| 1434 | 1404 | */ |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * Get SQL query part for filter used |
| 16 | 16 | * @param Array $filter the filter |
| 17 | - * @return Array the SQL part |
|
| 17 | + * @return string the SQL part |
|
| 18 | 18 | */ |
| 19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -759,10 +759,6 @@ discard block |
||
| 759 | 759 | * |
| 760 | 760 | * @param String $famtrackid the ID from flightaware |
| 761 | 761 | * @param String $ident the flight ident |
| 762 | - * @param String $aircraft_icao the aircraft type |
|
| 763 | - * @param String $departure_airport_icao the departure airport |
|
| 764 | - * @param String $arrival_airport_icao the arrival airport |
|
| 765 | - * @return String success or false |
|
| 766 | 762 | * |
| 767 | 763 | */ |
| 768 | 764 | public function addLiveTrackerData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') |
@@ -68,6 +68,10 @@ discard block |
||
| 68 | 68 | 't', 'u', 'v', 'w' // 119 |
| 69 | 69 | ); // char 64 |
| 70 | 70 | */ |
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * @param integer $ascii |
|
| 74 | + */ |
|
| 71 | 75 | private function asciidec_2_8bit($ascii) { |
| 72 | 76 | //only process in the following range: 48-87, 96-119 |
| 73 | 77 | if ($ascii < 48) { } |
@@ -93,6 +97,10 @@ discard block |
||
| 93 | 97 | return(substr($bin, -6)); |
| 94 | 98 | } |
| 95 | 99 | |
| 100 | + /** |
|
| 101 | + * @param integer $_start |
|
| 102 | + * @param integer $_size |
|
| 103 | + */ |
|
| 96 | 104 | private function binchar($_str, $_start, $_size) { |
| 97 | 105 | // ' ' --- '?', // 0x20 - 0x3F |
| 98 | 106 | // '@' --- '_', // 0x40 - 0x5F |
@@ -118,6 +126,10 @@ discard block |
||
| 118 | 126 | } |
| 119 | 127 | |
| 120 | 128 | // function for decoding the AIS Message ITU Payload |
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @param string $_aisdata |
|
| 132 | + */ |
|
| 121 | 133 | private function decode_ais($_aisdata) { |
| 122 | 134 | $ro = new stdClass(); // return object |
| 123 | 135 | $ro->cls = 0; // AIS class undefined, also indicate unparsed msg |
@@ -351,6 +363,12 @@ discard block |
||
| 351 | 363 | elseif ($code == 99) return 'Other Type, no additional information'; |
| 352 | 364 | } |
| 353 | 365 | |
| 366 | + /** |
|
| 367 | + * @param string $_itu |
|
| 368 | + * @param integer $_len |
|
| 369 | + * @param integer $_filler |
|
| 370 | + * @param string $aux |
|
| 371 | + */ |
|
| 354 | 372 | public function process_ais_itu($_itu, $_len, $_filler, $aux /*, $ais_ch*/) { |
| 355 | 373 | global $port; // tcpip port... |
| 356 | 374 | |
@@ -371,6 +389,10 @@ discard block |
||
| 371 | 389 | |
| 372 | 390 | // char* - AIS \r terminated string |
| 373 | 391 | // TCP based streams which send messages in full can use this instead of calling process_ais_buf |
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * @param string $rawdata |
|
| 395 | + */ |
|
| 374 | 396 | public function process_ais_raw($rawdata, $aux = '') { // return int |
| 375 | 397 | static $num_seq; // 1 to 9 |
| 376 | 398 | static $seq; // 1 to 9 |
@@ -589,6 +611,9 @@ discard block |
||
| 589 | 611 | return $result; |
| 590 | 612 | } |
| 591 | 613 | |
| 614 | + /** |
|
| 615 | + * @param string $mmsi |
|
| 616 | + */ |
|
| 592 | 617 | public function mmsitype($mmsi) { |
| 593 | 618 | if (strlen($mmsi) == 9) { |
| 594 | 619 | if (substr($mmsi,0,3) == '974') return 'EPIRB (Emergency Position Indicating Radio Beacon) AIS'; |