@@ -37,8 +37,12 @@ discard block |
||
| 37 | 37 | $year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
| 38 | 38 | $month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
| 39 | 39 | $filter = array(); |
| 40 | - if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
| 41 | - if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
| 40 | + if ($year != '') { |
|
| 41 | + $filter = array_merge($filter,array('year' => $year)); |
|
| 42 | + } |
|
| 43 | + if ($month != '') { |
|
| 44 | + $filter = array_merge($filter,array('month' => $month)); |
|
| 45 | + } |
|
| 42 | 46 | if ($sort != '') |
| 43 | 47 | { |
| 44 | 48 | $spotter_array = $Spotter->getSpotterDataByPilot($pilot,$limit_start.",".$absolute_difference, $sort,$filter); |
@@ -56,8 +60,12 @@ discard block |
||
| 56 | 60 | { |
| 57 | 61 | $title = sprintf(_("Detailed View for %s"),$spotter_array[0]['pilot_name']); |
| 58 | 62 | $ident = $spotter_array[0]['ident']; |
| 59 | - if (isset($spotter_array[0]['latitude'])) $latitude = $spotter_array[0]['latitude']; |
|
| 60 | - if (isset($spotter_array[0]['longitude'])) $longitude = $spotter_array[0]['longitude']; |
|
| 63 | + if (isset($spotter_array[0]['latitude'])) { |
|
| 64 | + $latitude = $spotter_array[0]['latitude']; |
|
| 65 | + } |
|
| 66 | + if (isset($spotter_array[0]['longitude'])) { |
|
| 67 | + $longitude = $spotter_array[0]['longitude']; |
|
| 68 | + } |
|
| 61 | 69 | require_once('header.php'); |
| 62 | 70 | /* |
| 63 | 71 | if (isset($globalArchive) && $globalArchive) { |
@@ -110,12 +118,18 @@ discard block |
||
| 110 | 118 | */ |
| 111 | 119 | print '<div class="info column">'; |
| 112 | 120 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
| 113 | - if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
| 121 | + if (isset($spotter_array[0]['pilot_id']) && $spotter_array[0]['pilot_id'] != '') { |
|
| 122 | + print '<div><span class="label">'._("Pilot ID").'</span>'.$spotter_array[0]['pilot_id'].'</div>'; |
|
| 123 | + } |
|
| 114 | 124 | if ($year == '' && $month == '') { |
| 115 | 125 | $Stats = new Stats(); |
| 116 | 126 | $flights = $Stats->getStatsPilot($pilot); |
| 117 | - } else $flights = 0; |
|
| 118 | - if ($flights == 0) $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
| 127 | + } else { |
|
| 128 | + $flights = 0; |
|
| 129 | + } |
|
| 130 | + if ($flights == 0) { |
|
| 131 | + $flights = $Spotter->countFlightsByPilot($pilot,$filter); |
|
| 132 | + } |
|
| 119 | 133 | print '<div><span class="label">'._("Flights").'</span>'.$flights.'</div>'; |
| 120 | 134 | $aircraft_type = count($Spotter->countAllAircraftTypesByPilot($pilot,$filter)); |
| 121 | 135 | print '<div><span class="label">'._("Aircrafts type").'</span>'.$aircraft_type.'</div>'; |
@@ -126,7 +140,9 @@ discard block |
||
| 126 | 140 | $airlines = count($Spotter->countAllAirlinesByPilot($pilot,$filter)); |
| 127 | 141 | print '<div><span class="label">'._("Airlines").'</span>'.$airlines.'</div>'; |
| 128 | 142 | $duration = $Spotter->getFlightDurationByPilot($pilot,$filter); |
| 129 | - if ($duration != '0') print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
| 143 | + if ($duration != '0') { |
|
| 144 | + print '<div><span class="label">'._("Total flights spotted duration").'</span>'.$duration.'</div>'; |
|
| 145 | + } |
|
| 130 | 146 | print '</div>'; |
| 131 | 147 | |
| 132 | 148 | include('pilot-sub-menu.php'); |