@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $limit_start = 0; |
| 14 | 14 | $limit_end = 25; |
| 15 | 15 | $absolute_difference = 25; |
| 16 | - } else { |
|
| 16 | + } else { |
|
| 17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
| 18 | 18 | $limit_start = $limit_explode[0]; |
| 19 | 19 | $limit_end = $limit_explode[1]; |
@@ -47,7 +47,9 @@ discard block |
||
| 47 | 47 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
| 48 | 48 | $Stats = new Stats(); |
| 49 | 49 | $all_manufacturers = $Stats->getAllManufacturers(); |
| 50 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 50 | + if (empty($all_manufacturers)) { |
|
| 51 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
| 52 | + } |
|
| 51 | 53 | foreach($all_manufacturers as $all_manufacturer) |
| 52 | 54 | { |
| 53 | 55 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -20,20 +20,27 @@ discard block |
||
| 20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
| 21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
| 22 | 22 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
| 23 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
| 23 | + if (isset($source['source'])) { |
|
| 24 | + $filter['source'][] = $source['source']; |
|
| 25 | + } |
|
| 24 | 26 | } |
| 25 | 27 | } else { |
| 26 | 28 | $filter = $globalStatsFilters[$globalFilterName]; |
| 27 | 29 | } |
| 28 | 30 | } |
| 29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 31 | + if (is_array($globalFilter)) { |
|
| 32 | + $filter = array_merge($filter,$globalFilter); |
|
| 33 | + } |
|
| 30 | 34 | $filter_query_join = ''; |
| 31 | 35 | $filter_query_where = ''; |
| 32 | 36 | if (isset($filter['source']) && !empty($filter['source'])) { |
| 33 | 37 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
| 34 | 38 | } |
| 35 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 36 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 39 | + if ($filter_query_where == '' && $where) { |
|
| 40 | + $filter_query_where = ' WHERE'; |
|
| 41 | + } elseif ($filter_query_where != '' && $and) { |
|
| 42 | + $filter_query_where .= ' AND'; |
|
| 43 | + } |
|
| 37 | 44 | $filter_query = $filter_query_join.$filter_query_where; |
| 38 | 45 | return $filter_query; |
| 39 | 46 | } |
@@ -57,7 +64,9 @@ discard block |
||
| 57 | 64 | $info = str_replace('^','<br />',$info); |
| 58 | 65 | $info = str_replace('&sect;','',$info); |
| 59 | 66 | $info = str_replace('"','',$info); |
| 60 | - if ($type == '') $type = NULL; |
|
| 67 | + if ($type == '') { |
|
| 68 | + $type = NULL; |
|
| 69 | + } |
|
| 61 | 70 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
| 62 | 71 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
| 63 | 72 | try { |
@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
| 30 | 30 | $output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"'; |
| 31 | -if (!isset($_GET['now'])) $output .= ',"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z"'; |
|
| 31 | +if (!isset($_GET['now'])) { |
|
| 32 | + $output .= ',"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z"'; |
|
| 33 | +} |
|
| 32 | 34 | $output .= '}'; |
| 33 | 35 | //$output .= ',"clock": {"currentTime" : "'.date("c",time()).'","multiplier" : 300,"range" : "UNBOUNDED","step": "TICK_DEPENDENT"}'; |
| 34 | 36 | //$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
@@ -37,7 +39,9 @@ discard block |
||
| 37 | 39 | $output .= '},'; |
| 38 | 40 | $output .= '{'; |
| 39 | 41 | $output .= '"id": "santaclaus",'; |
| 40 | -if (!isset($_GET['now'])) $output .= '"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z",'; |
|
| 42 | +if (!isset($_GET['now'])) { |
|
| 43 | + $output .= '"interval": "'.date("Y").'-12-24T02:00:00Z/'.date("Y").'-12-25T02:00:00Z",'; |
|
| 44 | +} |
|
| 41 | 45 | $output .= '"properties": {'; |
| 42 | 46 | // Not yet supported in CZML with Cesium |
| 43 | 47 | $output .= '},'; |
@@ -36,8 +36,12 @@ |
||
| 36 | 36 | if (!empty($spotter_array)) { |
| 37 | 37 | include('table-output.php'); |
| 38 | 38 | print '<div class="pagination">'; |
| 39 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 40 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 39 | + if ($limit_previous_1 >= 0) { |
|
| 40 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 41 | + } |
|
| 42 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 43 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 44 | + } |
|
| 41 | 45 | print '</div>'; |
| 42 | 46 | } |
| 43 | 47 | print '</div>'; |
@@ -38,8 +38,12 @@ |
||
| 38 | 38 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
| 39 | 39 | include('table-output.php'); |
| 40 | 40 | print '<div class="pagination">'; |
| 41 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 42 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 41 | + if ($limit_previous_1 >= 0) { |
|
| 42 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 43 | + } |
|
| 44 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 45 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 46 | + } |
|
| 43 | 47 | print '</div>'; |
| 44 | 48 | } |
| 45 | 49 | print '</div>'; |
@@ -6,8 +6,11 @@ |
||
| 6 | 6 | $Spotter = new Spotter(); |
| 7 | 7 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
| 9 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 10 | -else $spotter_array = ''; |
|
| 9 | +if (isset($_GET['date'])) { |
|
| 10 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 11 | +} else { |
|
| 12 | + $spotter_array = ''; |
|
| 13 | +} |
|
| 11 | 14 | |
| 12 | 15 | if (!empty($spotter_array)) |
| 13 | 16 | { |
@@ -8,8 +8,11 @@ |
||
| 8 | 8 | $date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
| 9 | 9 | |
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 12 | -else $spotter_array = array(); |
|
| 11 | +if (isset($_GET['date'])) { |
|
| 12 | + $spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
| 13 | +} else { |
|
| 14 | + $spotter_array = array(); |
|
| 15 | +} |
|
| 13 | 16 | |
| 14 | 17 | if (!empty($spotter_array)) |
| 15 | 18 | { |
@@ -38,8 +38,12 @@ |
||
| 38 | 38 | if (!empty($spotter_array) && $spotter_array[0]['query_number_rows'] != 0) { |
| 39 | 39 | include('table-output.php'); |
| 40 | 40 | print '<div class="pagination">'; |
| 41 | - if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 42 | - if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 41 | + if ($limit_previous_1 >= 0) { |
|
| 42 | + print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>'; |
|
| 43 | + } |
|
| 44 | + if ($spotter_array[0]['query_number_rows'] == $absolute_difference) { |
|
| 45 | + print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>'; |
|
| 46 | + } |
|
| 43 | 47 | print '</div>'; |
| 44 | 48 | } |
| 45 | 49 | print '</div>'; |
@@ -9,7 +9,9 @@ discard block |
||
| 9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
| 10 | 10 | exec("ps ux", $output, $result); |
| 11 | 11 | $j = 0; |
| 12 | - foreach ($output as $line) if(strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
| 12 | + foreach ($output as $line) { |
|
| 13 | + if(strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
| 14 | + } |
|
| 13 | 15 | if ($j > 1) { |
| 14 | 16 | echo "Script is already runnning..."; |
| 15 | 17 | die(); |
@@ -29,14 +31,18 @@ discard block |
||
| 29 | 31 | $update_db->update_notam(); |
| 30 | 32 | } |
| 31 | 33 | $update_db->insert_last_notam_update(); |
| 32 | - } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) echo "NOTAM are only updated once a day.\n"; |
|
| 34 | + } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) { |
|
| 35 | + echo "NOTAM are only updated once a day.\n"; |
|
| 36 | + } |
|
| 33 | 37 | if ($update_db->check_last_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
| 34 | 38 | $update_db->update_all(); |
| 35 | 39 | // require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
| 36 | 40 | // $Spotter = new Spotter(); |
| 37 | 41 | // $Spotter->updateFieldsFromOtherTables(); |
| 38 | 42 | $update_db->insert_last_update(); |
| 39 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
| 43 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) { |
|
| 44 | + echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
| 45 | + } |
|
| 40 | 46 | if (isset($globalWaypoints) && $globalWaypoints && $update_db->check_last_airspace_update()) { |
| 41 | 47 | echo "Check if new airspace version exist..."; |
| 42 | 48 | echo $update_db->update_airspace_fam(); |
@@ -51,7 +57,9 @@ discard block |
||
| 51 | 57 | $update_db->delete_duplicateowner(); |
| 52 | 58 | } |
| 53 | 59 | $update_db->insert_last_owner_update(); |
| 54 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Owner are only updated every 15 days.\n"; |
|
| 60 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
| 61 | + echo "Owner are only updated every 15 days.\n"; |
|
| 62 | + } |
|
| 55 | 63 | |
| 56 | 64 | if (isset($globalAccidents) && $globalAccidents && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
| 57 | 65 | require_once(dirname(__FILE__).'/../require/class.Accident.php'); |
@@ -60,7 +68,9 @@ discard block |
||
| 60 | 68 | if ($Accident->check_last_accidents_update()) { |
| 61 | 69 | $Accident->download_update(); |
| 62 | 70 | $Accident->insert_last_accidents_update(); |
| 63 | - } else echo "Accidents are updated once a day.\n"; |
|
| 71 | + } else { |
|
| 72 | + echo "Accidents are updated once a day.\n"; |
|
| 73 | + } |
|
| 64 | 74 | } |
| 65 | 75 | |
| 66 | 76 | } |
@@ -73,15 +83,19 @@ discard block |
||
| 73 | 83 | if ($METAR->check_last_update()) { |
| 74 | 84 | $METAR->addMETARCycle(); |
| 75 | 85 | $METAR->insert_last_update(); |
| 76 | - } else echo "METAR are only updated every 30 minutes.\n"; |
|
| 77 | -} |
|
| 86 | + } else { |
|
| 87 | + echo "METAR are only updated every 30 minutes.\n"; |
|
| 88 | + } |
|
| 89 | + } |
|
| 78 | 90 | |
| 79 | 91 | if (isset($globalSchedules) && $globalSchedules && $update_db->check_last_schedules_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
| 80 | 92 | echo "Updating schedules..."; |
| 81 | 93 | //$update_db->update_oneworld(); |
| 82 | 94 | $update_db->update_skyteam(); |
| 83 | 95 | $update_db->insert_last_schedules_update(); |
| 84 | -} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Schedules are only updated every 15 days.\n"; |
|
| 96 | +} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
| 97 | + echo "Schedules are only updated every 15 days.\n"; |
|
| 98 | +} |
|
| 85 | 99 | |
| 86 | 100 | if (isset($globalArchiveMonths) && $globalArchiveMonths > 0) { |
| 87 | 101 | echo "Updating statistics and archive old data..."; |