@@ -36,6 +36,10 @@ discard block |
||
| 36 | 36 | /* the year 1999 assuming that two-digit years in the range 00-56 */ |
| 37 | 37 | /* correspond to 2000-2056. Until the two-line element set format */ |
| 38 | 38 | /* is changed, it is only valid for dates through 2056 December 31. */ |
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @param double $epoch |
|
| 42 | + */ |
|
| 39 | 43 | public static function Julian_Date_of_Epoch($epoch) |
| 40 | 44 | { |
| 41 | 45 | $year = 0; |
@@ -54,6 +58,11 @@ discard block |
||
| 54 | 58 | } |
| 55 | 59 | |
| 56 | 60 | /* Equivalent to the C modf function */ |
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * @param double $x |
|
| 64 | + * @param integer $ipart |
|
| 65 | + */ |
|
| 57 | 66 | public static function modf($x, &$ipart) { |
| 58 | 67 | $ipart = (int)$x; |
| 59 | 68 | return $x - $ipart; |
@@ -63,6 +72,10 @@ discard block |
||
| 63 | 72 | /* of Day 0.0 of {year}. This function is used to calculate the */ |
| 64 | 73 | /* Julian Date of any date by using Julian_Date_of_Year, DOY, */ |
| 65 | 74 | /* and Fraction_of_Day. */ |
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * @param integer $year |
|
| 78 | + */ |
|
| 66 | 79 | public static function Julian_Date_of_Year($year) |
| 67 | 80 | { |
| 68 | 81 | /* Astronomical Formulae for Calculators, Jean Meeus, */ |
@@ -85,6 +98,10 @@ discard block |
||
| 85 | 98 | /* 1999, as described above. The function ThetaG_JD provides the */ |
| 86 | 99 | /* same calculation except that it is based on an input in the */ |
| 87 | 100 | /* form of a Julian Date. */ |
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @param double $epoch |
|
| 104 | + */ |
|
| 88 | 105 | public static function ThetaG($epoch, Predict_DeepArg $deep_arg) |
| 89 | 106 | { |
| 90 | 107 | /* Reference: The 1992 Astronomical Almanac, page B6. */ |
@@ -157,6 +174,10 @@ discard block |
||
| 157 | 174 | /* (approximately the same as UTC) and ET (now referred to as TDT).*/ |
| 158 | 175 | /* This function is based on a least squares fit of data from 1950 */ |
| 159 | 176 | /* to 1991 and will need to be updated periodically. */ |
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * @param double $year |
|
| 180 | + */ |
|
| 160 | 181 | public static function Delta_ET($year) |
| 161 | 182 | { |
| 162 | 183 | /* Values determined using data from 1950-1991 in the 1990 |
@@ -204,7 +225,7 @@ discard block |
||
| 204 | 225 | * |
| 205 | 226 | * @param Predict_TLE $tle The TLE object |
| 206 | 227 | * |
| 207 | - * @return int |
|
| 228 | + * @return double |
|
| 208 | 229 | */ |
| 209 | 230 | public static function getEpochTimeStamp(Predict_TLE $tle) |
| 210 | 231 | { |
@@ -13,6 +13,10 @@ discard block |
||
| 13 | 13 | $this->db = $Connection->db(); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $type |
|
| 18 | + * @param string $stats_date |
|
| 19 | + */ |
|
| 16 | 20 | public function addLastStatsUpdate($type,$stats_date) { |
| 17 | 21 | $query = "DELETE FROM config WHERE name = :type; |
| 18 | 22 | INSERT INTO config (name,value) VALUES (:type,:stats_date);"; |
@@ -578,6 +582,11 @@ discard block |
||
| 578 | 582 | $all = $sth->fetchAll(PDO::FETCH_ASSOC); |
| 579 | 583 | return $all; |
| 580 | 584 | } |
| 585 | + |
|
| 586 | + /** |
|
| 587 | + * @param string $type |
|
| 588 | + * @param string $year |
|
| 589 | + */ |
|
| 581 | 590 | public function getSumStats($type,$year,$stats_airline = '') { |
| 582 | 591 | global $globalArchiveMonths, $globalDBdriver; |
| 583 | 592 | if ($globalDBdriver == 'mysql') { |
@@ -677,6 +686,10 @@ discard block |
||
| 677 | 686 | return $all[0]['total']; |
| 678 | 687 | } |
| 679 | 688 | |
| 689 | + /** |
|
| 690 | + * @param string $type |
|
| 691 | + * @param string $stats_date |
|
| 692 | + */ |
|
| 680 | 693 | public function addStat($type,$cnt,$stats_date,$stats_airline = '') { |
| 681 | 694 | global $globalDBdriver; |
| 682 | 695 | if ($globalDBdriver == 'mysql') { |
@@ -708,6 +721,10 @@ discard block |
||
| 708 | 721 | return "error : ".$e->getMessage(); |
| 709 | 722 | } |
| 710 | 723 | } |
| 724 | + |
|
| 725 | + /** |
|
| 726 | + * @param string $date |
|
| 727 | + */ |
|
| 711 | 728 | public function getStatsSource($date,$stats_type = '') { |
| 712 | 729 | if ($stats_type == '') { |
| 713 | 730 | $query = "SELECT * FROM stats_source WHERE stats_date = :date ORDER BY source_name"; |
@@ -726,6 +743,9 @@ discard block |
||
| 726 | 743 | return $all; |
| 727 | 744 | } |
| 728 | 745 | |
| 746 | + /** |
|
| 747 | + * @param string $stats_type |
|
| 748 | + */ |
|
| 729 | 749 | public function addStatSource($data,$source_name,$stats_type,$date) { |
| 730 | 750 | global $globalDBdriver; |
| 731 | 751 | if ($globalDBdriver == 'mysql') { |
@@ -741,6 +761,10 @@ discard block |
||
| 741 | 761 | return "error : ".$e->getMessage(); |
| 742 | 762 | } |
| 743 | 763 | } |
| 764 | + |
|
| 765 | + /** |
|
| 766 | + * @param string $type |
|
| 767 | + */ |
|
| 744 | 768 | public function addStatFlight($type,$date_name,$cnt,$stats_airline = '') { |
| 745 | 769 | $query = "INSERT INTO stats_flight (stats_type,flight_date,cnt,stats_airline) VALUES (:type,:flight_date,:cnt,:stats_airline)"; |
| 746 | 770 | $query_values = array(':type' => $type,':flight_date' => $date_name,':cnt' => $cnt, ':stats_airline' => $stats_airline); |
@@ -927,6 +951,10 @@ discard block |
||
| 927 | 951 | return "error : ".$e->getMessage(); |
| 928 | 952 | } |
| 929 | 953 | } |
| 954 | + |
|
| 955 | + /** |
|
| 956 | + * @param string $type |
|
| 957 | + */ |
|
| 930 | 958 | public function deleteStatFlight($type) { |
| 931 | 959 | $query = "DELETE FROM stats_flight WHERE stats_type = :type"; |
| 932 | 960 | $query_values = array(':type' => $type); |
@@ -937,6 +965,10 @@ discard block |
||
| 937 | 965 | return "error : ".$e->getMessage(); |
| 938 | 966 | } |
| 939 | 967 | } |
| 968 | + |
|
| 969 | + /** |
|
| 970 | + * @param string $type |
|
| 971 | + */ |
|
| 940 | 972 | public function deleteStatAirport($type) { |
| 941 | 973 | $query = "DELETE FROM stats_airport WHERE stats_type = :type"; |
| 942 | 974 | $query_values = array(':type' => $type); |
@@ -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; |
@@ -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 | public function getFilter($filter = array(),$where = false,$and = false) { |
| 21 | 21 | global $globalFilter; |
@@ -8612,6 +8612,7 @@ discard block |
||
| 8612 | 8612 | /** |
| 8613 | 8613 | * Counts all hours |
| 8614 | 8614 | * |
| 8615 | + * @param string $orderby |
|
| 8615 | 8616 | * @return Array the hour list |
| 8616 | 8617 | * |
| 8617 | 8618 | */ |
@@ -8677,6 +8678,7 @@ discard block |
||
| 8677 | 8678 | /** |
| 8678 | 8679 | * Counts all hours |
| 8679 | 8680 | * |
| 8681 | + * @param string $orderby |
|
| 8680 | 8682 | * @return Array the hour list |
| 8681 | 8683 | * |
| 8682 | 8684 | */ |
@@ -9501,7 +9503,7 @@ discard block |
||
| 9501 | 9503 | /** |
| 9502 | 9504 | * Parses the direction degrees to working |
| 9503 | 9505 | * |
| 9504 | - * @param Float $direction the direction in degrees |
|
| 9506 | + * @param integer $direction the direction in degrees |
|
| 9505 | 9507 | * @return Array the direction information |
| 9506 | 9508 | * |
| 9507 | 9509 | */ |
@@ -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]; |
@@ -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; |