@@ -85,38 +85,38 @@ discard block |
||
| 85 | 85 | try { |
| 86 | 86 | //$Connection = new Connection(); |
| 87 | 87 | $sth = $Connection->db->prepare($query); |
| 88 | - $sth->execute(array(':source' => $database_file)); |
|
| 89 | - } catch(PDOException $e) { |
|
| 90 | - return "error : ".$e->getMessage(); |
|
| 91 | - } |
|
| 88 | + $sth->execute(array(':source' => $database_file)); |
|
| 89 | + } catch(PDOException $e) { |
|
| 90 | + return "error : ".$e->getMessage(); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
| 94 | - update_db::connect_sqlite($database_file); |
|
| 93 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
| 94 | + update_db::connect_sqlite($database_file); |
|
| 95 | 95 | //$query = 'select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID'; |
| 96 | 96 | $query = "select Route.RouteID, Route.callsign, operator.Icao AS operator_icao, FromAir.Icao AS FromAirportIcao, ToAir.Icao AS ToAirportIcao, rstp.allstop AS AllStop from Route inner join operator ON Route.operatorId = operator.operatorId LEFT JOIN Airport AS FromAir ON route.FromAirportId = FromAir.AirportId LEFT JOIN Airport AS ToAir ON ToAir.AirportID = route.ToAirportID LEFT JOIN (select RouteId,GROUP_CONCAT(icao,' ') as allstop from routestop left join Airport as air ON routestop.AirportId = air.AirportID group by RouteID) AS rstp ON Route.RouteID = rstp.RouteID"; |
| 97 | 97 | try { |
| 98 | - $sth = update_db::$db_sqlite->prepare($query); |
|
| 99 | - $sth->execute(); |
|
| 100 | - } catch(PDOException $e) { |
|
| 101 | - return "error : ".$e->getMessage(); |
|
| 102 | - } |
|
| 98 | + $sth = update_db::$db_sqlite->prepare($query); |
|
| 99 | + $sth->execute(); |
|
| 100 | + } catch(PDOException $e) { |
|
| 101 | + return "error : ".$e->getMessage(); |
|
| 102 | + } |
|
| 103 | 103 | //$query_dest = 'INSERT INTO routes (`RouteID`,`CallSign`,`Operator_ICAO`,`FromAirport_ICAO`,`ToAirport_ICAO`,`RouteStop`,`Source`) VALUES (:RouteID, :CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)'; |
| 104 | 104 | $query_dest = 'INSERT INTO routes (CallSign,Operator_ICAO,FromAirport_ICAO,ToAirport_ICAO,RouteStop,Source) VALUES (:CallSign, :Operator_ICAO, :FromAirport_ICAO, :ToAirport_ICAO, :routestop, :source)'; |
| 105 | 105 | $Connection = new Connection(); |
| 106 | 106 | $sth_dest = $Connection->db->prepare($query_dest); |
| 107 | 107 | try { |
| 108 | 108 | if ($globalTransaction) $Connection->db->beginTransaction(); |
| 109 | - while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 109 | + while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 110 | 110 | //$query_dest_values = array(':RouteID' => $values['RouteId'],':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file); |
| 111 | 111 | $query_dest_values = array(':CallSign' => $values['Callsign'],':Operator_ICAO' => $values['operator_icao'],':FromAirport_ICAO' => $values['FromAirportIcao'],':ToAirport_ICAO' => $values['ToAirportIcao'],':routestop' => $values['AllStop'],':source' => $database_file); |
| 112 | 112 | $sth_dest->execute($query_dest_values); |
| 113 | - } |
|
| 113 | + } |
|
| 114 | 114 | if ($globalTransaction) $Connection->db->commit(); |
| 115 | 115 | } catch(PDOException $e) { |
| 116 | 116 | if ($globalTransaction) $Connection->db->rollBack(); |
| 117 | 117 | return "error : ".$e->getMessage(); |
| 118 | 118 | } |
| 119 | - return ''; |
|
| 119 | + return ''; |
|
| 120 | 120 | } |
| 121 | 121 | public static function retrieve_route_oneworld($database_file) { |
| 122 | 122 | global $globalDebug, $globalTransaction; |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | try { |
| 128 | 128 | //$Connection = new Connection(); |
| 129 | 129 | $sth = $Connection->db->prepare($query); |
| 130 | - $sth->execute(array(':source' => 'oneworld')); |
|
| 131 | - } catch(PDOException $e) { |
|
| 132 | - return "error : ".$e->getMessage(); |
|
| 133 | - } |
|
| 130 | + $sth->execute(array(':source' => 'oneworld')); |
|
| 131 | + } catch(PDOException $e) { |
|
| 132 | + return "error : ".$e->getMessage(); |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
| 135 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
| 136 | 136 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
| 137 | 137 | $Spotter = new Spotter(); |
| 138 | 138 | if ($fh = fopen($database_file,"r")) { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | if ($globalTransaction) $Connection->db->commit(); |
| 158 | 158 | } |
| 159 | - return ''; |
|
| 159 | + return ''; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | public static function retrieve_route_skyteam($database_file) { |
@@ -168,12 +168,12 @@ discard block |
||
| 168 | 168 | try { |
| 169 | 169 | //$Connection = new Connection(); |
| 170 | 170 | $sth = $Connection->db->prepare($query); |
| 171 | - $sth->execute(array(':source' => 'skyteam')); |
|
| 172 | - } catch(PDOException $e) { |
|
| 173 | - return "error : ".$e->getMessage(); |
|
| 174 | - } |
|
| 171 | + $sth->execute(array(':source' => 'skyteam')); |
|
| 172 | + } catch(PDOException $e) { |
|
| 173 | + return "error : ".$e->getMessage(); |
|
| 174 | + } |
|
| 175 | 175 | |
| 176 | - if ($globalDebug) echo " - Add routes to DB -"; |
|
| 176 | + if ($globalDebug) echo " - Add routes to DB -"; |
|
| 177 | 177 | |
| 178 | 178 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
| 179 | 179 | $Spotter = new Spotter(); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | return "error : ".$e->getMessage(); |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | - return ''; |
|
| 202 | + return ''; |
|
| 203 | 203 | } |
| 204 | 204 | public static function retrieve_modes_sqlite_to_dest($database_file) { |
| 205 | 205 | global $globalTransaction; |
@@ -208,27 +208,27 @@ discard block |
||
| 208 | 208 | try { |
| 209 | 209 | $Connection = new Connection(); |
| 210 | 210 | $sth = $Connection->db->prepare($query); |
| 211 | - $sth->execute(array(':source' => $database_file)); |
|
| 212 | - } catch(PDOException $e) { |
|
| 213 | - return "error : ".$e->getMessage(); |
|
| 214 | - } |
|
| 211 | + $sth->execute(array(':source' => $database_file)); |
|
| 212 | + } catch(PDOException $e) { |
|
| 213 | + return "error : ".$e->getMessage(); |
|
| 214 | + } |
|
| 215 | 215 | $query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source IS NULL OR Source = :source"; |
| 216 | 216 | try { |
| 217 | 217 | $Connection = new Connection(); |
| 218 | 218 | $sth = $Connection->db->prepare($query); |
| 219 | - $sth->execute(array(':source' => $database_file)); |
|
| 220 | - } catch(PDOException $e) { |
|
| 221 | - return "error : ".$e->getMessage(); |
|
| 222 | - } |
|
| 219 | + $sth->execute(array(':source' => $database_file)); |
|
| 220 | + } catch(PDOException $e) { |
|
| 221 | + return "error : ".$e->getMessage(); |
|
| 222 | + } |
|
| 223 | 223 | |
| 224 | - update_db::connect_sqlite($database_file); |
|
| 224 | + update_db::connect_sqlite($database_file); |
|
| 225 | 225 | $query = 'select * from Aircraft'; |
| 226 | 226 | try { |
| 227 | - $sth = update_db::$db_sqlite->prepare($query); |
|
| 228 | - $sth->execute(); |
|
| 229 | - } catch(PDOException $e) { |
|
| 230 | - return "error : ".$e->getMessage(); |
|
| 231 | - } |
|
| 227 | + $sth = update_db::$db_sqlite->prepare($query); |
|
| 228 | + $sth->execute(); |
|
| 229 | + } catch(PDOException $e) { |
|
| 230 | + return "error : ".$e->getMessage(); |
|
| 231 | + } |
|
| 232 | 232 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
| 233 | 233 | $query_dest = 'INSERT INTO aircraft_modes (LastModified, ModeS,ModeSCountry,Registration,ICAOTypeCode,type_flight,Source) VALUES (:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:type,:source)'; |
| 234 | 234 | |
@@ -239,17 +239,17 @@ discard block |
||
| 239 | 239 | $sth_dest_owner = $Connection->db->prepare($query_dest_owner); |
| 240 | 240 | try { |
| 241 | 241 | if ($globalTransaction) $Connection->db->beginTransaction(); |
| 242 | - while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 242 | + while ($values = $sth->fetch(PDO::FETCH_ASSOC)) { |
|
| 243 | 243 | //$query_dest_values = array(':AircraftID' => $values['AircraftID'],':FirstCreated' => $values['FirstCreated'],':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':SerialNo' => $values['SerialNo'], ':OperatorFlagCode' => $values['OperatorFlagCode'], ':Manufacturer' => $values['Manufacturer'], ':Type' => $values['Type'], ':FirstRegDate' => $values['FirstRegDate'], ':CurrentRegDate' => $values['CurrentRegDate'], ':Country' => $values['Country'], ':PreviousID' => $values['PreviousID'], ':DeRegDate' => $values['DeRegDate'], ':Status' => $values['Status'], ':PopularName' => $values['PopularName'],':GenericName' => $values['GenericName'],':AircraftClass' => $values['AircraftClass'], ':Engines' => $values['Engines'], ':OwnershipStatus' => $values['OwnershipStatus'],':RegisteredOwners' => $values['RegisteredOwners'],':MTOW' => $values['MTOW'], ':TotalHours' => $values['TotalHours'],':YearBuilt' => $values['YearBuilt'], ':CofACategory' => $values['CofACategory'], ':CofAExpiry' => $values['CofAExpiry'], ':UserNotes' => $values['UserNotes'], ':Interested' => $values['Interested'], ':UserTag' => $values['UserTag'], ':InfoUrl' => $values['InfoURL'], ':PictureUrl1' => $values['PictureURL1'], ':PictureUrl2' => $values['PictureURL2'], ':PictureUrl3' => $values['PictureURL3'], ':UserBool1' => $values['UserBool1'], ':UserBool2' => $values['UserBool2'], ':UserBool3' => $values['UserBool3'], ':UserBool4' => $values['UserBool4'], ':UserBool5' => $values['UserBool5'], ':UserString1' => $values['UserString1'], ':UserString2' => $values['UserString2'], ':UserString3' => $values['UserString3'], ':UserString4' => $values['UserString4'], ':UserString5' => $values['UserString5'], ':UserInt1' => $values['UserInt1'], ':UserInt2' => $values['UserInt2'], ':UserInt3' => $values['UserInt3'], ':UserInt4' => $values['UserInt4'], ':UserInt5' => $values['UserInt5']); |
| 244 | 244 | if ($values['UserString4'] == 'M') $type = 'military'; |
| 245 | 245 | else $type = null; |
| 246 | 246 | $query_dest_values = array(':LastModified' => $values['LastModified'],':ModeS' => $values['ModeS'],':ModeSCountry' => $values['ModeSCountry'],':Registration' => $values['Registration'],':ICAOTypeCode' => $values['ICAOTypeCode'],':source' => $database_file,':type' => $type); |
| 247 | 247 | $sth_dest->execute($query_dest_values); |
| 248 | 248 | if ($values['RegisteredOwners'] != '' && $values['RegisteredOwners'] != NULL && $values['RegisteredOwners'] != 'Private') { |
| 249 | - $query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']); |
|
| 250 | - $sth_dest_owner->execute($query_dest_owner_values); |
|
| 249 | + $query_dest_owner_values = array(':registration' => $values['Registration'],':source' => $database_file,':owner' => $values['RegisteredOwners']); |
|
| 250 | + $sth_dest_owner->execute($query_dest_owner_values); |
|
| 251 | 251 | } |
| 252 | - } |
|
| 252 | + } |
|
| 253 | 253 | if ($globalTransaction) $Connection->db->commit(); |
| 254 | 254 | } catch(PDOException $e) { |
| 255 | 255 | return "error : ".$e->getMessage(); |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | try { |
| 261 | 261 | $Connection = new Connection(); |
| 262 | 262 | $sth = $Connection->db->prepare($query); |
| 263 | - $sth->execute(array(':source' => $database_file)); |
|
| 264 | - } catch(PDOException $e) { |
|
| 265 | - return "error : ".$e->getMessage(); |
|
| 266 | - } |
|
| 263 | + $sth->execute(array(':source' => $database_file)); |
|
| 264 | + } catch(PDOException $e) { |
|
| 265 | + return "error : ".$e->getMessage(); |
|
| 266 | + } |
|
| 267 | 267 | return ''; |
| 268 | 268 | } |
| 269 | 269 | |
@@ -275,10 +275,10 @@ discard block |
||
| 275 | 275 | try { |
| 276 | 276 | $Connection = new Connection(); |
| 277 | 277 | $sth = $Connection->db->prepare($query); |
| 278 | - $sth->execute(array(':source' => $database_file)); |
|
| 279 | - } catch(PDOException $e) { |
|
| 280 | - return "error : ".$e->getMessage(); |
|
| 281 | - } |
|
| 278 | + $sth->execute(array(':source' => $database_file)); |
|
| 279 | + } catch(PDOException $e) { |
|
| 280 | + return "error : ".$e->getMessage(); |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | 283 | if ($fh = fopen($database_file,"r")) { |
| 284 | 284 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
@@ -288,26 +288,26 @@ discard block |
||
| 288 | 288 | $sth_dest = $Connection->db->prepare($query_dest); |
| 289 | 289 | try { |
| 290 | 290 | if ($globalTransaction) $Connection->db->beginTransaction(); |
| 291 | - while (!feof($fh)) { |
|
| 292 | - $values = array(); |
|
| 293 | - $line = $Common->hex2str(fgets($fh,9999)); |
|
| 291 | + while (!feof($fh)) { |
|
| 292 | + $values = array(); |
|
| 293 | + $line = $Common->hex2str(fgets($fh,9999)); |
|
| 294 | 294 | //FFFFFF RIDEAU VALLEY SOARINGASW-20 C-FBKN MZ 123.400 |
| 295 | - $values['ModeS'] = substr($line,0,6); |
|
| 296 | - $values['Registration'] = trim(substr($line,69,6)); |
|
| 297 | - $aircraft_name = trim(substr($line,48,6)); |
|
| 298 | - // Check if we can find ICAO, else set it to GLID |
|
| 299 | - $aircraft_name_split = explode(' ',$aircraft_name); |
|
| 300 | - $search_more = ''; |
|
| 301 | - if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
| 302 | - $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
| 303 | - $sth_search = $Connection->db->prepare($query_search); |
|
| 295 | + $values['ModeS'] = substr($line,0,6); |
|
| 296 | + $values['Registration'] = trim(substr($line,69,6)); |
|
| 297 | + $aircraft_name = trim(substr($line,48,6)); |
|
| 298 | + // Check if we can find ICAO, else set it to GLID |
|
| 299 | + $aircraft_name_split = explode(' ',$aircraft_name); |
|
| 300 | + $search_more = ''; |
|
| 301 | + if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
| 302 | + $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
| 303 | + $sth_search = $Connection->db->prepare($query_search); |
|
| 304 | 304 | try { |
| 305 | - $sth_search->execute(); |
|
| 306 | - $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
| 307 | - //if (count($result) > 0) { |
|
| 308 | - if (isset($result['icao']) && $result['icao'] != '') { |
|
| 309 | - $values['ICAOTypeCode'] = $result['icao']; |
|
| 310 | - } |
|
| 305 | + $sth_search->execute(); |
|
| 306 | + $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
| 307 | + //if (count($result) > 0) { |
|
| 308 | + if (isset($result['icao']) && $result['icao'] != '') { |
|
| 309 | + $values['ICAOTypeCode'] = $result['icao']; |
|
| 310 | + } |
|
| 311 | 311 | } catch(PDOException $e) { |
| 312 | 312 | return "error : ".$e->getMessage(); |
| 313 | 313 | } |
@@ -330,10 +330,10 @@ discard block |
||
| 330 | 330 | try { |
| 331 | 331 | $Connection = new Connection(); |
| 332 | 332 | $sth = $Connection->db->prepare($query); |
| 333 | - $sth->execute(array(':source' => $database_file)); |
|
| 334 | - } catch(PDOException $e) { |
|
| 335 | - return "error : ".$e->getMessage(); |
|
| 336 | - } |
|
| 333 | + $sth->execute(array(':source' => $database_file)); |
|
| 334 | + } catch(PDOException $e) { |
|
| 335 | + return "error : ".$e->getMessage(); |
|
| 336 | + } |
|
| 337 | 337 | return ''; |
| 338 | 338 | } |
| 339 | 339 | |
@@ -344,10 +344,10 @@ discard block |
||
| 344 | 344 | try { |
| 345 | 345 | $Connection = new Connection(); |
| 346 | 346 | $sth = $Connection->db->prepare($query); |
| 347 | - $sth->execute(array(':source' => $database_file)); |
|
| 348 | - } catch(PDOException $e) { |
|
| 349 | - return "error : ".$e->getMessage(); |
|
| 350 | - } |
|
| 347 | + $sth->execute(array(':source' => $database_file)); |
|
| 348 | + } catch(PDOException $e) { |
|
| 349 | + return "error : ".$e->getMessage(); |
|
| 350 | + } |
|
| 351 | 351 | |
| 352 | 352 | if ($fh = fopen($database_file,"r")) { |
| 353 | 353 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
@@ -358,25 +358,25 @@ discard block |
||
| 358 | 358 | try { |
| 359 | 359 | if ($globalTransaction) $Connection->db->beginTransaction(); |
| 360 | 360 | $tmp = fgetcsv($fh,9999,',',"'"); |
| 361 | - while (!feof($fh)) { |
|
| 362 | - $line = fgetcsv($fh,9999,',',"'"); |
|
| 361 | + while (!feof($fh)) { |
|
| 362 | + $line = fgetcsv($fh,9999,',',"'"); |
|
| 363 | 363 | |
| 364 | 364 | //FFFFFF RIDEAU VALLEY SOARINGASW-20 C-FBKN MZ 123.400 |
| 365 | 365 | //print_r($line); |
| 366 | - $values['ModeS'] = $line[1]; |
|
| 367 | - $values['Registration'] = $line[3]; |
|
| 368 | - $values['ICAOTypeCode'] = ''; |
|
| 369 | - $aircraft_name = $line[2]; |
|
| 370 | - // Check if we can find ICAO, else set it to GLID |
|
| 371 | - $aircraft_name_split = explode(' ',$aircraft_name); |
|
| 372 | - $search_more = ''; |
|
| 373 | - if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
| 374 | - $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
| 375 | - $sth_search = $Connection->db->prepare($query_search); |
|
| 366 | + $values['ModeS'] = $line[1]; |
|
| 367 | + $values['Registration'] = $line[3]; |
|
| 368 | + $values['ICAOTypeCode'] = ''; |
|
| 369 | + $aircraft_name = $line[2]; |
|
| 370 | + // Check if we can find ICAO, else set it to GLID |
|
| 371 | + $aircraft_name_split = explode(' ',$aircraft_name); |
|
| 372 | + $search_more = ''; |
|
| 373 | + if (count($aircraft_name) > 1 && strlen($aircraft_name_split[1]) > 3) $search_more .= " AND LIKE '%".$aircraft_name_split[0]."%'"; |
|
| 374 | + $query_search = "SELECT * FROM aircraft WHERE type LIKE '%".$aircraft_name."%'".$search_more; |
|
| 375 | + $sth_search = $Connection->db->prepare($query_search); |
|
| 376 | 376 | try { |
| 377 | - $sth_search->execute(); |
|
| 378 | - $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
| 379 | - if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao']; |
|
| 377 | + $sth_search->execute(); |
|
| 378 | + $result = $sth_search->fetch(PDO::FETCH_ASSOC); |
|
| 379 | + if (isset($result['icao']) && $result['icao'] != '') $values['ICAOTypeCode'] = $result['icao']; |
|
| 380 | 380 | } catch(PDOException $e) { |
| 381 | 381 | return "error : ".$e->getMessage(); |
| 382 | 382 | } |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | try { |
| 400 | 400 | $Connection = new Connection(); |
| 401 | 401 | $sth = $Connection->db->prepare($query); |
| 402 | - $sth->execute(array(':source' => $database_file)); |
|
| 403 | - } catch(PDOException $e) { |
|
| 404 | - return "error : ".$e->getMessage(); |
|
| 405 | - } |
|
| 402 | + $sth->execute(array(':source' => $database_file)); |
|
| 403 | + } catch(PDOException $e) { |
|
| 404 | + return "error : ".$e->getMessage(); |
|
| 405 | + } |
|
| 406 | 406 | return ''; |
| 407 | 407 | } |
| 408 | 408 | |
@@ -413,16 +413,16 @@ discard block |
||
| 413 | 413 | try { |
| 414 | 414 | $Connection = new Connection(); |
| 415 | 415 | $sth = $Connection->db->prepare($query); |
| 416 | - $sth->execute(array(':source' => $database_file)); |
|
| 417 | - } catch(PDOException $e) { |
|
| 418 | - return "error : ".$e->getMessage(); |
|
| 419 | - } |
|
| 416 | + $sth->execute(array(':source' => $database_file)); |
|
| 417 | + } catch(PDOException $e) { |
|
| 418 | + return "error : ".$e->getMessage(); |
|
| 419 | + } |
|
| 420 | 420 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
| 421 | 421 | $Spotter = new Spotter(); |
| 422 | 422 | if ($fh = fopen($database_file,"r")) { |
| 423 | 423 | //$query_dest = 'INSERT INTO aircraft_modes (`AircraftID`,`FirstCreated`,`LastModified`, `ModeS`,`ModeSCountry`,`Registration`,`ICAOTypeCode`,`SerialNo`, `OperatorFlagCode`, `Manufacturer`, `Type`, `FirstRegDate`, `CurrentRegDate`, `Country`, `PreviousID`, `DeRegDate`, `Status`, `PopularName`,`GenericName`,`AircraftClass`, `Engines`, `OwnershipStatus`,`RegisteredOwners`,`MTOW`, `TotalHours`, `YearBuilt`, `CofACategory`, `CofAExpiry`, `UserNotes`, `Interested`, `UserTag`, `InfoUrl`, `PictureUrl1`, `PictureUrl2`, `PictureUrl3`, `UserBool1`, `UserBool2`, `UserBool3`, `UserBool4`, `UserBool5`, `UserString1`, `UserString2`, `UserString3`, `UserString4`, `UserString5`, `UserInt1`, `UserInt2`, `UserInt3`, `UserInt4`, `UserInt5`) VALUES (:AircraftID,:FirstCreated,:LastModified,:ModeS,:ModeSCountry,:Registration,:ICAOTypeCode,:SerialNo, :OperatorFlagCode, :Manufacturer, :Type, :FirstRegDate, :CurrentRegDate, :Country, :PreviousID, :DeRegDate, :Status, :PopularName,:GenericName,:AircraftClass, :Engines, :OwnershipStatus,:RegisteredOwners,:MTOW, :TotalHours,:YearBuilt, :CofACategory, :CofAExpiry, :UserNotes, :Interested, :UserTag, :InfoUrl, :PictureUrl1, :PictureUrl2, :PictureUrl3, :UserBool1, :UserBool2, :UserBool3, :UserBool4, :UserBool5, :UserString1, :UserString2, :UserString3, :UserString4, :UserString5, :UserInt1, :UserInt2, :UserInt3, :UserInt4, :UserInt5)'; |
| 424 | 424 | $query_dest = 'INSERT INTO aircraft_owner (registration,base,owner,date_first_reg,Source) VALUES (:registration,:base,:owner,:date_first_reg,:source)'; |
| 425 | - $query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)'; |
|
| 425 | + $query_modes = 'INSERT INTO aircraft_modes (ModeS,ModeSCountry,Registration,ICAOTypeCode,Source) VALUES (:modes,:modescountry,:registration,:icaotypecode,:source)'; |
|
| 426 | 426 | |
| 427 | 427 | $Connection = new Connection(); |
| 428 | 428 | $sth_dest = $Connection->db->prepare($query_dest); |
@@ -430,126 +430,126 @@ discard block |
||
| 430 | 430 | try { |
| 431 | 431 | if ($globalTransaction) $Connection->db->beginTransaction(); |
| 432 | 432 | $tmp = fgetcsv($fh,9999,',','"'); |
| 433 | - while (!feof($fh)) { |
|
| 434 | - $line = fgetcsv($fh,9999,',','"'); |
|
| 435 | - $values = array(); |
|
| 436 | - //print_r($line); |
|
| 437 | - if ($country == 'F') { |
|
| 438 | - $values['registration'] = $line[0]; |
|
| 439 | - $values['base'] = $line[4]; |
|
| 440 | - $values['owner'] = $line[5]; |
|
| 441 | - if ($line[6] == '') $values['date_first_reg'] = null; |
|
| 442 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
| 443 | - $values['cancel'] = $line[7]; |
|
| 433 | + while (!feof($fh)) { |
|
| 434 | + $line = fgetcsv($fh,9999,',','"'); |
|
| 435 | + $values = array(); |
|
| 436 | + //print_r($line); |
|
| 437 | + if ($country == 'F') { |
|
| 438 | + $values['registration'] = $line[0]; |
|
| 439 | + $values['base'] = $line[4]; |
|
| 440 | + $values['owner'] = $line[5]; |
|
| 441 | + if ($line[6] == '') $values['date_first_reg'] = null; |
|
| 442 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
| 443 | + $values['cancel'] = $line[7]; |
|
| 444 | 444 | } elseif ($country == 'EI') { |
| 445 | - // TODO : add modeS & reg to aircraft_modes |
|
| 446 | - $values['registration'] = $line[0]; |
|
| 447 | - $values['base'] = $line[3]; |
|
| 448 | - $values['owner'] = $line[2]; |
|
| 449 | - if ($line[1] == '') $values['date_first_reg'] = null; |
|
| 450 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1])); |
|
| 451 | - $values['cancel'] = ''; |
|
| 452 | - $values['modes'] = $line[7]; |
|
| 453 | - $values['icao'] = $line[8]; |
|
| 445 | + // TODO : add modeS & reg to aircraft_modes |
|
| 446 | + $values['registration'] = $line[0]; |
|
| 447 | + $values['base'] = $line[3]; |
|
| 448 | + $values['owner'] = $line[2]; |
|
| 449 | + if ($line[1] == '') $values['date_first_reg'] = null; |
|
| 450 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[1])); |
|
| 451 | + $values['cancel'] = ''; |
|
| 452 | + $values['modes'] = $line[7]; |
|
| 453 | + $values['icao'] = $line[8]; |
|
| 454 | 454 | |
| 455 | 455 | } elseif ($country == 'HB') { |
| 456 | - // TODO : add modeS & reg to aircraft_modes |
|
| 457 | - $values['registration'] = $line[0]; |
|
| 458 | - $values['base'] = null; |
|
| 459 | - $values['owner'] = $line[5]; |
|
| 460 | - $values['date_first_reg'] = null; |
|
| 461 | - $values['cancel'] = ''; |
|
| 462 | - $values['modes'] = $line[4]; |
|
| 463 | - $values['icao'] = $line[7]; |
|
| 456 | + // TODO : add modeS & reg to aircraft_modes |
|
| 457 | + $values['registration'] = $line[0]; |
|
| 458 | + $values['base'] = null; |
|
| 459 | + $values['owner'] = $line[5]; |
|
| 460 | + $values['date_first_reg'] = null; |
|
| 461 | + $values['cancel'] = ''; |
|
| 462 | + $values['modes'] = $line[4]; |
|
| 463 | + $values['icao'] = $line[7]; |
|
| 464 | 464 | } elseif ($country == 'OK') { |
| 465 | - // TODO : add modeS & reg to aircraft_modes |
|
| 466 | - $values['registration'] = $line[3]; |
|
| 467 | - $values['base'] = null; |
|
| 468 | - $values['owner'] = $line[5]; |
|
| 469 | - if ($line[18] == '') $values['date_first_reg'] = null; |
|
| 470 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18])); |
|
| 471 | - $values['cancel'] = ''; |
|
| 465 | + // TODO : add modeS & reg to aircraft_modes |
|
| 466 | + $values['registration'] = $line[3]; |
|
| 467 | + $values['base'] = null; |
|
| 468 | + $values['owner'] = $line[5]; |
|
| 469 | + if ($line[18] == '') $values['date_first_reg'] = null; |
|
| 470 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[18])); |
|
| 471 | + $values['cancel'] = ''; |
|
| 472 | 472 | } elseif ($country == 'VH') { |
| 473 | - // TODO : add modeS & reg to aircraft_modes |
|
| 474 | - $values['registration'] = $line[0]; |
|
| 475 | - $values['base'] = null; |
|
| 476 | - $values['owner'] = $line[12]; |
|
| 477 | - if ($line[28] == '') $values['date_first_reg'] = null; |
|
| 478 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28])); |
|
| 479 | - |
|
| 480 | - $values['cancel'] = $line[39]; |
|
| 473 | + // TODO : add modeS & reg to aircraft_modes |
|
| 474 | + $values['registration'] = $line[0]; |
|
| 475 | + $values['base'] = null; |
|
| 476 | + $values['owner'] = $line[12]; |
|
| 477 | + if ($line[28] == '') $values['date_first_reg'] = null; |
|
| 478 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[28])); |
|
| 479 | + |
|
| 480 | + $values['cancel'] = $line[39]; |
|
| 481 | 481 | } elseif ($country == 'OE' || $country == '9A' || $country == 'VP' || $country == 'LX' || $country == 'P2' || $country == 'HC') { |
| 482 | - $values['registration'] = $line[0]; |
|
| 483 | - $values['base'] = null; |
|
| 484 | - $values['owner'] = $line[4]; |
|
| 485 | - $values['date_first_reg'] = null; |
|
| 486 | - $values['cancel'] = ''; |
|
| 482 | + $values['registration'] = $line[0]; |
|
| 483 | + $values['base'] = null; |
|
| 484 | + $values['owner'] = $line[4]; |
|
| 485 | + $values['date_first_reg'] = null; |
|
| 486 | + $values['cancel'] = ''; |
|
| 487 | 487 | } elseif ($country == 'CC') { |
| 488 | - $values['registration'] = $line[0]; |
|
| 489 | - $values['base'] = null; |
|
| 490 | - $values['owner'] = $line[6]; |
|
| 491 | - $values['date_first_reg'] = null; |
|
| 492 | - $values['cancel'] = ''; |
|
| 488 | + $values['registration'] = $line[0]; |
|
| 489 | + $values['base'] = null; |
|
| 490 | + $values['owner'] = $line[6]; |
|
| 491 | + $values['date_first_reg'] = null; |
|
| 492 | + $values['cancel'] = ''; |
|
| 493 | 493 | } elseif ($country == 'HJ') { |
| 494 | - $values['registration'] = $line[0]; |
|
| 495 | - $values['base'] = null; |
|
| 496 | - $values['owner'] = $line[8]; |
|
| 497 | - if ($line[7] == '') $values['date_first_reg'] = null; |
|
| 498 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
| 499 | - $values['cancel'] = ''; |
|
| 494 | + $values['registration'] = $line[0]; |
|
| 495 | + $values['base'] = null; |
|
| 496 | + $values['owner'] = $line[8]; |
|
| 497 | + if ($line[7] == '') $values['date_first_reg'] = null; |
|
| 498 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
| 499 | + $values['cancel'] = ''; |
|
| 500 | 500 | } elseif ($country == 'PP') { |
| 501 | - $values['registration'] = $line[0]; |
|
| 502 | - $values['base'] = null; |
|
| 503 | - $values['owner'] = $line[4]; |
|
| 504 | - if ($line[6] == '') $values['date_first_reg'] = null; |
|
| 505 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
| 506 | - $values['cancel'] = $line[7]; |
|
| 501 | + $values['registration'] = $line[0]; |
|
| 502 | + $values['base'] = null; |
|
| 503 | + $values['owner'] = $line[4]; |
|
| 504 | + if ($line[6] == '') $values['date_first_reg'] = null; |
|
| 505 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[6])); |
|
| 506 | + $values['cancel'] = $line[7]; |
|
| 507 | 507 | } elseif ($country == 'E7') { |
| 508 | - $values['registration'] = $line[0]; |
|
| 509 | - $values['base'] = null; |
|
| 510 | - $values['owner'] = $line[4]; |
|
| 511 | - if ($line[5] == '') $values['date_first_reg'] = null; |
|
| 512 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
| 513 | - $values['cancel'] = ''; |
|
| 508 | + $values['registration'] = $line[0]; |
|
| 509 | + $values['base'] = null; |
|
| 510 | + $values['owner'] = $line[4]; |
|
| 511 | + if ($line[5] == '') $values['date_first_reg'] = null; |
|
| 512 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
| 513 | + $values['cancel'] = ''; |
|
| 514 | 514 | } elseif ($country == '8Q') { |
| 515 | - $values['registration'] = $line[0]; |
|
| 516 | - $values['base'] = null; |
|
| 517 | - $values['owner'] = $line[3]; |
|
| 518 | - if ($line[7] == '') $values['date_first_reg'] = null; |
|
| 519 | - else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
| 520 | - $values['cancel'] = ''; |
|
| 515 | + $values['registration'] = $line[0]; |
|
| 516 | + $values['base'] = null; |
|
| 517 | + $values['owner'] = $line[3]; |
|
| 518 | + if ($line[7] == '') $values['date_first_reg'] = null; |
|
| 519 | + else $values['date_first_reg'] = date("Y-m-d",strtotime($line[7])); |
|
| 520 | + $values['cancel'] = ''; |
|
| 521 | 521 | } elseif ($country == 'ZK') { |
| 522 | - $values['registration'] = $line[0]; |
|
| 523 | - $values['base'] = null; |
|
| 524 | - $values['owner'] = $line[3]; |
|
| 525 | - $values['date_first_reg'] = null; |
|
| 526 | - $values['cancel'] = ''; |
|
| 527 | - $values['modes'] = $line[5]; |
|
| 528 | - $values['icao'] = $line[9]; |
|
| 522 | + $values['registration'] = $line[0]; |
|
| 523 | + $values['base'] = null; |
|
| 524 | + $values['owner'] = $line[3]; |
|
| 525 | + $values['date_first_reg'] = null; |
|
| 526 | + $values['cancel'] = ''; |
|
| 527 | + $values['modes'] = $line[5]; |
|
| 528 | + $values['icao'] = $line[9]; |
|
| 529 | 529 | } elseif ($country == 'M') { |
| 530 | - $values['registration'] = $line[0]; |
|
| 531 | - $values['base'] = null; |
|
| 532 | - $values['owner'] = $line[6]; |
|
| 533 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
| 534 | - $values['cancel'] = date("Y-m-d",strtotime($line[8])); |
|
| 535 | - $values['modes'] = $line[4]; |
|
| 536 | - $values['icao'] = $line[10]; |
|
| 530 | + $values['registration'] = $line[0]; |
|
| 531 | + $values['base'] = null; |
|
| 532 | + $values['owner'] = $line[6]; |
|
| 533 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[5])); |
|
| 534 | + $values['cancel'] = date("Y-m-d",strtotime($line[8])); |
|
| 535 | + $values['modes'] = $line[4]; |
|
| 536 | + $values['icao'] = $line[10]; |
|
| 537 | 537 | } elseif ($country == 'OY') { |
| 538 | - $values['registration'] = $line[0]; |
|
| 539 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[4])); |
|
| 540 | - $values['modes'] = $line[5]; |
|
| 541 | - $values['icao'] = $line[6]; |
|
| 538 | + $values['registration'] = $line[0]; |
|
| 539 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[4])); |
|
| 540 | + $values['modes'] = $line[5]; |
|
| 541 | + $values['icao'] = $line[6]; |
|
| 542 | 542 | } elseif ($country == 'PH') { |
| 543 | - $values['registration'] = $line[0]; |
|
| 544 | - $values['date_first_reg'] = date("Y-m-d",strtotime($line[3])); |
|
| 545 | - $values['modes'] = $line[4]; |
|
| 546 | - $values['icao'] = $line[5]; |
|
| 543 | + $values['registration'] = $line[0]; |
|
| 544 | + $values['date_first_reg'] = date("Y-m-d",strtotime($line[3])); |
|
| 545 | + $values['modes'] = $line[4]; |
|
| 546 | + $values['icao'] = $line[5]; |
|
| 547 | 547 | } elseif ($country == 'OM' || $country == 'TF') { |
| 548 | - $values['registration'] = $line[0]; |
|
| 549 | - $values['base'] = null; |
|
| 550 | - $values['owner'] = $line[3]; |
|
| 551 | - $values['date_first_reg'] = null; |
|
| 552 | - $values['cancel'] = ''; |
|
| 548 | + $values['registration'] = $line[0]; |
|
| 549 | + $values['base'] = null; |
|
| 550 | + $values['owner'] = $line[3]; |
|
| 551 | + $values['date_first_reg'] = null; |
|
| 552 | + $values['cancel'] = ''; |
|
| 553 | 553 | } |
| 554 | 554 | if (isset($values['cancel']) && $values['cancel'] == '' && $values['registration'] != null && isset($values['owner'])) { |
| 555 | 555 | $query_dest_values = array(':registration' => $values['registration'],':base' => $values['base'],':date_first_reg' => $values['date_first_reg'],':owner' => $values['owner'],':source' => $database_file); |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | return "error : ".$e->getMessage(); |
| 683 | 683 | } |
| 684 | 684 | */ |
| 685 | - /* |
|
| 685 | + /* |
|
| 686 | 686 | $query = 'ALTER TABLE airport DROP INDEX icaoidx'; |
| 687 | 687 | try { |
| 688 | 688 | $Connection = new Connection(); |
@@ -927,10 +927,10 @@ discard block |
||
| 927 | 927 | try { |
| 928 | 928 | $Connection = new Connection(); |
| 929 | 929 | $sth = $Connection->db->prepare($query); |
| 930 | - $sth->execute(array(':source' => 'translation.csv')); |
|
| 931 | - } catch(PDOException $e) { |
|
| 932 | - return "error : ".$e->getMessage(); |
|
| 933 | - } |
|
| 930 | + $sth->execute(array(':source' => 'translation.csv')); |
|
| 931 | + } catch(PDOException $e) { |
|
| 932 | + return "error : ".$e->getMessage(); |
|
| 933 | + } |
|
| 934 | 934 | |
| 935 | 935 | |
| 936 | 936 | //update_db::unzip($out_file); |
@@ -949,21 +949,21 @@ discard block |
||
| 949 | 949 | $data = $row; |
| 950 | 950 | $operator = $data[2]; |
| 951 | 951 | if ($operator != '' && is_numeric(substr(substr($operator, 0, 3), -1, 1))) { |
| 952 | - $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2)); |
|
| 953 | - //echo substr($operator, 0, 2)."\n";; |
|
| 954 | - if (count($airline_array) > 0) { |
|
| 952 | + $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2)); |
|
| 953 | + //echo substr($operator, 0, 2)."\n";; |
|
| 954 | + if (count($airline_array) > 0) { |
|
| 955 | 955 | //print_r($airline_array); |
| 956 | 956 | $operator = $airline_array[0]['icao'].substr($operator,2); |
| 957 | - } |
|
| 958 | - } |
|
| 957 | + } |
|
| 958 | + } |
|
| 959 | 959 | |
| 960 | 960 | $operator_correct = $data[3]; |
| 961 | 961 | if ($operator_correct != '' && is_numeric(substr(substr($operator_correct, 0, 3), -1, 1))) { |
| 962 | - $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2)); |
|
| 963 | - if (count($airline_array) > 0) { |
|
| 964 | - $operator_correct = $airline_array[0]['icao'].substr($operator_correct,2); |
|
| 965 | - } |
|
| 966 | - } |
|
| 962 | + $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2)); |
|
| 963 | + if (count($airline_array) > 0) { |
|
| 964 | + $operator_correct = $airline_array[0]['icao'].substr($operator_correct,2); |
|
| 965 | + } |
|
| 966 | + } |
|
| 967 | 967 | $query = 'INSERT INTO translation (Reg,Reg_correct,Operator,Operator_correct,Source) VALUES (:Reg, :Reg_correct, :Operator, :Operator_correct, :source)'; |
| 968 | 968 | try { |
| 969 | 969 | $sth = $Connection->db->prepare($query); |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | //$Connection->db->commit(); |
| 978 | 978 | } |
| 979 | 979 | return ''; |
| 980 | - } |
|
| 980 | + } |
|
| 981 | 981 | |
| 982 | 982 | public static function translation_fam() { |
| 983 | 983 | global $tmp_dir, $globalTransaction; |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | //$Connection->db->commit(); |
| 1016 | 1016 | } |
| 1017 | 1017 | return ''; |
| 1018 | - } |
|
| 1018 | + } |
|
| 1019 | 1019 | |
| 1020 | 1020 | /* |
| 1021 | 1021 | * This function use FAA public data. |
@@ -1027,19 +1027,19 @@ discard block |
||
| 1027 | 1027 | try { |
| 1028 | 1028 | $Connection = new Connection(); |
| 1029 | 1029 | $sth = $Connection->db->prepare($query); |
| 1030 | - $sth->execute(array(':source' => 'website_faa')); |
|
| 1031 | - } catch(PDOException $e) { |
|
| 1032 | - return "error : ".$e->getMessage(); |
|
| 1033 | - } |
|
| 1030 | + $sth->execute(array(':source' => 'website_faa')); |
|
| 1031 | + } catch(PDOException $e) { |
|
| 1032 | + return "error : ".$e->getMessage(); |
|
| 1033 | + } |
|
| 1034 | 1034 | |
| 1035 | 1035 | $query = "DELETE FROM aircraft_owner WHERE Source = '' OR Source = :source"; |
| 1036 | 1036 | try { |
| 1037 | 1037 | $Connection = new Connection(); |
| 1038 | 1038 | $sth = $Connection->db->prepare($query); |
| 1039 | - $sth->execute(array(':source' => 'website_faa')); |
|
| 1040 | - } catch(PDOException $e) { |
|
| 1041 | - return "error : ".$e->getMessage(); |
|
| 1042 | - } |
|
| 1039 | + $sth->execute(array(':source' => 'website_faa')); |
|
| 1040 | + } catch(PDOException $e) { |
|
| 1041 | + return "error : ".$e->getMessage(); |
|
| 1042 | + } |
|
| 1043 | 1043 | |
| 1044 | 1044 | $delimiter = ","; |
| 1045 | 1045 | $mfr = array(); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | } |
| 1208 | 1208 | */ |
| 1209 | 1209 | return ''; |
| 1210 | - } |
|
| 1210 | + } |
|
| 1211 | 1211 | |
| 1212 | 1212 | public static function owner_fam() { |
| 1213 | 1213 | global $tmp_dir, $globalTransaction; |
@@ -1215,10 +1215,10 @@ discard block |
||
| 1215 | 1215 | try { |
| 1216 | 1216 | $Connection = new Connection(); |
| 1217 | 1217 | $sth = $Connection->db->prepare($query); |
| 1218 | - $sth->execute(array(':source' => 'website_fam')); |
|
| 1219 | - } catch(PDOException $e) { |
|
| 1220 | - return "error : ".$e->getMessage(); |
|
| 1221 | - } |
|
| 1218 | + $sth->execute(array(':source' => 'website_fam')); |
|
| 1219 | + } catch(PDOException $e) { |
|
| 1220 | + return "error : ".$e->getMessage(); |
|
| 1221 | + } |
|
| 1222 | 1222 | |
| 1223 | 1223 | $delimiter = "\t"; |
| 1224 | 1224 | $Connection = new Connection(); |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | if ($globalTransaction) $Connection->db->commit(); |
| 1245 | 1245 | } |
| 1246 | 1246 | return ''; |
| 1247 | - } |
|
| 1247 | + } |
|
| 1248 | 1248 | |
| 1249 | 1249 | public static function routes_fam() { |
| 1250 | 1250 | global $tmp_dir, $globalTransaction, $globalDebug; |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | if ($globalTransaction) $Connection->db->commit(); |
| 1280 | 1280 | } |
| 1281 | 1281 | return ''; |
| 1282 | - } |
|
| 1282 | + } |
|
| 1283 | 1283 | |
| 1284 | 1284 | public static function marine_identity_fam() { |
| 1285 | 1285 | global $tmp_dir, $globalTransaction; |
@@ -1287,10 +1287,10 @@ discard block |
||
| 1287 | 1287 | try { |
| 1288 | 1288 | $Connection = new Connection(); |
| 1289 | 1289 | $sth = $Connection->db->prepare($query); |
| 1290 | - $sth->execute(); |
|
| 1291 | - } catch(PDOException $e) { |
|
| 1292 | - return "error : ".$e->getMessage(); |
|
| 1293 | - } |
|
| 1290 | + $sth->execute(); |
|
| 1291 | + } catch(PDOException $e) { |
|
| 1292 | + return "error : ".$e->getMessage(); |
|
| 1293 | + } |
|
| 1294 | 1294 | |
| 1295 | 1295 | |
| 1296 | 1296 | //update_db::unzip($out_file); |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | if ($globalTransaction) $Connection->db->commit(); |
| 1321 | 1321 | } |
| 1322 | 1322 | return ''; |
| 1323 | - } |
|
| 1323 | + } |
|
| 1324 | 1324 | |
| 1325 | 1325 | public static function satellite_fam() { |
| 1326 | 1326 | global $tmp_dir, $globalTransaction; |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | if ($globalTransaction) $Connection->db->commit(); |
| 1392 | 1392 | } |
| 1393 | 1393 | return ''; |
| 1394 | - } |
|
| 1394 | + } |
|
| 1395 | 1395 | |
| 1396 | 1396 | public static function tle($filename,$tletype) { |
| 1397 | 1397 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1402,10 +1402,10 @@ discard block |
||
| 1402 | 1402 | try { |
| 1403 | 1403 | $Connection = new Connection(); |
| 1404 | 1404 | $sth = $Connection->db->prepare($query); |
| 1405 | - $sth->execute(array(':source' => $filename)); |
|
| 1406 | - } catch(PDOException $e) { |
|
| 1407 | - return "error : ".$e->getMessage(); |
|
| 1408 | - } |
|
| 1405 | + $sth->execute(array(':source' => $filename)); |
|
| 1406 | + } catch(PDOException $e) { |
|
| 1407 | + return "error : ".$e->getMessage(); |
|
| 1408 | + } |
|
| 1409 | 1409 | |
| 1410 | 1410 | $Connection = new Connection(); |
| 1411 | 1411 | if (($handle = fopen($filename, 'r')) !== FALSE) |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | //$Connection->db->commit(); |
| 1441 | 1441 | } |
| 1442 | 1442 | return ''; |
| 1443 | - } |
|
| 1443 | + } |
|
| 1444 | 1444 | |
| 1445 | 1445 | public static function satellite_ucsdb($filename) { |
| 1446 | 1446 | global $tmp_dir, $globalTransaction; |
@@ -1689,11 +1689,11 @@ discard block |
||
| 1689 | 1689 | try { |
| 1690 | 1690 | $sth = $Connection->db->prepare($query); |
| 1691 | 1691 | $sth->execute(array( |
| 1692 | - ':name' => $result['name'], ':name_alternate' => '', ':country_un' => '', ':country_owner' => $result['country_owner'], ':owner' => $result['owner'], ':users' => '', ':purpose' => '', ':purpose_detailed' => '', ':orbit' => $result['status'], |
|
| 1693 | - ':type' => '', ':longitude_geo' => NULL, ':perigee' => !empty($result['perigee']) ? $result['perigee'] : NULL, ':apogee' => !empty($result['apogee']) ? $result['apogee'] : NULL, ':eccentricity' => NULL, ':inclination' => $result['inclination'], |
|
| 1694 | - ':period' => !empty($result['period']) ? $result['period'] : NULL, ':launch_mass' => NULL, ':dry_mass' => NULL, ':power' => NULL, ':launch_date' => $result['launch_date'], ':lifetime' => $result['lifetime'], |
|
| 1695 | - ':contractor' => '',':country_contractor' => '', ':launch_site' => $result['launch_site'], ':launch_vehicule' => '', ':cospar' => $result['cospar'], ':norad' => $result['norad'], ':comments' => '', ':source_orbital' => '', ':sources' => '' |
|
| 1696 | - ) |
|
| 1692 | + ':name' => $result['name'], ':name_alternate' => '', ':country_un' => '', ':country_owner' => $result['country_owner'], ':owner' => $result['owner'], ':users' => '', ':purpose' => '', ':purpose_detailed' => '', ':orbit' => $result['status'], |
|
| 1693 | + ':type' => '', ':longitude_geo' => NULL, ':perigee' => !empty($result['perigee']) ? $result['perigee'] : NULL, ':apogee' => !empty($result['apogee']) ? $result['apogee'] : NULL, ':eccentricity' => NULL, ':inclination' => $result['inclination'], |
|
| 1694 | + ':period' => !empty($result['period']) ? $result['period'] : NULL, ':launch_mass' => NULL, ':dry_mass' => NULL, ':power' => NULL, ':launch_date' => $result['launch_date'], ':lifetime' => $result['lifetime'], |
|
| 1695 | + ':contractor' => '',':country_contractor' => '', ':launch_site' => $result['launch_site'], ':launch_vehicule' => '', ':cospar' => $result['cospar'], ':norad' => $result['norad'], ':comments' => '', ':source_orbital' => '', ':sources' => '' |
|
| 1696 | + ) |
|
| 1697 | 1697 | ); |
| 1698 | 1698 | } catch(PDOException $e) { |
| 1699 | 1699 | return "error : ".$e->getMessage(); |
@@ -1717,13 +1717,13 @@ discard block |
||
| 1717 | 1717 | //$Connection->db->commit(); |
| 1718 | 1718 | } |
| 1719 | 1719 | return ''; |
| 1720 | - } |
|
| 1720 | + } |
|
| 1721 | 1721 | |
| 1722 | 1722 | /** |
| 1723 | - * Convert a HTML table to an array |
|
| 1724 | - * @param String $data HTML page |
|
| 1725 | - * @return Array array of the tables in HTML page |
|
| 1726 | - */ |
|
| 1723 | + * Convert a HTML table to an array |
|
| 1724 | + * @param String $data HTML page |
|
| 1725 | + * @return Array array of the tables in HTML page |
|
| 1726 | + */ |
|
| 1727 | 1727 | /* |
| 1728 | 1728 | private static function table2array($data) { |
| 1729 | 1729 | $html = str_get_html($data); |
@@ -1753,11 +1753,11 @@ discard block |
||
| 1753 | 1753 | return(array_filter($tabledata)); |
| 1754 | 1754 | } |
| 1755 | 1755 | */ |
| 1756 | - /** |
|
| 1757 | - * Get data from form result |
|
| 1758 | - * @param String $url form URL |
|
| 1759 | - * @return String the result |
|
| 1760 | - */ |
|
| 1756 | + /** |
|
| 1757 | + * Get data from form result |
|
| 1758 | + * @param String $url form URL |
|
| 1759 | + * @return String the result |
|
| 1760 | + */ |
|
| 1761 | 1761 | /* |
| 1762 | 1762 | private static function getData($url) { |
| 1763 | 1763 | $ch = curl_init(); |
@@ -1850,7 +1850,7 @@ discard block |
||
| 1850 | 1850 | if ($globalTransaction) $Connection->db->commit(); |
| 1851 | 1851 | } |
| 1852 | 1852 | return ''; |
| 1853 | - } |
|
| 1853 | + } |
|
| 1854 | 1854 | |
| 1855 | 1855 | public static function ivao_airlines($filename) { |
| 1856 | 1856 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1860,10 +1860,10 @@ discard block |
||
| 1860 | 1860 | try { |
| 1861 | 1861 | $Connection = new Connection(); |
| 1862 | 1862 | $sth = $Connection->db->prepare($query); |
| 1863 | - $sth->execute(); |
|
| 1864 | - } catch(PDOException $e) { |
|
| 1865 | - return "error : ".$e->getMessage(); |
|
| 1866 | - } |
|
| 1863 | + $sth->execute(); |
|
| 1864 | + } catch(PDOException $e) { |
|
| 1865 | + return "error : ".$e->getMessage(); |
|
| 1866 | + } |
|
| 1867 | 1867 | |
| 1868 | 1868 | $header = NULL; |
| 1869 | 1869 | $delimiter = ':'; |
@@ -1887,7 +1887,7 @@ discard block |
||
| 1887 | 1887 | if ($globalTransaction) $Connection->db->commit(); |
| 1888 | 1888 | } |
| 1889 | 1889 | return ''; |
| 1890 | - } |
|
| 1890 | + } |
|
| 1891 | 1891 | |
| 1892 | 1892 | public static function update_airspace() { |
| 1893 | 1893 | global $tmp_dir, $globalDBdriver; |
@@ -1897,11 +1897,11 @@ discard block |
||
| 1897 | 1897 | $query = 'DROP TABLE airspace'; |
| 1898 | 1898 | try { |
| 1899 | 1899 | $sth = $Connection->db->prepare($query); |
| 1900 | - $sth->execute(); |
|
| 1901 | - } catch(PDOException $e) { |
|
| 1900 | + $sth->execute(); |
|
| 1901 | + } catch(PDOException $e) { |
|
| 1902 | 1902 | return "error : ".$e->getMessage(); |
| 1903 | - } |
|
| 1904 | - } |
|
| 1903 | + } |
|
| 1904 | + } |
|
| 1905 | 1905 | |
| 1906 | 1906 | |
| 1907 | 1907 | if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql'); |
@@ -1966,10 +1966,10 @@ discard block |
||
| 1966 | 1966 | $query = 'DROP TABLE countries'; |
| 1967 | 1967 | try { |
| 1968 | 1968 | $sth = $Connection->db->prepare($query); |
| 1969 | - $sth->execute(); |
|
| 1970 | - } catch(PDOException $e) { |
|
| 1971 | - echo "error : ".$e->getMessage(); |
|
| 1972 | - } |
|
| 1969 | + $sth->execute(); |
|
| 1970 | + } catch(PDOException $e) { |
|
| 1971 | + echo "error : ".$e->getMessage(); |
|
| 1972 | + } |
|
| 1973 | 1973 | } |
| 1974 | 1974 | if ($globalDBdriver == 'mysql') { |
| 1975 | 1975 | update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql'); |
@@ -2425,7 +2425,7 @@ discard block |
||
| 2425 | 2425 | $error = update_db::airlines_fam(); |
| 2426 | 2426 | update_db::insert_airlines_version($airlines_md5); |
| 2427 | 2427 | } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." md5 failed. Download failed."; |
| 2428 | - } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." doesn't exist. Download failed."; |
|
| 2428 | + } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." doesn't exist. Download failed."; |
|
| 2429 | 2429 | } elseif ($globalDebug) echo "No update"; |
| 2430 | 2430 | } else $error = "File ".$tmp_dir.'airlines.tsv.gz.md5'." doesn't exist. Download failed."; |
| 2431 | 2431 | if ($error != '') { |
@@ -2799,12 +2799,12 @@ discard block |
||
| 2799 | 2799 | echo $data; |
| 2800 | 2800 | */ |
| 2801 | 2801 | if (file_exists($tmp_dir.'aircrafts.html')) { |
| 2802 | - //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
| 2803 | - $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
| 2804 | - $result = fread($fh,100000000); |
|
| 2805 | - //echo $result; |
|
| 2806 | - //var_dump(str_get_html($result)); |
|
| 2807 | - //print_r(self::table2array($result)); |
|
| 2802 | + //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
| 2803 | + $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
| 2804 | + $result = fread($fh,100000000); |
|
| 2805 | + //echo $result; |
|
| 2806 | + //var_dump(str_get_html($result)); |
|
| 2807 | + //print_r(self::table2array($result)); |
|
| 2808 | 2808 | } |
| 2809 | 2809 | |
| 2810 | 2810 | } |
@@ -2818,10 +2818,10 @@ discard block |
||
| 2818 | 2818 | try { |
| 2819 | 2819 | $Connection = new Connection(); |
| 2820 | 2820 | $sth = $Connection->db->prepare($query); |
| 2821 | - $sth->execute(); |
|
| 2822 | - } catch(PDOException $e) { |
|
| 2823 | - return "error : ".$e->getMessage(); |
|
| 2824 | - } |
|
| 2821 | + $sth->execute(); |
|
| 2822 | + } catch(PDOException $e) { |
|
| 2823 | + return "error : ".$e->getMessage(); |
|
| 2824 | + } |
|
| 2825 | 2825 | |
| 2826 | 2826 | $error = ''; |
| 2827 | 2827 | if ($globalDebug) echo "Notam : Download..."; |
@@ -2877,8 +2877,8 @@ discard block |
||
| 2877 | 2877 | $data['date_end'] = date("Y-m-d H:i:s",strtotime($to)); |
| 2878 | 2878 | $data['permanent'] = 0; |
| 2879 | 2879 | } else { |
| 2880 | - $data['date_end'] = NULL; |
|
| 2881 | - $data['permanent'] = 1; |
|
| 2880 | + $data['date_end'] = NULL; |
|
| 2881 | + $data['permanent'] = 1; |
|
| 2882 | 2882 | } |
| 2883 | 2883 | $data['full_notam'] = $notam['title'].'<br>'.$notam['description']; |
| 2884 | 2884 | $NOTAM = new NOTAM(); |
@@ -2952,13 +2952,13 @@ discard block |
||
| 2952 | 2952 | try { |
| 2953 | 2953 | $Connection = new Connection(); |
| 2954 | 2954 | $sth = $Connection->db->prepare($query); |
| 2955 | - $sth->execute(); |
|
| 2956 | - } catch(PDOException $e) { |
|
| 2957 | - return "error : ".$e->getMessage(); |
|
| 2958 | - } |
|
| 2959 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 2960 | - if ($row['nb'] > 0) return false; |
|
| 2961 | - else return true; |
|
| 2955 | + $sth->execute(); |
|
| 2956 | + } catch(PDOException $e) { |
|
| 2957 | + return "error : ".$e->getMessage(); |
|
| 2958 | + } |
|
| 2959 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 2960 | + if ($row['nb'] > 0) return false; |
|
| 2961 | + else return true; |
|
| 2962 | 2962 | } |
| 2963 | 2963 | |
| 2964 | 2964 | public static function insert_last_update() { |
@@ -2967,10 +2967,10 @@ discard block |
||
| 2967 | 2967 | try { |
| 2968 | 2968 | $Connection = new Connection(); |
| 2969 | 2969 | $sth = $Connection->db->prepare($query); |
| 2970 | - $sth->execute(); |
|
| 2971 | - } catch(PDOException $e) { |
|
| 2972 | - return "error : ".$e->getMessage(); |
|
| 2973 | - } |
|
| 2970 | + $sth->execute(); |
|
| 2971 | + } catch(PDOException $e) { |
|
| 2972 | + return "error : ".$e->getMessage(); |
|
| 2973 | + } |
|
| 2974 | 2974 | } |
| 2975 | 2975 | |
| 2976 | 2976 | public static function check_airspace_version($version) { |
@@ -2978,13 +2978,13 @@ discard block |
||
| 2978 | 2978 | try { |
| 2979 | 2979 | $Connection = new Connection(); |
| 2980 | 2980 | $sth = $Connection->db->prepare($query); |
| 2981 | - $sth->execute(array(':version' => $version)); |
|
| 2982 | - } catch(PDOException $e) { |
|
| 2983 | - return "error : ".$e->getMessage(); |
|
| 2984 | - } |
|
| 2985 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 2986 | - if ($row['nb'] > 0) return true; |
|
| 2987 | - else return false; |
|
| 2981 | + $sth->execute(array(':version' => $version)); |
|
| 2982 | + } catch(PDOException $e) { |
|
| 2983 | + return "error : ".$e->getMessage(); |
|
| 2984 | + } |
|
| 2985 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 2986 | + if ($row['nb'] > 0) return true; |
|
| 2987 | + else return false; |
|
| 2988 | 2988 | } |
| 2989 | 2989 | |
| 2990 | 2990 | public static function check_geoid_version($version) { |
@@ -2992,13 +2992,13 @@ discard block |
||
| 2992 | 2992 | try { |
| 2993 | 2993 | $Connection = new Connection(); |
| 2994 | 2994 | $sth = $Connection->db->prepare($query); |
| 2995 | - $sth->execute(array(':version' => $version)); |
|
| 2996 | - } catch(PDOException $e) { |
|
| 2997 | - return "error : ".$e->getMessage(); |
|
| 2998 | - } |
|
| 2999 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3000 | - if ($row['nb'] > 0) return true; |
|
| 3001 | - else return false; |
|
| 2995 | + $sth->execute(array(':version' => $version)); |
|
| 2996 | + } catch(PDOException $e) { |
|
| 2997 | + return "error : ".$e->getMessage(); |
|
| 2998 | + } |
|
| 2999 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3000 | + if ($row['nb'] > 0) return true; |
|
| 3001 | + else return false; |
|
| 3002 | 3002 | } |
| 3003 | 3003 | |
| 3004 | 3004 | public static function check_marine_identity_version($version) { |
@@ -3099,10 +3099,10 @@ discard block |
||
| 3099 | 3099 | try { |
| 3100 | 3100 | $Connection = new Connection(); |
| 3101 | 3101 | $sth = $Connection->db->prepare($query); |
| 3102 | - $sth->execute(array(':version' => $version)); |
|
| 3103 | - } catch(PDOException $e) { |
|
| 3104 | - return "error : ".$e->getMessage(); |
|
| 3105 | - } |
|
| 3102 | + $sth->execute(array(':version' => $version)); |
|
| 3103 | + } catch(PDOException $e) { |
|
| 3104 | + return "error : ".$e->getMessage(); |
|
| 3105 | + } |
|
| 3106 | 3106 | } |
| 3107 | 3107 | |
| 3108 | 3108 | public static function insert_marine_identity_version($version) { |
@@ -3139,13 +3139,13 @@ discard block |
||
| 3139 | 3139 | try { |
| 3140 | 3140 | $Connection = new Connection(); |
| 3141 | 3141 | $sth = $Connection->db->prepare($query); |
| 3142 | - $sth->execute(); |
|
| 3143 | - } catch(PDOException $e) { |
|
| 3144 | - return "error : ".$e->getMessage(); |
|
| 3145 | - } |
|
| 3146 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3147 | - if ($row['nb'] > 0) return false; |
|
| 3148 | - else return true; |
|
| 3142 | + $sth->execute(); |
|
| 3143 | + } catch(PDOException $e) { |
|
| 3144 | + return "error : ".$e->getMessage(); |
|
| 3145 | + } |
|
| 3146 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3147 | + if ($row['nb'] > 0) return false; |
|
| 3148 | + else return true; |
|
| 3149 | 3149 | } |
| 3150 | 3150 | |
| 3151 | 3151 | public static function insert_last_notam_update() { |
@@ -3154,10 +3154,10 @@ discard block |
||
| 3154 | 3154 | try { |
| 3155 | 3155 | $Connection = new Connection(); |
| 3156 | 3156 | $sth = $Connection->db->prepare($query); |
| 3157 | - $sth->execute(); |
|
| 3158 | - } catch(PDOException $e) { |
|
| 3159 | - return "error : ".$e->getMessage(); |
|
| 3160 | - } |
|
| 3157 | + $sth->execute(); |
|
| 3158 | + } catch(PDOException $e) { |
|
| 3159 | + return "error : ".$e->getMessage(); |
|
| 3160 | + } |
|
| 3161 | 3161 | } |
| 3162 | 3162 | |
| 3163 | 3163 | public static function check_last_airspace_update() { |
@@ -3170,13 +3170,13 @@ discard block |
||
| 3170 | 3170 | try { |
| 3171 | 3171 | $Connection = new Connection(); |
| 3172 | 3172 | $sth = $Connection->db->prepare($query); |
| 3173 | - $sth->execute(); |
|
| 3174 | - } catch(PDOException $e) { |
|
| 3175 | - return "error : ".$e->getMessage(); |
|
| 3176 | - } |
|
| 3177 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3178 | - if ($row['nb'] > 0) return false; |
|
| 3179 | - else return true; |
|
| 3173 | + $sth->execute(); |
|
| 3174 | + } catch(PDOException $e) { |
|
| 3175 | + return "error : ".$e->getMessage(); |
|
| 3176 | + } |
|
| 3177 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3178 | + if ($row['nb'] > 0) return false; |
|
| 3179 | + else return true; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | |
| 3182 | 3182 | public static function insert_last_airspace_update() { |
@@ -3185,10 +3185,10 @@ discard block |
||
| 3185 | 3185 | try { |
| 3186 | 3186 | $Connection = new Connection(); |
| 3187 | 3187 | $sth = $Connection->db->prepare($query); |
| 3188 | - $sth->execute(); |
|
| 3189 | - } catch(PDOException $e) { |
|
| 3190 | - return "error : ".$e->getMessage(); |
|
| 3191 | - } |
|
| 3188 | + $sth->execute(); |
|
| 3189 | + } catch(PDOException $e) { |
|
| 3190 | + return "error : ".$e->getMessage(); |
|
| 3191 | + } |
|
| 3192 | 3192 | } |
| 3193 | 3193 | |
| 3194 | 3194 | public static function check_last_geoid_update() { |
@@ -3201,13 +3201,13 @@ discard block |
||
| 3201 | 3201 | try { |
| 3202 | 3202 | $Connection = new Connection(); |
| 3203 | 3203 | $sth = $Connection->db->prepare($query); |
| 3204 | - $sth->execute(); |
|
| 3205 | - } catch(PDOException $e) { |
|
| 3206 | - return "error : ".$e->getMessage(); |
|
| 3207 | - } |
|
| 3208 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3209 | - if ($row['nb'] > 0) return false; |
|
| 3210 | - else return true; |
|
| 3204 | + $sth->execute(); |
|
| 3205 | + } catch(PDOException $e) { |
|
| 3206 | + return "error : ".$e->getMessage(); |
|
| 3207 | + } |
|
| 3208 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3209 | + if ($row['nb'] > 0) return false; |
|
| 3210 | + else return true; |
|
| 3211 | 3211 | } |
| 3212 | 3212 | |
| 3213 | 3213 | public static function insert_last_geoid_update() { |
@@ -3216,10 +3216,10 @@ discard block |
||
| 3216 | 3216 | try { |
| 3217 | 3217 | $Connection = new Connection(); |
| 3218 | 3218 | $sth = $Connection->db->prepare($query); |
| 3219 | - $sth->execute(); |
|
| 3220 | - } catch(PDOException $e) { |
|
| 3221 | - return "error : ".$e->getMessage(); |
|
| 3222 | - } |
|
| 3219 | + $sth->execute(); |
|
| 3220 | + } catch(PDOException $e) { |
|
| 3221 | + return "error : ".$e->getMessage(); |
|
| 3222 | + } |
|
| 3223 | 3223 | } |
| 3224 | 3224 | |
| 3225 | 3225 | public static function check_last_owner_update() { |
@@ -3247,10 +3247,10 @@ discard block |
||
| 3247 | 3247 | try { |
| 3248 | 3248 | $Connection = new Connection(); |
| 3249 | 3249 | $sth = $Connection->db->prepare($query); |
| 3250 | - $sth->execute(); |
|
| 3251 | - } catch(PDOException $e) { |
|
| 3252 | - return "error : ".$e->getMessage(); |
|
| 3253 | - } |
|
| 3250 | + $sth->execute(); |
|
| 3251 | + } catch(PDOException $e) { |
|
| 3252 | + return "error : ".$e->getMessage(); |
|
| 3253 | + } |
|
| 3254 | 3254 | } |
| 3255 | 3255 | |
| 3256 | 3256 | public static function check_last_airlines_update() { |
@@ -3294,13 +3294,13 @@ discard block |
||
| 3294 | 3294 | try { |
| 3295 | 3295 | $Connection = new Connection(); |
| 3296 | 3296 | $sth = $Connection->db->prepare($query); |
| 3297 | - $sth->execute(); |
|
| 3298 | - } catch(PDOException $e) { |
|
| 3299 | - return "error : ".$e->getMessage(); |
|
| 3300 | - } |
|
| 3301 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3302 | - if ($row['nb'] > 0) return false; |
|
| 3303 | - else return true; |
|
| 3297 | + $sth->execute(); |
|
| 3298 | + } catch(PDOException $e) { |
|
| 3299 | + return "error : ".$e->getMessage(); |
|
| 3300 | + } |
|
| 3301 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
| 3302 | + if ($row['nb'] > 0) return false; |
|
| 3303 | + else return true; |
|
| 3304 | 3304 | } |
| 3305 | 3305 | |
| 3306 | 3306 | public static function insert_last_schedules_update() { |
@@ -3480,10 +3480,10 @@ discard block |
||
| 3480 | 3480 | try { |
| 3481 | 3481 | $Connection = new Connection(); |
| 3482 | 3482 | $sth = $Connection->db->prepare($query); |
| 3483 | - $sth->execute(); |
|
| 3484 | - } catch(PDOException $e) { |
|
| 3485 | - return "error : ".$e->getMessage(); |
|
| 3486 | - } |
|
| 3483 | + $sth->execute(); |
|
| 3484 | + } catch(PDOException $e) { |
|
| 3485 | + return "error : ".$e->getMessage(); |
|
| 3486 | + } |
|
| 3487 | 3487 | } |
| 3488 | 3488 | public static function delete_duplicateowner() { |
| 3489 | 3489 | global $globalDBdriver; |
@@ -3495,10 +3495,10 @@ discard block |
||
| 3495 | 3495 | try { |
| 3496 | 3496 | $Connection = new Connection(); |
| 3497 | 3497 | $sth = $Connection->db->prepare($query); |
| 3498 | - $sth->execute(); |
|
| 3499 | - } catch(PDOException $e) { |
|
| 3500 | - return "error : ".$e->getMessage(); |
|
| 3501 | - } |
|
| 3498 | + $sth->execute(); |
|
| 3499 | + } catch(PDOException $e) { |
|
| 3500 | + return "error : ".$e->getMessage(); |
|
| 3501 | + } |
|
| 3502 | 3502 | } |
| 3503 | 3503 | |
| 3504 | 3504 | public static function update_all() { |