@@ -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); |
@@ -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); |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | require_once('require/class.Language.php'); |
| 5 | 5 | |
| 6 | 6 | if (!isset($_GET['aircraft_type'])) { |
| 7 | - header('Location: '.$globalURL.'/aircraft'); |
|
| 8 | - die(); |
|
| 7 | + header('Location: '.$globalURL.'/aircraft'); |
|
| 8 | + die(); |
|
| 9 | 9 | } |
| 10 | 10 | $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
| 11 | 11 | $Spotter = new Spotter(); |
@@ -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); |
@@ -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); |
@@ -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['aircraft_manufacturer'])) { |
| 6 | - header('Location: '.$globalURL.'/manufacturer'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/manufacturer'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $manufacturer = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'aircraft_manufacturer',FILTER_SANITIZE_STRING))); |
@@ -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['country'])) { |
| 6 | - header('Location: '.$globalURL.'/country'); |
|
| 7 | - die(); |
|
| 6 | + header('Location: '.$globalURL.'/country'); |
|
| 7 | + die(); |
|
| 8 | 8 | } |
| 9 | 9 | $Spotter = new Spotter(); |
| 10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -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'].'],'; |
@@ -7,18 +7,18 @@ discard block |
||
| 7 | 7 | public $latest_schema = 23; |
| 8 | 8 | |
| 9 | 9 | public function __construct($dbc = null,$dbname = null,$user = null,$pass = null) { |
| 10 | - global $globalDBdriver; |
|
| 11 | - if ($dbc === null) { |
|
| 10 | + global $globalDBdriver; |
|
| 11 | + if ($dbc === null) { |
|
| 12 | 12 | if ($this->db === null && $dbname === null) { |
| 13 | - if ($user === null && $pass === null) { |
|
| 13 | + if ($user === null && $pass === null) { |
|
| 14 | 14 | $this->createDBConnection(); |
| 15 | - } else { |
|
| 15 | + } else { |
|
| 16 | 16 | $this->createDBConnection(null,$user,$pass); |
| 17 | - } |
|
| 17 | + } |
|
| 18 | 18 | } else { |
| 19 | - $this->createDBConnection($dbname); |
|
| 19 | + $this->createDBConnection($dbname); |
|
| 20 | 20 | } |
| 21 | - } elseif ($dbname === null || $dbname === 'default') { |
|
| 21 | + } elseif ($dbname === null || $dbname === 'default') { |
|
| 22 | 22 | $this->db = $dbc; |
| 23 | 23 | if ($this->connectionExists() === false) { |
| 24 | 24 | /* |
@@ -28,19 +28,19 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | $this->createDBConnection(); |
| 30 | 30 | } |
| 31 | - } else { |
|
| 31 | + } else { |
|
| 32 | 32 | //$this->connectionExists(); |
| 33 | 33 | $this->dbs[$dbname] = $dbc; |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * Creates the database connection |
|
| 40 | - * |
|
| 41 | - * @return Boolean of the database connection |
|
| 42 | - * |
|
| 43 | - */ |
|
| 39 | + * Creates the database connection |
|
| 40 | + * |
|
| 41 | + * @return Boolean of the database connection |
|
| 42 | + * |
|
| 43 | + */ |
|
| 44 | 44 | |
| 45 | 45 | public function createDBConnection($DBname = null, $user = null, $pass = null) |
| 46 | 46 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return false; |
| 134 | 134 | } |
| 135 | 135 | if($results->rowCount()>0) { |
| 136 | - return true; |
|
| 136 | + return true; |
|
| 137 | 137 | } |
| 138 | 138 | else return false; |
| 139 | 139 | } |
@@ -150,14 +150,14 @@ discard block |
||
| 150 | 150 | $sum = $sum->fetchColumn(0); |
| 151 | 151 | } else $sum = 0; |
| 152 | 152 | if (intval($sum) !== 2) { |
| 153 | - return false; |
|
| 153 | + return false; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | } catch(PDOException $e) { |
| 157 | 157 | if($e->getCode() != 'HY000' || !stristr($e->getMessage(), 'server has gone away')) { |
| 158 | - throw $e; |
|
| 159 | - } |
|
| 160 | - //echo 'error ! '.$e->getMessage(); |
|
| 158 | + throw $e; |
|
| 159 | + } |
|
| 160 | + //echo 'error ! '.$e->getMessage(); |
|
| 161 | 161 | return false; |
| 162 | 162 | } |
| 163 | 163 | return true; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | return false; |
| 182 | 182 | } |
| 183 | 183 | if($results->rowCount()>0) { |
| 184 | - return true; |
|
| 184 | + return true; |
|
| 185 | 185 | } |
| 186 | 186 | else return false; |
| 187 | 187 | } |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | $version = 0; |
| 236 | 236 | if ($this->tableExists('aircraft')) { |
| 237 | 237 | if (!$this->tableExists('config')) { |
| 238 | - $version = '1'; |
|
| 239 | - return $version; |
|
| 238 | + $version = '1'; |
|
| 239 | + return $version; |
|
| 240 | 240 | } else { |
| 241 | 241 | $Connection = new Connection(); |
| 242 | 242 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | * @return Boolean if latest version or not |
| 258 | 258 | */ |
| 259 | 259 | public function latest() { |
| 260 | - if ($this->check_schema_version() == $this->latest_schema) return true; |
|
| 261 | - else return false; |
|
| 260 | + if ($this->check_schema_version() == $this->latest_schema) return true; |
|
| 261 | + else return false; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | } |