@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
| 10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Departure Airports of %s"),$spotter_array[0]['ident']); |
|
| 16 | + $title = sprintf(_("Most Common Departure Airports of %s"), $spotter_array[0]['ident']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | include('ident-sub-menu.php'); |
| 25 | 25 | print '<div class="column">'; |
| 26 | 26 | print '<h2>'._("Most Common Departure Airports").'</h2>'; |
| 27 | - print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 27 | + print '<p>'.sprintf(_("The statistic below shows all departure airports of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 28 | 28 | $airport_airport_array = $Spotter->countAllDepartureAirportsByIdent($ident); |
| 29 | 29 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script> |
| 30 | 30 | <script> |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ["'._("Airport").'", "'._("# of times").'"],'; |
| 40 | 40 | |
| 41 | 41 | $airport_data = ''; |
| 42 | - foreach($airport_airport_array as $airport_item) |
|
| 42 | + foreach ($airport_airport_array as $airport_item) |
|
| 43 | 43 | { |
| 44 | 44 | $name = $airport_item['airport_departure_city'].', '.$airport_item['airport_departure_country'].' ('.$airport_item['airport_departure_icao'].')'; |
| 45 | 45 | $name = str_replace("'", "", $name); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | print '</thead>'; |
| 79 | 79 | print '<tbody>'; |
| 80 | 80 | $i = 1; |
| 81 | - foreach($airport_airport_array as $airport_item) |
|
| 81 | + foreach ($airport_airport_array as $airport_item) |
|
| 82 | 82 | { |
| 83 | 83 | print '<tr>'; |
| 84 | 84 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['ident'])) { |
| 6 | - header('Location: '.$globalURL.'/ident'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/ident'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | $page_url = $globalURL.'/tools-notam'; |
| 12 | 12 | |
| 13 | -$message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING); |
|
| 13 | +$message = filter_input(INPUT_POST, 'notam_message', FILTER_SANITIZE_STRING); |
|
| 14 | 14 | |
| 15 | 15 | print '<div class="info column">'; |
| 16 | 16 | print '<h1>'._("Parse NOTAM messages").'</h1>'; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | if (!empty($notam_parse)) { |
| 35 | 35 | print '<p>'._("NOTAM message in human readable format:").'</p>'; |
| 36 | 36 | foreach ($notam_parse as $key => $value) { |
| 37 | - print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />'; |
|
| 37 | + print '<b>'.strtoupper(str_replace('_', ' ', $key)).'</b>: '.$value.'<br />'; |
|
| 38 | 38 | } |
| 39 | 39 | } else { |
| 40 | 40 | print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>'; |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<fieldset class="form-group">'; |
| 24 | 24 | print '<label for="notam_message">'._("NOTAM Message").'</label>'; |
| 25 | 25 | print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">'; |
| 26 | -if ($message != '') print $message; |
|
| 26 | +if ($message != '') { |
|
| 27 | + print $message; |
|
| 28 | +} |
|
| 27 | 29 | print '</textarea>'; |
| 28 | 30 | print '</fieldset>'; |
| 29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | header('Location: '.$globalURL.'/aircraft'); |
| 9 | 9 | die(); |
| 10 | 10 | } |
| 11 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
| 12 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
| 11 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | if (!empty($spotter_array)) |
| 16 | 16 | { |
| 17 | - $title = sprintf(_("Most Common Airlines by Country from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
| 17 | + $title = sprintf(_("Most Common Airlines by Country from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
| 18 | 18 | require_once('header.php'); |
| 19 | 19 | |
| 20 | 20 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $aircraft_types = $Spotter->getAllAircraftTypes(); |
| 25 | - foreach($aircraft_types as $aircrafttype) |
|
| 25 | + foreach ($aircraft_types as $aircrafttype) |
|
| 26 | 26 | { |
| 27 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 27 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 28 | 28 | { |
| 29 | 29 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
| 30 | 30 | } else { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | include('aircraft-sub-menu.php'); |
| 51 | 51 | print '<div class="column">'; |
| 52 | 52 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
| 53 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
| 53 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
| 54 | 54 | |
| 55 | 55 | $airline_array = $Spotter->countAllAirlineCountriesByAircraft($aircraft_type); |
| 56 | 56 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | var data = google.visualization.arrayToDataTable([ |
| 63 | 63 | ["Country", "# of times"], '; |
| 64 | 64 | $country_data = ''; |
| 65 | - foreach($airline_array as $airline_item) |
|
| 65 | + foreach ($airline_array as $airline_item) |
|
| 66 | 66 | { |
| 67 | 67 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
| 68 | 68 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | print '</thead>'; |
| 94 | 94 | print '<tbody>'; |
| 95 | 95 | $i = 1; |
| 96 | - foreach($airline_array as $airline_item) |
|
| 96 | + foreach ($airline_array as $airline_item) |
|
| 97 | 97 | { |
| 98 | 98 | print '<tr>'; |
| 99 | 99 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | print '<div class="select-item">'; |
| 22 | 22 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
| 23 | 23 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
| 24 | - print '<option></option>'; |
|
| 25 | - $Stats = new Stats(); |
|
| 26 | - $aircraft_types = $Stats->getAllAircraftTypes(); |
|
| 27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 28 | - foreach($aircraft_types as $aircrafttype) |
|
| 29 | - { |
|
| 30 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 31 | - { |
|
| 32 | - print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
| 33 | - } else { |
|
| 34 | - print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
| 35 | - } |
|
| 24 | + print '<option></option>'; |
|
| 25 | + $Stats = new Stats(); |
|
| 26 | + $aircraft_types = $Stats->getAllAircraftTypes(); |
|
| 27 | + if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 28 | + foreach($aircraft_types as $aircrafttype) |
|
| 29 | + { |
|
| 30 | + if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
| 31 | + { |
|
| 32 | + print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
| 33 | + } else { |
|
| 34 | + print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
| 35 | + } |
|
| 36 | 36 | } |
| 37 | 37 | print '</select>'; |
| 38 | 38 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | function drawChart() { |
| 65 | 65 | var data = google.visualization.arrayToDataTable([ |
| 66 | 66 | ["Country", "# of times"], '; |
| 67 | - $country_data = ''; |
|
| 67 | + $country_data = ''; |
|
| 68 | 68 | foreach($airline_array as $airline_item) |
| 69 | 69 | { |
| 70 | 70 | $country_data .= '[ "'.$airline_item['airline_country'].'",'.$airline_item['airline_country_count'].'],'; |
@@ -24,7 +24,9 @@ |
||
| 24 | 24 | print '<option></option>'; |
| 25 | 25 | $Stats = new Stats(); |
| 26 | 26 | $aircraft_types = $Stats->getAllAircraftTypes(); |
| 27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 27 | + if (empty($aircraft_types)) { |
|
| 28 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
| 29 | + } |
|
| 28 | 30 | foreach($aircraft_types as $aircrafttype) |
| 29 | 31 | { |
| 30 | 32 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -63,7 +63,10 @@ |
||
| 63 | 63 | imagedestroy($image); |
| 64 | 64 | } else { |
| 65 | 65 | header('Content-type: image/png'); |
| 66 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 67 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 68 | -} |
|
| 66 | + if ($color == 'FF0000') { |
|
| 67 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 68 | + } else { |
|
| 69 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 70 | + } |
|
| 71 | + } |
|
| 69 | 72 | ?> |
| 70 | 73 | \ No newline at end of file |
@@ -4,88 +4,88 @@ |
||
| 4 | 4 | $hex = str_replace("#", "", $hex); |
| 5 | 5 | $color = array(); |
| 6 | 6 | if (strlen($hex) == 3) { |
| 7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
| 8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
| 9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
| 7 | + $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
| 8 | + $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
| 9 | + $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
| 10 | 10 | } else if (strlen($hex) == 6) { |
| 11 | - $color['r'] = hexdec(substr($hex, 0, 2)); |
|
| 12 | - $color['g'] = hexdec(substr($hex, 2, 2)); |
|
| 13 | - $color['b'] = hexdec(substr($hex, 4, 2)); |
|
| 11 | + $color['r'] = hexdec(substr($hex, 0, 2)); |
|
| 12 | + $color['g'] = hexdec(substr($hex, 2, 2)); |
|
| 13 | + $color['b'] = hexdec(substr($hex, 4, 2)); |
|
| 14 | 14 | } |
| 15 | 15 | return $color; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
| 20 | - exit(0); |
|
| 20 | + exit(0); |
|
| 21 | 21 | } |
| 22 | 22 | $color = $_GET['color']; |
| 23 | 23 | if (!isset($_GET['filename']) || !preg_match('/^[a-z0-9-_]+\.png$/', strtolower($_GET['filename']))) { |
| 24 | - echo "Incorrect filename"; |
|
| 25 | - exit(0); |
|
| 24 | + echo "Incorrect filename"; |
|
| 25 | + exit(0); |
|
| 26 | 26 | } |
| 27 | 27 | $filename = $_GET['filename']; |
| 28 | 28 | if (file_exists(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename)) { |
| 29 | - header('Content-type: image/png'); |
|
| 30 | - readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
| 31 | - exit(0); |
|
| 29 | + header('Content-type: image/png'); |
|
| 30 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.$color.'-'.$filename); |
|
| 31 | + exit(0); |
|
| 32 | 32 | } |
| 33 | 33 | $original = dirname(__FILE__).DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'aircrafts'.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.$filename; |
| 34 | 34 | if (!file_exists($original)) { |
| 35 | - echo "File not found"; |
|
| 35 | + echo "File not found"; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 39 | - $image = imagecreatefrompng($original); |
|
| 40 | - $index = imagecolorexact($image,26,49,81); |
|
| 41 | - if ($index < 0) { |
|
| 39 | + $image = imagecreatefrompng($original); |
|
| 40 | + $index = imagecolorexact($image,26,49,81); |
|
| 41 | + if ($index < 0) { |
|
| 42 | 42 | $index = imagecolorexact($image,25,49,79); |
| 43 | - } |
|
| 44 | - if ($index < 0) { |
|
| 43 | + } |
|
| 44 | + if ($index < 0) { |
|
| 45 | 45 | $index = imagecolorexact($image,0,0,0); |
| 46 | - } |
|
| 47 | - $c = hexToRGB($color); |
|
| 48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
| 46 | + } |
|
| 47 | + $c = hexToRGB($color); |
|
| 48 | + imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
| 49 | 49 | /* |
| 50 | 50 | $ig = imagecolorat($image, 0, 0); |
| 51 | 51 | imagecolortransparent($image, $ig); |
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | - header('Content-type: image/png'); |
|
| 55 | - if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
|
| 54 | + header('Content-type: image/png'); |
|
| 55 | + if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
|
| 56 | 56 | $resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT); |
| 57 | 57 | $newimg = imagecreatetruecolor($resize,$resize); |
| 58 | - imagealphablending($newimg, false); |
|
| 58 | + imagealphablending($newimg, false); |
|
| 59 | 59 | imagesavealpha($newimg, true); |
| 60 | 60 | imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image)); |
| 61 | 61 | if (isset($_GET['heading'])) { |
| 62 | - $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
| 63 | - $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
| 64 | - imagealphablending($rotation, false); |
|
| 65 | - imagesavealpha($rotation, true); |
|
| 66 | - imagepng($rotation); |
|
| 67 | - imagedestroy($newimg); |
|
| 68 | - imagedestroy($image); |
|
| 69 | - imagedestroy($rotation); |
|
| 62 | + $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
| 63 | + $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
| 64 | + imagealphablending($rotation, false); |
|
| 65 | + imagesavealpha($rotation, true); |
|
| 66 | + imagepng($rotation); |
|
| 67 | + imagedestroy($newimg); |
|
| 68 | + imagedestroy($image); |
|
| 69 | + imagedestroy($rotation); |
|
| 70 | 70 | |
| 71 | 71 | } else { |
| 72 | - imagepng($newimg); |
|
| 73 | - imagedestroy($newimg); |
|
| 74 | - imagedestroy($image); |
|
| 75 | - } |
|
| 76 | - } else { |
|
| 72 | + imagepng($newimg); |
|
| 73 | + imagedestroy($newimg); |
|
| 74 | + imagedestroy($image); |
|
| 75 | + } |
|
| 76 | + } else { |
|
| 77 | 77 | imagealphablending($image, false); |
| 78 | - imagesavealpha($image, true); |
|
| 78 | + imagesavealpha($image, true); |
|
| 79 | 79 | imagepng($image); |
| 80 | 80 | imagepng($image); |
| 81 | 81 | if (is_writable('cache')) { |
| 82 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
| 82 | + imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
| 83 | + } |
|
| 84 | + imagedestroy($image); |
|
| 83 | 85 | } |
| 84 | - imagedestroy($image); |
|
| 85 | - } |
|
| 86 | 86 | } else { |
| 87 | - header('Content-type: image/png'); |
|
| 88 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 89 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 87 | + header('Content-type: image/png'); |
|
| 88 | + if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 89 | + else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 90 | 90 | } |
| 91 | 91 | ?> |
| 92 | 92 | \ No newline at end of file |
@@ -4,9 +4,9 @@ discard block |
||
| 4 | 4 | $hex = str_replace("#", "", $hex); |
| 5 | 5 | $color = array(); |
| 6 | 6 | if (strlen($hex) == 3) { |
| 7 | - $color['r'] = hexdec(substr($hex, 0, 1) . substr($hex,0,1)); |
|
| 8 | - $color['g'] = hexdec(substr($hex, 1, 1) . substr($hex,1,1)); |
|
| 9 | - $color['b'] = hexdec(substr($hex, 2, 1) . substr($hex,2,1)); |
|
| 7 | + $color['r'] = hexdec(substr($hex, 0, 1).substr($hex, 0, 1)); |
|
| 8 | + $color['g'] = hexdec(substr($hex, 1, 1).substr($hex, 1, 1)); |
|
| 9 | + $color['b'] = hexdec(substr($hex, 2, 1).substr($hex, 2, 1)); |
|
| 10 | 10 | } else if (strlen($hex) == 6) { |
| 11 | 11 | $color['r'] = hexdec(substr($hex, 0, 2)); |
| 12 | 12 | $color['g'] = hexdec(substr($hex, 2, 2)); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | -if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/',$_GET['color'])) { |
|
| 19 | +if (!isset($_GET['color']) || $_GET['color'] == '' || !preg_match('/^([a-fA-F0-9]){3}(([a-fA-F0-9]){3})?\b/', $_GET['color'])) { |
|
| 20 | 20 | exit(0); |
| 21 | 21 | } |
| 22 | 22 | $color = $_GET['color']; |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if (extension_loaded('gd') && function_exists('gd_info')) { |
| 39 | 39 | $image = imagecreatefrompng($original); |
| 40 | - $index = imagecolorexact($image,26,49,81); |
|
| 40 | + $index = imagecolorexact($image, 26, 49, 81); |
|
| 41 | 41 | if ($index < 0) { |
| 42 | - $index = imagecolorexact($image,25,49,79); |
|
| 42 | + $index = imagecolorexact($image, 25, 49, 79); |
|
| 43 | 43 | } |
| 44 | 44 | if ($index < 0) { |
| 45 | - $index = imagecolorexact($image,0,0,0); |
|
| 45 | + $index = imagecolorexact($image, 0, 0, 0); |
|
| 46 | 46 | } |
| 47 | 47 | $c = hexToRGB($color); |
| 48 | - imagecolorset($image,$index,$c['r'],$c['g'],$c['b']); |
|
| 48 | + imagecolorset($image, $index, $c['r'], $c['g'], $c['b']); |
|
| 49 | 49 | /* |
| 50 | 50 | $ig = imagecolorat($image, 0, 0); |
| 51 | 51 | imagecolortransparent($image, $ig); |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | header('Content-type: image/png'); |
| 55 | 55 | if (isset($_GET['resize']) && function_exists('imagecopyresampled')) { |
| 56 | - $resize = filter_input(INPUT_GET,'resize',FILTER_SANITIZE_NUMBER_INT); |
|
| 57 | - $newimg = imagecreatetruecolor($resize,$resize); |
|
| 56 | + $resize = filter_input(INPUT_GET, 'resize', FILTER_SANITIZE_NUMBER_INT); |
|
| 57 | + $newimg = imagecreatetruecolor($resize, $resize); |
|
| 58 | 58 | imagealphablending($newimg, false); |
| 59 | 59 | imagesavealpha($newimg, true); |
| 60 | - imagecopyresampled($newimg,$image,0,0,0,0,15,15,imagesx($image),imagesy($image)); |
|
| 60 | + imagecopyresampled($newimg, $image, 0, 0, 0, 0, 15, 15, imagesx($image), imagesy($image)); |
|
| 61 | 61 | if (isset($_GET['heading'])) { |
| 62 | - $heading = filter_input(INPUT_GET,'heading',FILTER_SANITIZE_NUMBER_INT); |
|
| 63 | - $rotation = imagerotate($newimg,$heading,imageColorAllocateAlpha($newimg,0,0,0,127)); |
|
| 62 | + $heading = filter_input(INPUT_GET, 'heading', FILTER_SANITIZE_NUMBER_INT); |
|
| 63 | + $rotation = imagerotate($newimg, $heading, imageColorAllocateAlpha($newimg, 0, 0, 0, 127)); |
|
| 64 | 64 | imagealphablending($rotation, false); |
| 65 | 65 | imagesavealpha($rotation, true); |
| 66 | 66 | imagepng($rotation); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | imagepng($image); |
| 80 | 80 | imagepng($image); |
| 81 | 81 | if (is_writable('cache')) { |
| 82 | - imagepng($image,dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
| 82 | + imagepng($image, dirname(__FILE__).DIRECTORY_SEPARATOR.'cache/'.$color.'-'.$filename); |
|
| 83 | 83 | } |
| 84 | 84 | imagedestroy($image); |
| 85 | 85 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | $output = '{'; |
| 11 | 11 | $output .= '"flights": ['; |
| 12 | 12 | if (!empty($spotter_array)) { |
| 13 | - foreach($spotter_array as $spotter_item) |
|
| 13 | + foreach ($spotter_array as $spotter_item) |
|
| 14 | 14 | { |
| 15 | 15 | $output .= '{'; |
| 16 | 16 | $output .= '"flight_id": "'.$spotter_item['spotter_id'].'",'; |
@@ -3,17 +3,17 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | |
| 6 | -if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])){ |
|
| 6 | +if (!isset($_GET['departure_airport']) || !isset($_GET['arrival_airport'])) { |
|
| 7 | 7 | header('Location: '.$globalURL.''); |
| 8 | 8 | } else { |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | //calculuation for the pagination |
| 11 | - if(!isset($_GET['limit'])) |
|
| 11 | + if (!isset($_GET['limit'])) |
|
| 12 | 12 | { |
| 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]; |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
| 28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
| 29 | 29 | |
| 30 | - $departure_airport = filter_input(INPUT_POST,'departure_airport',FILTER_SANITIZE_STRING); |
|
| 31 | - $arrival_airport = filter_input(INPUT_POST,'arrival_airport',FILTER_SANITIZE_STRING); |
|
| 30 | + $departure_airport = filter_input(INPUT_POST, 'departure_airport', FILTER_SANITIZE_STRING); |
|
| 31 | + $arrival_airport = filter_input(INPUT_POST, 'arrival_airport', FILTER_SANITIZE_STRING); |
|
| 32 | 32 | $page_url = $globalURL.'/route/'.$departure_airport.'/'.$arrival_airport; |
| 33 | 33 | |
| 34 | 34 | if (isset($_GET['sort'])) { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | if (!empty($spotter_array)) |
| 41 | 41 | { |
| 42 | - $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"),$spotter_array[0]['departure_airport_name'],$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['departure_airport_country'],$spotter_array[0]['arrival_airport_name'],$spotter_array[0]['arrival_airport_icao'],$spotter_array[0]['arrival_airport_country']); |
|
| 42 | + $title = sprintf(_("Detailed View for flights between %s (%s), %s - %s (%s), %s"), $spotter_array[0]['departure_airport_name'], $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['departure_airport_country'], $spotter_array[0]['arrival_airport_name'], $spotter_array[0]['arrival_airport_icao'], $spotter_array[0]['arrival_airport_country']); |
|
| 43 | 43 | require_once('header.php'); |
| 44 | 44 | print '<div class="info column">'; |
| 45 | 45 | print '<h1>'._("Flights between").' '.$spotter_array[0]['departure_airport_name'].' ('.$spotter_array[0]['departure_airport_icao'].'), '.$spotter_array[0]['departure_airport_country'].' - '.$spotter_array[0]['arrival_airport_name'].' ('.$spotter_array[0]['arrival_airport_icao'].'), '.$spotter_array[0]['arrival_airport_country'].'</h1>'; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | include('route-sub-menu.php'); |
| 51 | 51 | print '<div class="table column">'; |
| 52 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."),$spotter_array[0]['departure_airport_icao'],$spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
| 52 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights that used the route <strong>%s - %s</strong>."), $spotter_array[0]['departure_airport_icao'], $spotter_array[0]['arrival_airport_icao']).'</p>'; |
|
| 53 | 53 | |
| 54 | 54 | include('table-output.php'); |
| 55 | 55 | print '<div class="pagination">'; |
@@ -13,7 +13,7 @@ |
||
| 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]; |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
| 12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
| 10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
| 12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
| 13 | 13 | |
| 14 | 14 | if (!empty($spotter_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Routes of %s"),$spotter_array[0]['ident']); |
|
| 16 | + $title = sprintf(_("Most Common Routes of %s"), $spotter_array[0]['ident']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="info column">'; |
| 19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | include('ident-sub-menu.php'); |
| 25 | 25 | print '<div class="column">'; |
| 26 | 26 | print '<h2>'._("Most Common Routes").'</h2>'; |
| 27 | - print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
| 27 | + print '<p>'.sprintf(_("The statistic below shows the most common routes from flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
| 28 | 28 | |
| 29 | 29 | $route_array = $Spotter->countAllRoutesByIdent($ident); |
| 30 | 30 | if (!empty($route_array)) |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | print '</thead>'; |
| 42 | 42 | print '<tbody>'; |
| 43 | 43 | $i = 1; |
| 44 | - foreach($route_array as $route_item) |
|
| 44 | + foreach ($route_array as $route_item) |
|
| 45 | 45 | { |
| 46 | 46 | print '<tr>'; |
| 47 | 47 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['ident'])) { |
| 6 | - header('Location: '.$globalURL.'/ident'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/ident'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
@@ -6,14 +6,14 @@ discard block |
||
| 6 | 6 | header('Location: '.$globalURL.'/airport'); |
| 7 | 7 | die(); |
| 8 | 8 | } |
| 9 | -$airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
|
| 9 | +$airport = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING); |
|
| 10 | 10 | $Spotter = new Spotter(); |
| 11 | -$spotter_array = $Spotter->getSpotterDataByAirport($airport,"0,1",""); |
|
| 11 | +$spotter_array = $Spotter->getSpotterDataByAirport($airport, "0,1", ""); |
|
| 12 | 12 | $airport_array = $Spotter->getAllAirportInfo($airport); |
| 13 | 13 | |
| 14 | 14 | if (!empty($airport_array)) |
| 15 | 15 | { |
| 16 | - $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']); |
|
| 16 | + $title = sprintf(_("Most Common Arrival Airports by Country from %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']); |
|
| 17 | 17 | require_once('header.php'); |
| 18 | 18 | print '<div class="select-item">'; |
| 19 | 19 | print '<form action="'.$globalURL.'/airport" method="post">'; |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | print '<option></option>'; |
| 22 | 22 | $airport_names = $Spotter->getAllAirportNames(); |
| 23 | 23 | ksort($airport_names); |
| 24 | - foreach($airport_names as $airport_name) |
|
| 24 | + foreach ($airport_names as $airport_name) |
|
| 25 | 25 | { |
| 26 | - if($airport == $airport_name['airport_icao']) |
|
| 26 | + if ($airport == $airport_name['airport_icao']) |
|
| 27 | 27 | { |
| 28 | 28 | print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>'; |
| 29 | 29 | } else { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | include('airport-sub-menu.php'); |
| 55 | 55 | print '<div class="column">'; |
| 56 | 56 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
| 57 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>'; |
|
| 57 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>'; |
|
| 58 | 58 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByAirport($airport); |
| 59 | 59 | print '<script type="text/javascript" src="https://www.google.com/jsapi"></script>'; |
| 60 | 60 | print '<div id="chartCountry" class="chart" width="100%"></div> |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | var data = google.visualization.arrayToDataTable([ |
| 66 | 66 | ["'._("Country").'", "'._("# of times").'"], '; |
| 67 | 67 | $country_data = ''; |
| 68 | - foreach($airport_country_array as $airport_item) |
|
| 68 | + foreach ($airport_country_array as $airport_item) |
|
| 69 | 69 | { |
| 70 | 70 | $country_data .= '[ "'.$airport_item['arrival_airport_country'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
| 71 | 71 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | print '</thead>'; |
| 100 | 100 | print '<tbody>'; |
| 101 | 101 | $i = 1; |
| 102 | - foreach($airport_country_array as $airport_item) |
|
| 102 | + foreach ($airport_country_array as $airport_item) |
|
| 103 | 103 | { |
| 104 | 104 | print '<tr>'; |
| 105 | 105 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | if (!isset($_GET['airport'])) { |
| 6 | - header('Location: '.$globalURL.'/airport'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/airport'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $airport = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING); |
| 10 | 10 | $Spotter = new Spotter(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | function drawChart() { |
| 66 | 66 | var data = google.visualization.arrayToDataTable([ |
| 67 | 67 | ["'._("Country").'", "'._("# of times").'"], '; |
| 68 | - $country_data = ''; |
|
| 68 | + $country_data = ''; |
|
| 69 | 69 | foreach($airport_country_array as $airport_item) |
| 70 | 70 | { |
| 71 | 71 | $country_data .= '[ "'.$airport_item['departure_airport_country'].'",'.$airport_item['airport_departure_country_count'].'],'; |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<option></option>'; |
| 24 | 24 | $Stats = new Stats(); |
| 25 | 25 | $airport_names = $tats->getAllAirportNames(); |
| 26 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
| 26 | + if (empty($airport_names)) { |
|
| 27 | + $airport_names = $Spotter->getAllAirportNames(); |
|
| 28 | + } |
|
| 27 | 29 | ksort($airport_names); |
| 28 | 30 | foreach($airport_names as $airport_name) |
| 29 | 31 | { |
@@ -3,13 +3,13 @@ discard block |
||
| 3 | 3 | require_once('require/class.Spotter.php'); |
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
| 7 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
| 7 | +if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'], "0,1", $sort); |
|
| 8 | 8 | else $spotter_array = array(); |
| 9 | 9 | |
| 10 | 10 | if (!empty($spotter_array)) |
| 11 | 11 | { |
| 12 | - $title = sprintf(_("Most Common Aircraft on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 12 | + $title = sprintf(_("Most Common Aircraft on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
| 13 | 13 | require_once('header.php'); |
| 14 | 14 | print '<div class="select-item">'; |
| 15 | 15 | print '<form action="'.$globalURL.'/date" method="post">'; |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | print '</div>'; |
| 21 | 21 | |
| 22 | 22 | print '<div class="info column">'; |
| 23 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 23 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
| 24 | 24 | print '</div>'; |
| 25 | 25 | |
| 26 | 26 | include('date-sub-menu.php'); |
| 27 | 27 | print '<div class="column">'; |
| 28 | 28 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
| 29 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 29 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
| 30 | 30 | |
| 31 | 31 | $aircraft_array = $Spotter->countAllAircraftTypesByDate($_GET['date']); |
| 32 | 32 | if (!empty($aircraft_array)) |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | print '</thead>'; |
| 42 | 42 | print '<tbody>'; |
| 43 | 43 | $i = 1; |
| 44 | - foreach($aircraft_array as $aircraft_item) |
|
| 44 | + foreach ($aircraft_array as $aircraft_item) |
|
| 45 | 45 | { |
| 46 | 46 | print '<tr>'; |
| 47 | 47 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,11 @@ |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
| 7 | -if (isset($_GET['date'])) $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 8 | -else $spotter_array = array(); |
|
| 7 | +if (isset($_GET['date'])) { |
|
| 8 | + $spotter_array = $Spotter->getSpotterDataByDate($_GET['date'],"0,1", $sort); |
|
| 9 | +} else { |
|
| 10 | + $spotter_array = array(); |
|
| 11 | +} |
|
| 9 | 12 | |
| 10 | 13 | if (!empty($spotter_array)) |
| 11 | 14 | { |