@@ -11,7 +11,9 @@ discard block |
||
| 11 | 11 | $lines = file($filename); |
| 12 | 12 | foreach ($lines as $line) |
| 13 | 13 | { |
| 14 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
| 14 | + if (substr($line,0,2) == '--' || $line == '') { |
|
| 15 | + continue; |
|
| 16 | + } |
|
| 15 | 17 | $templine .= $line; |
| 16 | 18 | if (substr(trim($line), -1,1) == ';') |
| 17 | 19 | { |
@@ -35,7 +37,9 @@ discard block |
||
| 35 | 37 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
| 36 | 38 | while(false !== ($filename = readdir($dh))) |
| 37 | 39 | { |
| 38 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
| 40 | + if (preg_match('/\.sql$/',$filename)) { |
|
| 41 | + $error .= create_db::import_file($directory.$filename); |
|
| 42 | + } |
|
| 39 | 43 | } |
| 40 | 44 | return $error; |
| 41 | 45 | } |
@@ -51,13 +55,17 @@ discard block |
||
| 51 | 55 | // Dirty hack |
| 52 | 56 | if ($host != 'localhost' && $host != '127.0.0.1') { |
| 53 | 57 | $grantright = $_SERVER['SERVER_ADDR']; |
| 54 | - } else $grantright = 'localhost'; |
|
| 58 | + } else { |
|
| 59 | + $grantright = 'localhost'; |
|
| 60 | + } |
|
| 55 | 61 | try { |
| 56 | 62 | $dbh = new PDO($db_type.':host='.$host,$root,$root_pass); |
| 57 | 63 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 58 | 64 | if ($db_type == 'mysql') { |
| 59 | 65 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
| 60 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 66 | + if ($grantright == 'localhost') { |
|
| 67 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
| 68 | + } |
|
| 61 | 69 | } else if ($db_type == 'pgsql') { |
| 62 | 70 | $dbh->exec("CREATE DATABASE ".$db.";"); |
| 63 | 71 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -215,14 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | $r = null; |
| 217 | 217 | |
| 218 | - if( $code == "select" ) { $r = $this->test_select(); } |
|
| 219 | - elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } |
|
| 220 | - elseif( $code == "math_as" ) { $r = $this->test_math_as(); } |
|
| 221 | - elseif( $code == "count" ) { $r = $this->test_count(); } |
|
| 222 | - elseif( $code == "max" ) { $r = $this->test_max(); } |
|
| 223 | - elseif( $code == "load" ) { $r = $this->test_load(); } |
|
| 224 | - elseif( $code == "sample" ) { $r = $this->test_sample(); } |
|
| 225 | - else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 218 | + if( $code == "select" ) { $r = $this->test_select(); } elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } elseif( $code == "math_as" ) { $r = $this->test_math_as(); } elseif( $code == "count" ) { $r = $this->test_count(); } elseif( $code == "max" ) { $r = $this->test_max(); } elseif( $code == "load" ) { $r = $this->test_load(); } elseif( $code == "sample" ) { $r = $this->test_sample(); } else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 226 | 219 | $this->caps[$code] = $r; |
| 227 | 220 | if( isset( $this->caps_cache ) ) |
| 228 | 221 | { |
@@ -231,8 +224,7 @@ discard block |
||
| 231 | 224 | if( $was_cached ) |
| 232 | 225 | { |
| 233 | 226 | dba_replace( $db_key, $db_val, $this->caps_cache ); |
| 234 | - } |
|
| 235 | - else |
|
| 227 | + } else |
|
| 236 | 228 | { |
| 237 | 229 | dba_insert( $db_key, $db_val, $this->caps_cache ); |
| 238 | 230 | } |
@@ -164,15 +164,21 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 166 | 166 | $_SESSION['install'] = 'vatsim'; |
| 167 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 168 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 167 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 168 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 169 | + } else { |
|
| 170 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 171 | + } |
|
| 169 | 172 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 170 | 173 | $_SESSION['install'] = 'vatsim'; |
| 171 | 174 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 172 | 175 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 173 | 176 | $_SESSION['install'] = 'vatsim'; |
| 174 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 175 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 177 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 178 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 179 | + } else { |
|
| 180 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 181 | + } |
|
| 176 | 182 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 177 | 183 | $_SESSION['install'] = 'vatsim'; |
| 178 | 184 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -303,7 +309,9 @@ discard block |
||
| 303 | 309 | $Source = new Source(); |
| 304 | 310 | $Source->deleteAllLocation(); |
| 305 | 311 | foreach ($sources as $src) { |
| 306 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 312 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
| 313 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 314 | + } |
|
| 307 | 315 | } |
| 308 | 316 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
| 309 | 317 | unset($_SESSION['sources']); |
@@ -314,15 +322,21 @@ discard block |
||
| 314 | 322 | */ |
| 315 | 323 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 316 | 324 | $_SESSION['install'] = 'vatsim'; |
| 317 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 318 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 325 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 326 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 327 | + } else { |
|
| 328 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 329 | + } |
|
| 319 | 330 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 320 | 331 | $_SESSION['install'] = 'vatsim'; |
| 321 | 332 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 322 | 333 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 323 | 334 | $_SESSION['install'] = 'vatsim'; |
| 324 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 325 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 335 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 336 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 337 | + } else { |
|
| 338 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 339 | + } |
|
| 326 | 340 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 327 | 341 | $_SESSION['install'] = 'vatsim'; |
| 328 | 342 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -70,7 +70,9 @@ |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | - if (!isset($array_value)) $array_value = ''; |
|
| 73 | + if (!isset($array_value)) { |
|
| 74 | + $array_value = ''; |
|
| 75 | + } |
|
| 74 | 76 | $replace = "\n".'\$'.$settingname." = array(".$array_value.")"; |
| 75 | 77 | unset($array_value); |
| 76 | 78 | } else { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $limit_start = 0; |
| 16 | 16 | $limit_end = 25; |
| 17 | 17 | $absolute_difference = 25; |
| 18 | - } else { |
|
| 18 | + } else { |
|
| 19 | 19 | $limit_explode = explode(",", $_GET['limit']); |
| 20 | 20 | $limit_start = $limit_explode[0]; |
| 21 | 21 | $limit_end = $limit_explode[1]; |
@@ -45,7 +45,9 @@ discard block |
||
| 45 | 45 | $METAR = new METAR(); |
| 46 | 46 | $metar_info = $METAR->getMETAR($airport_icao); |
| 47 | 47 | //print_r($metar_info); |
| 48 | - if (isset($metar_info[0]['metar'])) $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 48 | + if (isset($metar_info[0]['metar'])) { |
|
| 49 | + $metar_parse = $METAR->parse($metar_info[0]['metar']); |
|
| 50 | + } |
|
| 49 | 51 | //print_r($metar_parse); |
| 50 | 52 | } |
| 51 | 53 | |
@@ -90,7 +92,9 @@ discard block |
||
| 90 | 92 | $all_data = $Stats->getLast7DaysAirports($airport_icao); |
| 91 | 93 | if (isset($globalTimezone)) { |
| 92 | 94 | date_default_timezone_set($globalTimezone); |
| 93 | - } else date_default_timezone_set('UTC'); |
|
| 95 | + } else { |
|
| 96 | + date_default_timezone_set('UTC'); |
|
| 97 | + } |
|
| 94 | 98 | if (count($all_data) > 0) { |
| 95 | 99 | print '<div id="chart6" class="chart" width="100%"></div> |
| 96 | 100 | <script> |
@@ -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>'; |
@@ -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,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 | { |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | $file_path = pathinfo($_SERVER['SCRIPT_NAME']); |
| 6 | 6 | $current_page = $file_path['filename']; |
| 7 | 7 | date_default_timezone_set($globalTimezone); |
| 8 | -if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
| 9 | -else $MapType = $globalMapProvider; |
|
| 8 | +if (isset($_COOKIE['MapType'])) { |
|
| 9 | + $MapType = $_COOKIE['MapType']; |
|
| 10 | +} else { |
|
| 11 | + $MapType = $globalMapProvider; |
|
| 12 | +} |
|
| 10 | 13 | ?> |
| 11 | 14 | <!DOCTYPE html> |
| 12 | 15 | <html> |
@@ -163,7 +166,13 @@ discard block |
||
| 163 | 166 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
| 164 | 167 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 165 | 168 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 166 | -<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 169 | +<script src="<?php print $globalURL; ?>/js/map.js.php?ident=<?php print $ident; ?><?php if(isset($latitude)) { |
|
| 170 | + print '&latitude='.$latitude; |
|
| 171 | +} |
|
| 172 | +?><?php if(isset($longitude)) { |
|
| 173 | + print '&longitude='.$longitude; |
|
| 174 | +} |
|
| 175 | +?>&<?php print time(); ?>"></script> |
|
| 167 | 176 | <?php |
| 168 | 177 | } |
| 169 | 178 | |
@@ -179,7 +188,13 @@ discard block |
||
| 179 | 188 | <script src="<?php print $globalURL; ?>/js/Marker.Rotate.js"></script> |
| 180 | 189 | <script src="<?php print $globalURL; ?>/js/MovingMarker.js"></script> |
| 181 | 190 | <script src="<?php print $globalURL; ?>/js/jquery.idle.min.js"></script> |
| 182 | -<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) print '&latitude='.$latitude; ?><?php if(isset($longitude)) print '&longitude='.$longitude; ?>&<?php print time(); ?>"></script> |
|
| 191 | +<script src="<?php print $globalURL; ?>/js/map.js.php?flightaware_id=<?php print $flightaware_id; ?><?php if(isset($latitude)) { |
|
| 192 | + print '&latitude='.$latitude; |
|
| 193 | +} |
|
| 194 | +?><?php if(isset($longitude)) { |
|
| 195 | + print '&longitude='.$longitude; |
|
| 196 | +} |
|
| 197 | +?>&<?php print time(); ?>"></script> |
|
| 183 | 198 | <?php |
| 184 | 199 | } |
| 185 | 200 | ?> |
@@ -213,7 +228,12 @@ discard block |
||
| 213 | 228 | <span class="icon-bar"></span> |
| 214 | 229 | </button> |
| 215 | 230 | <a href="<?php print $globalURL; ?>/search" class="navbar-toggle navbar-toggle-search"><i class="fa fa-search"></i></a> |
| 216 | - <a class="navbar-brand" href="<?php if ($globalURL == '') print '/'; else print $globalURL; ?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 231 | + <a class="navbar-brand" href="<?php if ($globalURL == '') { |
|
| 232 | + print '/'; |
|
| 233 | +} else { |
|
| 234 | + print $globalURL; |
|
| 235 | +} |
|
| 236 | +?>"><img src="<?php print $globalURL.$logoURL; ?>" height="30px" /></a> |
|
| 217 | 237 | </div> |
| 218 | 238 | <div class="collapse navbar-collapse"> |
| 219 | 239 | <ul class="nav navbar-nav"> |
@@ -291,7 +311,9 @@ discard block |
||
| 291 | 311 | $alllang = $Language->getLanguages(); |
| 292 | 312 | foreach ($alllang as $key => $lang) { |
| 293 | 313 | print '<option value="'.$key.'"'; |
| 294 | - if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) print ' selected '; |
|
| 314 | + if (isset($_COOKIE['language']) && $_COOKIE['language'] == $key) { |
|
| 315 | + print ' selected '; |
|
| 316 | + } |
|
| 295 | 317 | print '>'.$lang[0].'</option>'; |
| 296 | 318 | } |
| 297 | 319 | ?> |
@@ -438,4 +460,7 @@ discard block |
||
| 438 | 460 | |
| 439 | 461 | ?> |
| 440 | 462 | |
| 441 | -<section class="container main-content <?php if (strtolower($current_page) == 'index') print 'index '; ?>clear"> |
|
| 463 | +<section class="container main-content <?php if (strtolower($current_page) == 'index') { |
|
| 464 | + print 'index '; |
|
| 465 | +} |
|
| 466 | +?>clear"> |
|