@@ -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(); |
@@ -1199,7 +1199,7 @@ discard block |
||
1199 | 1199 | return "error : ".$e->getMessage(); |
1200 | 1200 | } |
1201 | 1201 | return ''; |
1202 | - } |
|
1202 | + } |
|
1203 | 1203 | |
1204 | 1204 | public static function owner_fam() { |
1205 | 1205 | global $tmp_dir, $globalTransaction; |
@@ -1207,10 +1207,10 @@ discard block |
||
1207 | 1207 | try { |
1208 | 1208 | $Connection = new Connection(); |
1209 | 1209 | $sth = $Connection->db->prepare($query); |
1210 | - $sth->execute(array(':source' => 'website_fam')); |
|
1211 | - } catch(PDOException $e) { |
|
1212 | - return "error : ".$e->getMessage(); |
|
1213 | - } |
|
1210 | + $sth->execute(array(':source' => 'website_fam')); |
|
1211 | + } catch(PDOException $e) { |
|
1212 | + return "error : ".$e->getMessage(); |
|
1213 | + } |
|
1214 | 1214 | |
1215 | 1215 | $delimiter = "\t"; |
1216 | 1216 | $Connection = new Connection(); |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | if ($globalTransaction) $Connection->db->commit(); |
1237 | 1237 | } |
1238 | 1238 | return ''; |
1239 | - } |
|
1239 | + } |
|
1240 | 1240 | |
1241 | 1241 | public static function routes_fam() { |
1242 | 1242 | global $tmp_dir, $globalTransaction, $globalDebug; |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | if ($globalTransaction) $Connection->db->commit(); |
1272 | 1272 | } |
1273 | 1273 | return ''; |
1274 | - } |
|
1274 | + } |
|
1275 | 1275 | |
1276 | 1276 | public static function marine_identity_fam() { |
1277 | 1277 | global $tmp_dir, $globalTransaction; |
@@ -1279,10 +1279,10 @@ discard block |
||
1279 | 1279 | try { |
1280 | 1280 | $Connection = new Connection(); |
1281 | 1281 | $sth = $Connection->db->prepare($query); |
1282 | - $sth->execute(); |
|
1283 | - } catch(PDOException $e) { |
|
1284 | - return "error : ".$e->getMessage(); |
|
1285 | - } |
|
1282 | + $sth->execute(); |
|
1283 | + } catch(PDOException $e) { |
|
1284 | + return "error : ".$e->getMessage(); |
|
1285 | + } |
|
1286 | 1286 | |
1287 | 1287 | |
1288 | 1288 | //update_db::unzip($out_file); |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | if ($globalTransaction) $Connection->db->commit(); |
1313 | 1313 | } |
1314 | 1314 | return ''; |
1315 | - } |
|
1315 | + } |
|
1316 | 1316 | |
1317 | 1317 | public static function satellite_fam() { |
1318 | 1318 | global $tmp_dir, $globalTransaction; |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | if ($globalTransaction) $Connection->db->commit(); |
1384 | 1384 | } |
1385 | 1385 | return ''; |
1386 | - } |
|
1386 | + } |
|
1387 | 1387 | |
1388 | 1388 | public static function tle($filename,$tletype) { |
1389 | 1389 | require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1394,10 +1394,10 @@ discard block |
||
1394 | 1394 | try { |
1395 | 1395 | $Connection = new Connection(); |
1396 | 1396 | $sth = $Connection->db->prepare($query); |
1397 | - $sth->execute(array(':source' => $filename)); |
|
1398 | - } catch(PDOException $e) { |
|
1399 | - return "error : ".$e->getMessage(); |
|
1400 | - } |
|
1397 | + $sth->execute(array(':source' => $filename)); |
|
1398 | + } catch(PDOException $e) { |
|
1399 | + return "error : ".$e->getMessage(); |
|
1400 | + } |
|
1401 | 1401 | |
1402 | 1402 | $Connection = new Connection(); |
1403 | 1403 | if (($handle = fopen($filename, 'r')) !== FALSE) |
@@ -1432,7 +1432,7 @@ discard block |
||
1432 | 1432 | //$Connection->db->commit(); |
1433 | 1433 | } |
1434 | 1434 | return ''; |
1435 | - } |
|
1435 | + } |
|
1436 | 1436 | |
1437 | 1437 | public static function satellite_ucsdb($filename) { |
1438 | 1438 | global $tmp_dir, $globalTransaction; |
@@ -1681,11 +1681,11 @@ discard block |
||
1681 | 1681 | try { |
1682 | 1682 | $sth = $Connection->db->prepare($query); |
1683 | 1683 | $sth->execute(array( |
1684 | - ':name' => $result['name'], ':name_alternate' => '', ':country_un' => '', ':country_owner' => $result['country_owner'], ':owner' => $result['owner'], ':users' => '', ':purpose' => '', ':purpose_detailed' => '', ':orbit' => $result['status'], |
|
1685 | - ':type' => '', ':longitude_geo' => NULL, ':perigee' => !empty($result['perigee']) ? $result['perigee'] : NULL, ':apogee' => !empty($result['apogee']) ? $result['apogee'] : NULL, ':eccentricity' => NULL, ':inclination' => $result['inclination'], |
|
1686 | - ':period' => !empty($result['period']) ? $result['period'] : NULL, ':launch_mass' => NULL, ':dry_mass' => NULL, ':power' => NULL, ':launch_date' => $result['launch_date'], ':lifetime' => $result['lifetime'], |
|
1687 | - ':contractor' => '',':country_contractor' => '', ':launch_site' => $result['launch_site'], ':launch_vehicule' => '', ':cospar' => $result['cospar'], ':norad' => $result['norad'], ':comments' => '', ':source_orbital' => '', ':sources' => '' |
|
1688 | - ) |
|
1684 | + ':name' => $result['name'], ':name_alternate' => '', ':country_un' => '', ':country_owner' => $result['country_owner'], ':owner' => $result['owner'], ':users' => '', ':purpose' => '', ':purpose_detailed' => '', ':orbit' => $result['status'], |
|
1685 | + ':type' => '', ':longitude_geo' => NULL, ':perigee' => !empty($result['perigee']) ? $result['perigee'] : NULL, ':apogee' => !empty($result['apogee']) ? $result['apogee'] : NULL, ':eccentricity' => NULL, ':inclination' => $result['inclination'], |
|
1686 | + ':period' => !empty($result['period']) ? $result['period'] : NULL, ':launch_mass' => NULL, ':dry_mass' => NULL, ':power' => NULL, ':launch_date' => $result['launch_date'], ':lifetime' => $result['lifetime'], |
|
1687 | + ':contractor' => '',':country_contractor' => '', ':launch_site' => $result['launch_site'], ':launch_vehicule' => '', ':cospar' => $result['cospar'], ':norad' => $result['norad'], ':comments' => '', ':source_orbital' => '', ':sources' => '' |
|
1688 | + ) |
|
1689 | 1689 | ); |
1690 | 1690 | } catch(PDOException $e) { |
1691 | 1691 | return "error : ".$e->getMessage(); |
@@ -1709,13 +1709,13 @@ discard block |
||
1709 | 1709 | //$Connection->db->commit(); |
1710 | 1710 | } |
1711 | 1711 | return ''; |
1712 | - } |
|
1712 | + } |
|
1713 | 1713 | |
1714 | 1714 | /** |
1715 | - * Convert a HTML table to an array |
|
1716 | - * @param String $data HTML page |
|
1717 | - * @return Array array of the tables in HTML page |
|
1718 | - */ |
|
1715 | + * Convert a HTML table to an array |
|
1716 | + * @param String $data HTML page |
|
1717 | + * @return Array array of the tables in HTML page |
|
1718 | + */ |
|
1719 | 1719 | /* |
1720 | 1720 | private static function table2array($data) { |
1721 | 1721 | $html = str_get_html($data); |
@@ -1745,11 +1745,11 @@ discard block |
||
1745 | 1745 | return(array_filter($tabledata)); |
1746 | 1746 | } |
1747 | 1747 | */ |
1748 | - /** |
|
1749 | - * Get data from form result |
|
1750 | - * @param String $url form URL |
|
1751 | - * @return String the result |
|
1752 | - */ |
|
1748 | + /** |
|
1749 | + * Get data from form result |
|
1750 | + * @param String $url form URL |
|
1751 | + * @return String the result |
|
1752 | + */ |
|
1753 | 1753 | /* |
1754 | 1754 | private static function getData($url) { |
1755 | 1755 | $ch = curl_init(); |
@@ -1842,7 +1842,7 @@ discard block |
||
1842 | 1842 | if ($globalTransaction) $Connection->db->commit(); |
1843 | 1843 | } |
1844 | 1844 | return ''; |
1845 | - } |
|
1845 | + } |
|
1846 | 1846 | |
1847 | 1847 | public static function ivao_airlines($filename) { |
1848 | 1848 | //require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
@@ -1852,10 +1852,10 @@ discard block |
||
1852 | 1852 | try { |
1853 | 1853 | $Connection = new Connection(); |
1854 | 1854 | $sth = $Connection->db->prepare($query); |
1855 | - $sth->execute(); |
|
1856 | - } catch(PDOException $e) { |
|
1857 | - return "error : ".$e->getMessage(); |
|
1858 | - } |
|
1855 | + $sth->execute(); |
|
1856 | + } catch(PDOException $e) { |
|
1857 | + return "error : ".$e->getMessage(); |
|
1858 | + } |
|
1859 | 1859 | |
1860 | 1860 | $header = NULL; |
1861 | 1861 | $delimiter = ':'; |
@@ -1879,7 +1879,7 @@ discard block |
||
1879 | 1879 | if ($globalTransaction) $Connection->db->commit(); |
1880 | 1880 | } |
1881 | 1881 | return ''; |
1882 | - } |
|
1882 | + } |
|
1883 | 1883 | |
1884 | 1884 | public static function update_airspace() { |
1885 | 1885 | global $tmp_dir, $globalDBdriver; |
@@ -1889,11 +1889,11 @@ discard block |
||
1889 | 1889 | $query = 'DROP TABLE airspace'; |
1890 | 1890 | try { |
1891 | 1891 | $sth = $Connection->db->prepare($query); |
1892 | - $sth->execute(); |
|
1893 | - } catch(PDOException $e) { |
|
1892 | + $sth->execute(); |
|
1893 | + } catch(PDOException $e) { |
|
1894 | 1894 | return "error : ".$e->getMessage(); |
1895 | - } |
|
1896 | - } |
|
1895 | + } |
|
1896 | + } |
|
1897 | 1897 | |
1898 | 1898 | |
1899 | 1899 | if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql'); |
@@ -1958,10 +1958,10 @@ discard block |
||
1958 | 1958 | $query = 'DROP TABLE countries'; |
1959 | 1959 | try { |
1960 | 1960 | $sth = $Connection->db->prepare($query); |
1961 | - $sth->execute(); |
|
1962 | - } catch(PDOException $e) { |
|
1963 | - echo "error : ".$e->getMessage(); |
|
1964 | - } |
|
1961 | + $sth->execute(); |
|
1962 | + } catch(PDOException $e) { |
|
1963 | + echo "error : ".$e->getMessage(); |
|
1964 | + } |
|
1965 | 1965 | } |
1966 | 1966 | if ($globalDBdriver == 'mysql') { |
1967 | 1967 | update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql'); |
@@ -2417,7 +2417,7 @@ discard block |
||
2417 | 2417 | $error = update_db::airlines_fam(); |
2418 | 2418 | update_db::insert_airlines_version($airlines_md5); |
2419 | 2419 | } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." md5 failed. Download failed."; |
2420 | - } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." doesn't exist. Download failed."; |
|
2420 | + } else $error = "File ".$tmp_dir.'airlines.tsv.gz'." doesn't exist. Download failed."; |
|
2421 | 2421 | } elseif ($globalDebug) echo "No update"; |
2422 | 2422 | } else $error = "File ".$tmp_dir.'airlines.tsv.gz.md5'." doesn't exist. Download failed."; |
2423 | 2423 | if ($error != '') { |
@@ -2790,12 +2790,12 @@ discard block |
||
2790 | 2790 | echo $data; |
2791 | 2791 | */ |
2792 | 2792 | if (file_exists($tmp_dir.'aircrafts.html')) { |
2793 | - //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
2794 | - $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
2795 | - $result = fread($fh,100000000); |
|
2796 | - //echo $result; |
|
2797 | - //var_dump(str_get_html($result)); |
|
2798 | - //print_r(self::table2array($result)); |
|
2793 | + //var_dump(file_get_html($tmp_dir.'aircrafts.html')); |
|
2794 | + $fh = fopen($tmp_dir.'aircrafts.html',"r"); |
|
2795 | + $result = fread($fh,100000000); |
|
2796 | + //echo $result; |
|
2797 | + //var_dump(str_get_html($result)); |
|
2798 | + //print_r(self::table2array($result)); |
|
2799 | 2799 | } |
2800 | 2800 | |
2801 | 2801 | } |
@@ -2809,10 +2809,10 @@ discard block |
||
2809 | 2809 | try { |
2810 | 2810 | $Connection = new Connection(); |
2811 | 2811 | $sth = $Connection->db->prepare($query); |
2812 | - $sth->execute(); |
|
2813 | - } catch(PDOException $e) { |
|
2814 | - return "error : ".$e->getMessage(); |
|
2815 | - } |
|
2812 | + $sth->execute(); |
|
2813 | + } catch(PDOException $e) { |
|
2814 | + return "error : ".$e->getMessage(); |
|
2815 | + } |
|
2816 | 2816 | |
2817 | 2817 | $error = ''; |
2818 | 2818 | if ($globalDebug) echo "Notam : Download..."; |
@@ -2868,8 +2868,8 @@ discard block |
||
2868 | 2868 | $data['date_end'] = date("Y-m-d H:i:s",strtotime($to)); |
2869 | 2869 | $data['permanent'] = 0; |
2870 | 2870 | } else { |
2871 | - $data['date_end'] = NULL; |
|
2872 | - $data['permanent'] = 1; |
|
2871 | + $data['date_end'] = NULL; |
|
2872 | + $data['permanent'] = 1; |
|
2873 | 2873 | } |
2874 | 2874 | $data['full_notam'] = $notam['title'].'<br>'.$notam['description']; |
2875 | 2875 | $NOTAM = new NOTAM(); |
@@ -2943,13 +2943,13 @@ discard block |
||
2943 | 2943 | try { |
2944 | 2944 | $Connection = new Connection(); |
2945 | 2945 | $sth = $Connection->db->prepare($query); |
2946 | - $sth->execute(); |
|
2947 | - } catch(PDOException $e) { |
|
2948 | - return "error : ".$e->getMessage(); |
|
2949 | - } |
|
2950 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2951 | - if ($row['nb'] > 0) return false; |
|
2952 | - else return true; |
|
2946 | + $sth->execute(); |
|
2947 | + } catch(PDOException $e) { |
|
2948 | + return "error : ".$e->getMessage(); |
|
2949 | + } |
|
2950 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2951 | + if ($row['nb'] > 0) return false; |
|
2952 | + else return true; |
|
2953 | 2953 | } |
2954 | 2954 | |
2955 | 2955 | public static function insert_last_update() { |
@@ -2958,10 +2958,10 @@ discard block |
||
2958 | 2958 | try { |
2959 | 2959 | $Connection = new Connection(); |
2960 | 2960 | $sth = $Connection->db->prepare($query); |
2961 | - $sth->execute(); |
|
2962 | - } catch(PDOException $e) { |
|
2963 | - return "error : ".$e->getMessage(); |
|
2964 | - } |
|
2961 | + $sth->execute(); |
|
2962 | + } catch(PDOException $e) { |
|
2963 | + return "error : ".$e->getMessage(); |
|
2964 | + } |
|
2965 | 2965 | } |
2966 | 2966 | |
2967 | 2967 | public static function check_airspace_version($version) { |
@@ -2969,13 +2969,13 @@ discard block |
||
2969 | 2969 | try { |
2970 | 2970 | $Connection = new Connection(); |
2971 | 2971 | $sth = $Connection->db->prepare($query); |
2972 | - $sth->execute(array(':version' => $version)); |
|
2973 | - } catch(PDOException $e) { |
|
2974 | - return "error : ".$e->getMessage(); |
|
2975 | - } |
|
2976 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2977 | - if ($row['nb'] > 0) return true; |
|
2978 | - else return false; |
|
2972 | + $sth->execute(array(':version' => $version)); |
|
2973 | + } catch(PDOException $e) { |
|
2974 | + return "error : ".$e->getMessage(); |
|
2975 | + } |
|
2976 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2977 | + if ($row['nb'] > 0) return true; |
|
2978 | + else return false; |
|
2979 | 2979 | } |
2980 | 2980 | |
2981 | 2981 | public static function check_geoid_version($version) { |
@@ -2983,13 +2983,13 @@ discard block |
||
2983 | 2983 | try { |
2984 | 2984 | $Connection = new Connection(); |
2985 | 2985 | $sth = $Connection->db->prepare($query); |
2986 | - $sth->execute(array(':version' => $version)); |
|
2987 | - } catch(PDOException $e) { |
|
2988 | - return "error : ".$e->getMessage(); |
|
2989 | - } |
|
2990 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2991 | - if ($row['nb'] > 0) return true; |
|
2992 | - else return false; |
|
2986 | + $sth->execute(array(':version' => $version)); |
|
2987 | + } catch(PDOException $e) { |
|
2988 | + return "error : ".$e->getMessage(); |
|
2989 | + } |
|
2990 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
2991 | + if ($row['nb'] > 0) return true; |
|
2992 | + else return false; |
|
2993 | 2993 | } |
2994 | 2994 | |
2995 | 2995 | public static function check_marine_identity_version($version) { |
@@ -3090,10 +3090,10 @@ discard block |
||
3090 | 3090 | try { |
3091 | 3091 | $Connection = new Connection(); |
3092 | 3092 | $sth = $Connection->db->prepare($query); |
3093 | - $sth->execute(array(':version' => $version)); |
|
3094 | - } catch(PDOException $e) { |
|
3095 | - return "error : ".$e->getMessage(); |
|
3096 | - } |
|
3093 | + $sth->execute(array(':version' => $version)); |
|
3094 | + } catch(PDOException $e) { |
|
3095 | + return "error : ".$e->getMessage(); |
|
3096 | + } |
|
3097 | 3097 | } |
3098 | 3098 | |
3099 | 3099 | public static function insert_marine_identity_version($version) { |
@@ -3130,13 +3130,13 @@ discard block |
||
3130 | 3130 | try { |
3131 | 3131 | $Connection = new Connection(); |
3132 | 3132 | $sth = $Connection->db->prepare($query); |
3133 | - $sth->execute(); |
|
3134 | - } catch(PDOException $e) { |
|
3135 | - return "error : ".$e->getMessage(); |
|
3136 | - } |
|
3137 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3138 | - if ($row['nb'] > 0) return false; |
|
3139 | - else return true; |
|
3133 | + $sth->execute(); |
|
3134 | + } catch(PDOException $e) { |
|
3135 | + return "error : ".$e->getMessage(); |
|
3136 | + } |
|
3137 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3138 | + if ($row['nb'] > 0) return false; |
|
3139 | + else return true; |
|
3140 | 3140 | } |
3141 | 3141 | |
3142 | 3142 | public static function insert_last_notam_update() { |
@@ -3145,10 +3145,10 @@ discard block |
||
3145 | 3145 | try { |
3146 | 3146 | $Connection = new Connection(); |
3147 | 3147 | $sth = $Connection->db->prepare($query); |
3148 | - $sth->execute(); |
|
3149 | - } catch(PDOException $e) { |
|
3150 | - return "error : ".$e->getMessage(); |
|
3151 | - } |
|
3148 | + $sth->execute(); |
|
3149 | + } catch(PDOException $e) { |
|
3150 | + return "error : ".$e->getMessage(); |
|
3151 | + } |
|
3152 | 3152 | } |
3153 | 3153 | |
3154 | 3154 | public static function check_last_airspace_update() { |
@@ -3161,13 +3161,13 @@ discard block |
||
3161 | 3161 | try { |
3162 | 3162 | $Connection = new Connection(); |
3163 | 3163 | $sth = $Connection->db->prepare($query); |
3164 | - $sth->execute(); |
|
3165 | - } catch(PDOException $e) { |
|
3166 | - return "error : ".$e->getMessage(); |
|
3167 | - } |
|
3168 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3169 | - if ($row['nb'] > 0) return false; |
|
3170 | - else return true; |
|
3164 | + $sth->execute(); |
|
3165 | + } catch(PDOException $e) { |
|
3166 | + return "error : ".$e->getMessage(); |
|
3167 | + } |
|
3168 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3169 | + if ($row['nb'] > 0) return false; |
|
3170 | + else return true; |
|
3171 | 3171 | } |
3172 | 3172 | |
3173 | 3173 | public static function insert_last_airspace_update() { |
@@ -3176,10 +3176,10 @@ discard block |
||
3176 | 3176 | try { |
3177 | 3177 | $Connection = new Connection(); |
3178 | 3178 | $sth = $Connection->db->prepare($query); |
3179 | - $sth->execute(); |
|
3180 | - } catch(PDOException $e) { |
|
3181 | - return "error : ".$e->getMessage(); |
|
3182 | - } |
|
3179 | + $sth->execute(); |
|
3180 | + } catch(PDOException $e) { |
|
3181 | + return "error : ".$e->getMessage(); |
|
3182 | + } |
|
3183 | 3183 | } |
3184 | 3184 | |
3185 | 3185 | public static function check_last_geoid_update() { |
@@ -3192,13 +3192,13 @@ discard block |
||
3192 | 3192 | try { |
3193 | 3193 | $Connection = new Connection(); |
3194 | 3194 | $sth = $Connection->db->prepare($query); |
3195 | - $sth->execute(); |
|
3196 | - } catch(PDOException $e) { |
|
3197 | - return "error : ".$e->getMessage(); |
|
3198 | - } |
|
3199 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3200 | - if ($row['nb'] > 0) return false; |
|
3201 | - else return true; |
|
3195 | + $sth->execute(); |
|
3196 | + } catch(PDOException $e) { |
|
3197 | + return "error : ".$e->getMessage(); |
|
3198 | + } |
|
3199 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3200 | + if ($row['nb'] > 0) return false; |
|
3201 | + else return true; |
|
3202 | 3202 | } |
3203 | 3203 | |
3204 | 3204 | public static function insert_last_geoid_update() { |
@@ -3207,10 +3207,10 @@ discard block |
||
3207 | 3207 | try { |
3208 | 3208 | $Connection = new Connection(); |
3209 | 3209 | $sth = $Connection->db->prepare($query); |
3210 | - $sth->execute(); |
|
3211 | - } catch(PDOException $e) { |
|
3212 | - return "error : ".$e->getMessage(); |
|
3213 | - } |
|
3210 | + $sth->execute(); |
|
3211 | + } catch(PDOException $e) { |
|
3212 | + return "error : ".$e->getMessage(); |
|
3213 | + } |
|
3214 | 3214 | } |
3215 | 3215 | |
3216 | 3216 | public static function check_last_owner_update() { |
@@ -3223,13 +3223,13 @@ discard block |
||
3223 | 3223 | try { |
3224 | 3224 | $Connection = new Connection(); |
3225 | 3225 | $sth = $Connection->db->prepare($query); |
3226 | - $sth->execute(); |
|
3227 | - } catch(PDOException $e) { |
|
3228 | - return "error : ".$e->getMessage(); |
|
3229 | - } |
|
3230 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3231 | - if ($row['nb'] > 0) return false; |
|
3232 | - else return true; |
|
3226 | + $sth->execute(); |
|
3227 | + } catch(PDOException $e) { |
|
3228 | + return "error : ".$e->getMessage(); |
|
3229 | + } |
|
3230 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3231 | + if ($row['nb'] > 0) return false; |
|
3232 | + else return true; |
|
3233 | 3233 | } |
3234 | 3234 | |
3235 | 3235 | public static function insert_last_owner_update() { |
@@ -3238,10 +3238,10 @@ discard block |
||
3238 | 3238 | try { |
3239 | 3239 | $Connection = new Connection(); |
3240 | 3240 | $sth = $Connection->db->prepare($query); |
3241 | - $sth->execute(); |
|
3242 | - } catch(PDOException $e) { |
|
3243 | - return "error : ".$e->getMessage(); |
|
3244 | - } |
|
3241 | + $sth->execute(); |
|
3242 | + } catch(PDOException $e) { |
|
3243 | + return "error : ".$e->getMessage(); |
|
3244 | + } |
|
3245 | 3245 | } |
3246 | 3246 | public static function check_last_schedules_update() { |
3247 | 3247 | global $globalDBdriver; |
@@ -3253,13 +3253,13 @@ discard block |
||
3253 | 3253 | try { |
3254 | 3254 | $Connection = new Connection(); |
3255 | 3255 | $sth = $Connection->db->prepare($query); |
3256 | - $sth->execute(); |
|
3257 | - } catch(PDOException $e) { |
|
3258 | - return "error : ".$e->getMessage(); |
|
3259 | - } |
|
3260 | - $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3261 | - if ($row['nb'] > 0) return false; |
|
3262 | - else return true; |
|
3256 | + $sth->execute(); |
|
3257 | + } catch(PDOException $e) { |
|
3258 | + return "error : ".$e->getMessage(); |
|
3259 | + } |
|
3260 | + $row = $sth->fetch(PDO::FETCH_ASSOC); |
|
3261 | + if ($row['nb'] > 0) return false; |
|
3262 | + else return true; |
|
3263 | 3263 | } |
3264 | 3264 | |
3265 | 3265 | public static function insert_last_schedules_update() { |
@@ -3439,10 +3439,10 @@ discard block |
||
3439 | 3439 | try { |
3440 | 3440 | $Connection = new Connection(); |
3441 | 3441 | $sth = $Connection->db->prepare($query); |
3442 | - $sth->execute(); |
|
3443 | - } catch(PDOException $e) { |
|
3444 | - return "error : ".$e->getMessage(); |
|
3445 | - } |
|
3442 | + $sth->execute(); |
|
3443 | + } catch(PDOException $e) { |
|
3444 | + return "error : ".$e->getMessage(); |
|
3445 | + } |
|
3446 | 3446 | } |
3447 | 3447 | public static function delete_duplicateowner() { |
3448 | 3448 | global $globalDBdriver; |
@@ -3454,10 +3454,10 @@ discard block |
||
3454 | 3454 | try { |
3455 | 3455 | $Connection = new Connection(); |
3456 | 3456 | $sth = $Connection->db->prepare($query); |
3457 | - $sth->execute(); |
|
3458 | - } catch(PDOException $e) { |
|
3459 | - return "error : ".$e->getMessage(); |
|
3460 | - } |
|
3457 | + $sth->execute(); |
|
3458 | + } catch(PDOException $e) { |
|
3459 | + return "error : ".$e->getMessage(); |
|
3460 | + } |
|
3461 | 3461 | } |
3462 | 3462 | |
3463 | 3463 | public static function update_all() { |