@@ -258,7 +258,9 @@ discard block |
||
258 | 258 | // Update table countries |
259 | 259 | if ($Connection->tableExists('airspace')) { |
260 | 260 | $error .= update_db::update_countries(); |
261 | - if ($error != '') return $error; |
|
261 | + if ($error != '') { |
|
262 | + return $error; |
|
263 | + } |
|
262 | 264 | } |
263 | 265 | // Update schema_version to 7 |
264 | 266 | $query = "UPDATE `config` SET `value` = '7' WHERE `name` = 'schema_version'"; |
@@ -314,7 +316,9 @@ discard block |
||
314 | 316 | $error = ''; |
315 | 317 | // Update table aircraft |
316 | 318 | $error .= create_db::import_file('../db/source_location.sql'); |
317 | - if ($error != '') return $error; |
|
319 | + if ($error != '') { |
|
320 | + return $error; |
|
321 | + } |
|
318 | 322 | // Update schema_version to 6 |
319 | 323 | $query = "UPDATE `config` SET `value` = '8' WHERE `name` = 'schema_version'"; |
320 | 324 | try { |
@@ -331,7 +335,9 @@ discard block |
||
331 | 335 | $error = ''; |
332 | 336 | // Update table aircraft |
333 | 337 | $error .= create_db::import_file('../db/notam.sql'); |
334 | - if ($error != '') return $error; |
|
338 | + if ($error != '') { |
|
339 | + return $error; |
|
340 | + } |
|
335 | 341 | $query = "DELETE FROM config WHERE name = 'last_update_db'; |
336 | 342 | INSERT INTO config (name,value) VALUES ('last_update_db',NOW()); |
337 | 343 | DELETE FROM config WHERE name = 'last_update_notam_db'; |
@@ -365,7 +371,9 @@ discard block |
||
365 | 371 | $error = ''; |
366 | 372 | // Update table atc |
367 | 373 | $error .= create_db::import_file('../db/atc.sql'); |
368 | - if ($error != '') return $error; |
|
374 | + if ($error != '') { |
|
375 | + return $error; |
|
376 | + } |
|
369 | 377 | |
370 | 378 | $query = "UPDATE `config` SET `value` = '10' WHERE `name` = 'schema_version'"; |
371 | 379 | try { |
@@ -389,13 +397,21 @@ discard block |
||
389 | 397 | $error = ''; |
390 | 398 | // Add tables |
391 | 399 | $error .= create_db::import_file('../db/aircraft_owner.sql'); |
392 | - if ($error != '') return $error; |
|
400 | + if ($error != '') { |
|
401 | + return $error; |
|
402 | + } |
|
393 | 403 | $error .= create_db::import_file('../db/metar.sql'); |
394 | - if ($error != '') return $error; |
|
404 | + if ($error != '') { |
|
405 | + return $error; |
|
406 | + } |
|
395 | 407 | $error .= create_db::import_file('../db/taf.sql'); |
396 | - if ($error != '') return $error; |
|
408 | + if ($error != '') { |
|
409 | + return $error; |
|
410 | + } |
|
397 | 411 | $error .= create_db::import_file('../db/airport.sql'); |
398 | - if ($error != '') return $error; |
|
412 | + if ($error != '') { |
|
413 | + return $error; |
|
414 | + } |
|
399 | 415 | |
400 | 416 | $query = "UPDATE `config` SET `value` = '11' WHERE `name` = 'schema_version'"; |
401 | 417 | try { |
@@ -469,19 +485,33 @@ discard block |
||
469 | 485 | $error = ''; |
470 | 486 | // Add tables |
471 | 487 | $error .= create_db::import_file('../db/stats.sql'); |
472 | - if ($error != '') return $error; |
|
488 | + if ($error != '') { |
|
489 | + return $error; |
|
490 | + } |
|
473 | 491 | $error .= create_db::import_file('../db/stats_aircraft.sql'); |
474 | - if ($error != '') return $error; |
|
492 | + if ($error != '') { |
|
493 | + return $error; |
|
494 | + } |
|
475 | 495 | $error .= create_db::import_file('../db/stats_airline.sql'); |
476 | - if ($error != '') return $error; |
|
496 | + if ($error != '') { |
|
497 | + return $error; |
|
498 | + } |
|
477 | 499 | $error .= create_db::import_file('../db/stats_airport.sql'); |
478 | - if ($error != '') return $error; |
|
500 | + if ($error != '') { |
|
501 | + return $error; |
|
502 | + } |
|
479 | 503 | $error .= create_db::import_file('../db/stats_owner.sql'); |
480 | - if ($error != '') return $error; |
|
504 | + if ($error != '') { |
|
505 | + return $error; |
|
506 | + } |
|
481 | 507 | $error .= create_db::import_file('../db/stats_pilot.sql'); |
482 | - if ($error != '') return $error; |
|
508 | + if ($error != '') { |
|
509 | + return $error; |
|
510 | + } |
|
483 | 511 | $error .= create_db::import_file('../db/spotter_archive_output.sql'); |
484 | - if ($error != '') return $error; |
|
512 | + if ($error != '') { |
|
513 | + return $error; |
|
514 | + } |
|
485 | 515 | |
486 | 516 | $query = "UPDATE `config` SET `value` = '13' WHERE `name` = 'schema_version'"; |
487 | 517 | try { |
@@ -521,7 +551,9 @@ discard block |
||
521 | 551 | // Add tables |
522 | 552 | if (!$Connection->tableExists('stats_flight')) { |
523 | 553 | $error .= create_db::import_file('../db/stats_flight.sql'); |
524 | - if ($error != '') return $error; |
|
554 | + if ($error != '') { |
|
555 | + return $error; |
|
556 | + } |
|
525 | 557 | } |
526 | 558 | $query = "UPDATE `config` SET `value` = '15' WHERE `name` = 'schema_version'"; |
527 | 559 | try { |
@@ -545,7 +577,9 @@ discard block |
||
545 | 577 | } catch(PDOException $e) { |
546 | 578 | return "error (update stats) : ".$e->getMessage()."\n"; |
547 | 579 | } |
548 | - if ($error != '') return $error; |
|
580 | + if ($error != '') { |
|
581 | + return $error; |
|
582 | + } |
|
549 | 583 | $query = "UPDATE `config` SET `value` = '16' WHERE `name` = 'schema_version'"; |
550 | 584 | try { |
551 | 585 | $sth = $Connection->db->prepare($query); |
@@ -566,7 +600,9 @@ discard block |
||
566 | 600 | if (!$Connection->tableExists('stats_callsign')) { |
567 | 601 | $error .= create_db::import_file('../db/stats_callsign.sql'); |
568 | 602 | } |
569 | - if ($error != '') return $error; |
|
603 | + if ($error != '') { |
|
604 | + return $error; |
|
605 | + } |
|
570 | 606 | $query = "UPDATE `config` SET `value` = '17' WHERE `name` = 'schema_version'"; |
571 | 607 | try { |
572 | 608 | $sth = $Connection->db->prepare($query); |
@@ -584,7 +620,9 @@ discard block |
||
584 | 620 | if (!$Connection->tableExists('stats_country')) { |
585 | 621 | $error .= create_db::import_file('../db/stats_country.sql'); |
586 | 622 | } |
587 | - if ($error != '') return $error; |
|
623 | + if ($error != '') { |
|
624 | + return $error; |
|
625 | + } |
|
588 | 626 | $query = "UPDATE `config` SET `value` = '18' WHERE `name` = 'schema_version'"; |
589 | 627 | try { |
590 | 628 | $sth = $Connection->db->prepare($query); |
@@ -607,7 +645,9 @@ discard block |
||
607 | 645 | return "error (update stats) : ".$e->getMessage()."\n"; |
608 | 646 | } |
609 | 647 | } |
610 | - if ($error != '') return $error; |
|
648 | + if ($error != '') { |
|
649 | + return $error; |
|
650 | + } |
|
611 | 651 | $query = "UPDATE `config` SET `value` = '19' WHERE `name` = 'schema_version'"; |
612 | 652 | try { |
613 | 653 | $sth = $Connection->db->prepare($query); |
@@ -623,7 +663,9 @@ discard block |
||
623 | 663 | $error = ''; |
624 | 664 | // Update airport table |
625 | 665 | $error .= create_db::import_file('../db/airport.sql'); |
626 | - if ($error != '') return 'Import airport.sql : '.$error; |
|
666 | + if ($error != '') { |
|
667 | + return 'Import airport.sql : '.$error; |
|
668 | + } |
|
627 | 669 | // Remove primary key on Spotter_Archive |
628 | 670 | $query = "alter table spotter_archive drop spotter_archive_id"; |
629 | 671 | try { |
@@ -699,7 +741,9 @@ discard block |
||
699 | 741 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
700 | 742 | } |
701 | 743 | } |
702 | - if ($error != '') return $error; |
|
744 | + if ($error != '') { |
|
745 | + return $error; |
|
746 | + } |
|
703 | 747 | $query = "UPDATE `config` SET `value` = '20' WHERE `name` = 'schema_version'"; |
704 | 748 | try { |
705 | 749 | $sth = $Connection->db->prepare($query); |
@@ -717,7 +761,9 @@ discard block |
||
717 | 761 | // Update airline table |
718 | 762 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
719 | 763 | $error .= create_db::import_file('../db/airlines.sql'); |
720 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
764 | + if ($error != '') { |
|
765 | + return 'Import airlines.sql : '.$error; |
|
766 | + } |
|
721 | 767 | } |
722 | 768 | if (!$Connection->checkColumnName('aircraft_modes','type_flight')) { |
723 | 769 | // Add column over_country |
@@ -729,7 +775,9 @@ discard block |
||
729 | 775 | return "error (add over_country) : ".$e->getMessage()."\n"; |
730 | 776 | } |
731 | 777 | } |
732 | - if ($error != '') return $error; |
|
778 | + if ($error != '') { |
|
779 | + return $error; |
|
780 | + } |
|
733 | 781 | /* |
734 | 782 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
735 | 783 | // Force update ModeS (this will put type_flight data |
@@ -759,7 +807,9 @@ discard block |
||
759 | 807 | } catch(PDOException $e) { |
760 | 808 | return "error (rename type to stats_type on stats*) : ".$e->getMessage()."\n"; |
761 | 809 | } |
762 | - if ($error != '') return $error; |
|
810 | + if ($error != '') { |
|
811 | + return $error; |
|
812 | + } |
|
763 | 813 | } |
764 | 814 | $query = "UPDATE `config` SET `value` = '22' WHERE `name` = 'schema_version'"; |
765 | 815 | try { |
@@ -782,7 +832,9 @@ discard block |
||
782 | 832 | } else { |
783 | 833 | $error .= create_db::import_file('../db/pgsql/stats_source.sql'); |
784 | 834 | } |
785 | - if ($error != '') return $error; |
|
835 | + if ($error != '') { |
|
836 | + return $error; |
|
837 | + } |
|
786 | 838 | } |
787 | 839 | $query = "UPDATE config SET value = '23' WHERE name = 'schema_version'"; |
788 | 840 | try { |
@@ -803,12 +855,16 @@ discard block |
||
803 | 855 | if ($globalDBdriver == 'mysql') { |
804 | 856 | if (!$Connection->tableExists('tle')) { |
805 | 857 | $error .= create_db::import_file('../db/tle.sql'); |
806 | - if ($error != '') return $error; |
|
858 | + if ($error != '') { |
|
859 | + return $error; |
|
860 | + } |
|
807 | 861 | } |
808 | 862 | } else { |
809 | 863 | if (!$Connection->tableExists('tle')) { |
810 | 864 | $error .= create_db::import_file('../db/pgsql/tle.sql'); |
811 | - if ($error != '') return $error; |
|
865 | + if ($error != '') { |
|
866 | + return $error; |
|
867 | + } |
|
812 | 868 | } |
813 | 869 | $query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)"; |
814 | 870 | try { |
@@ -848,7 +904,9 @@ discard block |
||
848 | 904 | } else { |
849 | 905 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
850 | 906 | } |
851 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
907 | + if ($error != '') { |
|
908 | + return 'Import airlines.sql : '.$error; |
|
909 | + } |
|
852 | 910 | if (!$Connection->checkColumnName('airlines','forsource')) { |
853 | 911 | // Add forsource to airlines |
854 | 912 | $query = "ALTER TABLE airlines ADD forsource VARCHAR(255) NULL DEFAULT NULL"; |
@@ -1331,20 +1389,28 @@ discard block |
||
1331 | 1389 | } |
1332 | 1390 | if ($globalDBdriver == 'mysql') { |
1333 | 1391 | $error .= create_db::import_file('../db/airlines.sql'); |
1334 | - if ($error != '') return $error; |
|
1392 | + if ($error != '') { |
|
1393 | + return $error; |
|
1394 | + } |
|
1335 | 1395 | } else { |
1336 | 1396 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
1337 | - if ($error != '') return $error; |
|
1397 | + if ($error != '') { |
|
1398 | + return $error; |
|
1399 | + } |
|
1338 | 1400 | } |
1339 | 1401 | if ((isset($globalVATSIM) && $globalVATSIM) || (isset($globalIVAO) && $globalIVAO)) { |
1340 | 1402 | include_once(dirname(__FILE__).'/class.update_db.php'); |
1341 | 1403 | if (isset($globalVATSIM) && $globalVATSIM) { |
1342 | 1404 | $error .= update_db::update_vatsim(); |
1343 | - if ($error != '') return $error; |
|
1405 | + if ($error != '') { |
|
1406 | + return $error; |
|
1407 | + } |
|
1344 | 1408 | } |
1345 | 1409 | if (isset($globalIVAO) && $globalIVAO && file_exists('tmp/ivae_feb2013.zip')) { |
1346 | 1410 | $error .= update_db::update_IVAO(); |
1347 | - if ($error != '') return $error; |
|
1411 | + if ($error != '') { |
|
1412 | + return $error; |
|
1413 | + } |
|
1348 | 1414 | } |
1349 | 1415 | } |
1350 | 1416 | |
@@ -1607,41 +1673,65 @@ discard block |
||
1607 | 1673 | if ($globalDBdriver == 'mysql') { |
1608 | 1674 | if (!$Connection->tableExists('tracker_output')) { |
1609 | 1675 | $error .= create_db::import_file('../db/tracker_output.sql'); |
1610 | - if ($error != '') return $error; |
|
1676 | + if ($error != '') { |
|
1677 | + return $error; |
|
1678 | + } |
|
1611 | 1679 | } |
1612 | 1680 | if (!$Connection->tableExists('tracker_live')) { |
1613 | 1681 | $error .= create_db::import_file('../db/tracker_live.sql'); |
1614 | - if ($error != '') return $error; |
|
1682 | + if ($error != '') { |
|
1683 | + return $error; |
|
1684 | + } |
|
1615 | 1685 | } |
1616 | 1686 | if (!$Connection->tableExists('marine_output')) { |
1617 | 1687 | $error .= create_db::import_file('../db/marine_output.sql'); |
1618 | - if ($error != '') return $error; |
|
1688 | + if ($error != '') { |
|
1689 | + return $error; |
|
1690 | + } |
|
1619 | 1691 | } |
1620 | 1692 | if (!$Connection->tableExists('marine_live')) { |
1621 | 1693 | $error .= create_db::import_file('../db/marine_live.sql'); |
1622 | - if ($error != '') return $error; |
|
1694 | + if ($error != '') { |
|
1695 | + return $error; |
|
1696 | + } |
|
1623 | 1697 | } |
1624 | 1698 | if (!$Connection->tableExists('marine_identity')) { |
1625 | 1699 | $error .= create_db::import_file('../db/marine_identity.sql'); |
1626 | - if ($error != '') return $error; |
|
1700 | + if ($error != '') { |
|
1701 | + return $error; |
|
1702 | + } |
|
1627 | 1703 | } |
1628 | 1704 | if (!$Connection->tableExists('marine_mid')) { |
1629 | 1705 | $error .= create_db::import_file('../db/marine_mid.sql'); |
1630 | - if ($error != '') return $error; |
|
1706 | + if ($error != '') { |
|
1707 | + return $error; |
|
1708 | + } |
|
1631 | 1709 | } |
1632 | 1710 | } else { |
1633 | 1711 | $error .= create_db::import_file('../db/pgsql/tracker_output.sql'); |
1634 | - if ($error != '') return $error; |
|
1712 | + if ($error != '') { |
|
1713 | + return $error; |
|
1714 | + } |
|
1635 | 1715 | $error .= create_db::import_file('../db/pgsql/tracker_live.sql'); |
1636 | - if ($error != '') return $error; |
|
1716 | + if ($error != '') { |
|
1717 | + return $error; |
|
1718 | + } |
|
1637 | 1719 | $error .= create_db::import_file('../db/pgsql/marine_output.sql'); |
1638 | - if ($error != '') return $error; |
|
1720 | + if ($error != '') { |
|
1721 | + return $error; |
|
1722 | + } |
|
1639 | 1723 | $error .= create_db::import_file('../db/pgsql/marine_live.sql'); |
1640 | - if ($error != '') return $error; |
|
1724 | + if ($error != '') { |
|
1725 | + return $error; |
|
1726 | + } |
|
1641 | 1727 | $error .= create_db::import_file('../db/pgsql/marine_identity.sql'); |
1642 | - if ($error != '') return $error; |
|
1728 | + if ($error != '') { |
|
1729 | + return $error; |
|
1730 | + } |
|
1643 | 1731 | $error .= create_db::import_file('../db/pgsql/marine_mid.sql'); |
1644 | - if ($error != '') return $error; |
|
1732 | + if ($error != '') { |
|
1733 | + return $error; |
|
1734 | + } |
|
1645 | 1735 | } |
1646 | 1736 | $query = "UPDATE config SET value = '37' WHERE name = 'schema_version'"; |
1647 | 1737 | try { |
@@ -1660,39 +1750,61 @@ discard block |
||
1660 | 1750 | if ($globalDBdriver == 'mysql') { |
1661 | 1751 | if (!$Connection->tableExists('marine_image')) { |
1662 | 1752 | $error .= create_db::import_file('../db/marine_image.sql'); |
1663 | - if ($error != '') return $error; |
|
1753 | + if ($error != '') { |
|
1754 | + return $error; |
|
1755 | + } |
|
1664 | 1756 | } |
1665 | 1757 | if (!$Connection->tableExists('marine_archive')) { |
1666 | 1758 | $error .= create_db::import_file('../db/marine_archive.sql'); |
1667 | - if ($error != '') return $error; |
|
1759 | + if ($error != '') { |
|
1760 | + return $error; |
|
1761 | + } |
|
1668 | 1762 | } |
1669 | 1763 | if (!$Connection->tableExists('marine_archive_output')) { |
1670 | 1764 | $error .= create_db::import_file('../db/marine_archive_output.sql'); |
1671 | - if ($error != '') return $error; |
|
1765 | + if ($error != '') { |
|
1766 | + return $error; |
|
1767 | + } |
|
1672 | 1768 | } |
1673 | 1769 | if (!$Connection->tableExists('tracker_archive')) { |
1674 | 1770 | $error .= create_db::import_file('../db/tracker_archive.sql'); |
1675 | - if ($error != '') return $error; |
|
1771 | + if ($error != '') { |
|
1772 | + return $error; |
|
1773 | + } |
|
1676 | 1774 | } |
1677 | 1775 | if (!$Connection->tableExists('tracker_archive_output')) { |
1678 | 1776 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
1679 | - if ($error != '') return $error; |
|
1777 | + if ($error != '') { |
|
1778 | + return $error; |
|
1779 | + } |
|
1680 | 1780 | } |
1681 | 1781 | if (!$Connection->tableExists('marine_archive_output')) { |
1682 | 1782 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
1683 | - if ($error != '') return $error; |
|
1783 | + if ($error != '') { |
|
1784 | + return $error; |
|
1785 | + } |
|
1684 | 1786 | } |
1685 | 1787 | } else { |
1686 | 1788 | $error .= create_db::import_file('../db/pgsql/marine_image.sql'); |
1687 | - if ($error != '') return $error; |
|
1789 | + if ($error != '') { |
|
1790 | + return $error; |
|
1791 | + } |
|
1688 | 1792 | $error .= create_db::import_file('../db/pgsql/marine_archive.sql'); |
1689 | - if ($error != '') return $error; |
|
1793 | + if ($error != '') { |
|
1794 | + return $error; |
|
1795 | + } |
|
1690 | 1796 | $error .= create_db::import_file('../db/pgsql/marine_archive_output.sql'); |
1691 | - if ($error != '') return $error; |
|
1797 | + if ($error != '') { |
|
1798 | + return $error; |
|
1799 | + } |
|
1692 | 1800 | $error .= create_db::import_file('../db/pgsql/tracker_archive.sql'); |
1693 | - if ($error != '') return $error; |
|
1801 | + if ($error != '') { |
|
1802 | + return $error; |
|
1803 | + } |
|
1694 | 1804 | $error .= create_db::import_file('../db/pgsql/tracker_archive_output.sql'); |
1695 | - if ($error != '') return $error; |
|
1805 | + if ($error != '') { |
|
1806 | + return $error; |
|
1807 | + } |
|
1696 | 1808 | } |
1697 | 1809 | if ($globalDBdriver == 'mysql') { |
1698 | 1810 | $query = "SELECT ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '".$globalDBname."' AND TABLE_NAME = 'spotter_archive'"; |
@@ -2063,7 +2175,9 @@ discard block |
||
2063 | 2175 | if ($globalDBdriver == 'mysql') { |
2064 | 2176 | if (!$Connection->tableExists('tracker_archive_output')) { |
2065 | 2177 | $error .= create_db::import_file('../db/tracker_archive_output.sql'); |
2066 | - if ($error != '') return $error; |
|
2178 | + if ($error != '') { |
|
2179 | + return $error; |
|
2180 | + } |
|
2067 | 2181 | } |
2068 | 2182 | $query = "ALTER TABLE tracker_live MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive MODIFY COLUMN altitude float DEFAULT NULL;ALTER TABLE tracker_archive_output MODIFY COLUMN last_altitude float DEFAULT NULL;ALTER TABLE tracker_output MODIFY COLUMN altitude float DEFAULT NULL;"; |
2069 | 2183 | } else { |
@@ -2091,14 +2205,22 @@ discard block |
||
2091 | 2205 | $error = ''; |
2092 | 2206 | if ($globalDBdriver == 'mysql') { |
2093 | 2207 | $error .= create_db::import_file('../db/airport.sql'); |
2094 | - if ($error != '') return $error; |
|
2208 | + if ($error != '') { |
|
2209 | + return $error; |
|
2210 | + } |
|
2095 | 2211 | $error .= create_db::import_file('../db/airlines.sql'); |
2096 | - if ($error != '') return $error; |
|
2212 | + if ($error != '') { |
|
2213 | + return $error; |
|
2214 | + } |
|
2097 | 2215 | } else { |
2098 | 2216 | $error .= create_db::import_file('../db/pgsql/airport.sql'); |
2099 | - if ($error != '') return $error; |
|
2217 | + if ($error != '') { |
|
2218 | + return $error; |
|
2219 | + } |
|
2100 | 2220 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
2101 | - if ($error != '') return $error; |
|
2221 | + if ($error != '') { |
|
2222 | + return $error; |
|
2223 | + } |
|
2102 | 2224 | } |
2103 | 2225 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
2104 | 2226 | if (file_exists('tmp/ivae_feb2013.zip')) { |
@@ -2115,7 +2237,9 @@ discard block |
||
2115 | 2237 | $error .= update_db::update_vatsim(); |
2116 | 2238 | } |
2117 | 2239 | } |
2118 | - if ($error != '') return $error; |
|
2240 | + if ($error != '') { |
|
2241 | + return $error; |
|
2242 | + } |
|
2119 | 2243 | $query = "UPDATE config SET value = '45' WHERE name = 'schema_version'"; |
2120 | 2244 | try { |
2121 | 2245 | $sth = $Connection->db->prepare($query); |
@@ -2133,10 +2257,14 @@ discard block |
||
2133 | 2257 | if (!$Connection->tableExists('satellite')) { |
2134 | 2258 | if ($globalDBdriver == 'mysql') { |
2135 | 2259 | $error .= create_db::import_file('../db/satellite.sql'); |
2136 | - if ($error != '') return $error; |
|
2260 | + if ($error != '') { |
|
2261 | + return $error; |
|
2262 | + } |
|
2137 | 2263 | } else { |
2138 | 2264 | $error .= create_db::import_file('../db/pgsql/satellite.sql'); |
2139 | - if ($error != '') return $error; |
|
2265 | + if ($error != '') { |
|
2266 | + return $error; |
|
2267 | + } |
|
2140 | 2268 | } |
2141 | 2269 | } |
2142 | 2270 | $query = "UPDATE config SET value = '46' WHERE name = 'schema_version'"; |
@@ -2159,8 +2287,11 @@ discard block |
||
2159 | 2287 | if ($Connection->tableExists('aircraft')) { |
2160 | 2288 | if (!$Connection->tableExists('config')) { |
2161 | 2289 | $version = '1'; |
2162 | - if ($update) return self::update_from_1(); |
|
2163 | - else return $version; |
|
2290 | + if ($update) { |
|
2291 | + return self::update_from_1(); |
|
2292 | + } else { |
|
2293 | + return $version; |
|
2294 | + } |
|
2164 | 2295 | } else { |
2165 | 2296 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
2166 | 2297 | try { |
@@ -2173,187 +2304,326 @@ discard block |
||
2173 | 2304 | if ($update) { |
2174 | 2305 | if ($result['value'] == '2') { |
2175 | 2306 | $error = self::update_from_2(); |
2176 | - if ($error != '') return $error; |
|
2177 | - else return self::check_version(true); |
|
2307 | + if ($error != '') { |
|
2308 | + return $error; |
|
2309 | + } else { |
|
2310 | + return self::check_version(true); |
|
2311 | + } |
|
2178 | 2312 | } elseif ($result['value'] == '3') { |
2179 | 2313 | $error = self::update_from_3(); |
2180 | - if ($error != '') return $error; |
|
2181 | - else return self::check_version(true); |
|
2314 | + if ($error != '') { |
|
2315 | + return $error; |
|
2316 | + } else { |
|
2317 | + return self::check_version(true); |
|
2318 | + } |
|
2182 | 2319 | } elseif ($result['value'] == '4') { |
2183 | 2320 | $error = self::update_from_4(); |
2184 | - if ($error != '') return $error; |
|
2185 | - else return self::check_version(true); |
|
2321 | + if ($error != '') { |
|
2322 | + return $error; |
|
2323 | + } else { |
|
2324 | + return self::check_version(true); |
|
2325 | + } |
|
2186 | 2326 | } elseif ($result['value'] == '5') { |
2187 | 2327 | $error = self::update_from_5(); |
2188 | - if ($error != '') return $error; |
|
2189 | - else return self::check_version(true); |
|
2328 | + if ($error != '') { |
|
2329 | + return $error; |
|
2330 | + } else { |
|
2331 | + return self::check_version(true); |
|
2332 | + } |
|
2190 | 2333 | } elseif ($result['value'] == '6') { |
2191 | 2334 | $error = self::update_from_6(); |
2192 | - if ($error != '') return $error; |
|
2193 | - else return self::check_version(true); |
|
2335 | + if ($error != '') { |
|
2336 | + return $error; |
|
2337 | + } else { |
|
2338 | + return self::check_version(true); |
|
2339 | + } |
|
2194 | 2340 | } elseif ($result['value'] == '7') { |
2195 | 2341 | $error = self::update_from_7(); |
2196 | - if ($error != '') return $error; |
|
2197 | - else return self::check_version(true); |
|
2342 | + if ($error != '') { |
|
2343 | + return $error; |
|
2344 | + } else { |
|
2345 | + return self::check_version(true); |
|
2346 | + } |
|
2198 | 2347 | } elseif ($result['value'] == '8') { |
2199 | 2348 | $error = self::update_from_8(); |
2200 | - if ($error != '') return $error; |
|
2201 | - else return self::check_version(true); |
|
2349 | + if ($error != '') { |
|
2350 | + return $error; |
|
2351 | + } else { |
|
2352 | + return self::check_version(true); |
|
2353 | + } |
|
2202 | 2354 | } elseif ($result['value'] == '9') { |
2203 | 2355 | $error = self::update_from_9(); |
2204 | - if ($error != '') return $error; |
|
2205 | - else return self::check_version(true); |
|
2356 | + if ($error != '') { |
|
2357 | + return $error; |
|
2358 | + } else { |
|
2359 | + return self::check_version(true); |
|
2360 | + } |
|
2206 | 2361 | } elseif ($result['value'] == '10') { |
2207 | 2362 | $error = self::update_from_10(); |
2208 | - if ($error != '') return $error; |
|
2209 | - else return self::check_version(true); |
|
2363 | + if ($error != '') { |
|
2364 | + return $error; |
|
2365 | + } else { |
|
2366 | + return self::check_version(true); |
|
2367 | + } |
|
2210 | 2368 | } elseif ($result['value'] == '11') { |
2211 | 2369 | $error = self::update_from_11(); |
2212 | - if ($error != '') return $error; |
|
2213 | - else return self::check_version(true); |
|
2370 | + if ($error != '') { |
|
2371 | + return $error; |
|
2372 | + } else { |
|
2373 | + return self::check_version(true); |
|
2374 | + } |
|
2214 | 2375 | } elseif ($result['value'] == '12') { |
2215 | 2376 | $error = self::update_from_12(); |
2216 | - if ($error != '') return $error; |
|
2217 | - else return self::check_version(true); |
|
2377 | + if ($error != '') { |
|
2378 | + return $error; |
|
2379 | + } else { |
|
2380 | + return self::check_version(true); |
|
2381 | + } |
|
2218 | 2382 | } elseif ($result['value'] == '13') { |
2219 | 2383 | $error = self::update_from_13(); |
2220 | - if ($error != '') return $error; |
|
2221 | - else return self::check_version(true); |
|
2384 | + if ($error != '') { |
|
2385 | + return $error; |
|
2386 | + } else { |
|
2387 | + return self::check_version(true); |
|
2388 | + } |
|
2222 | 2389 | } elseif ($result['value'] == '14') { |
2223 | 2390 | $error = self::update_from_14(); |
2224 | - if ($error != '') return $error; |
|
2225 | - else return self::check_version(true); |
|
2391 | + if ($error != '') { |
|
2392 | + return $error; |
|
2393 | + } else { |
|
2394 | + return self::check_version(true); |
|
2395 | + } |
|
2226 | 2396 | } elseif ($result['value'] == '15') { |
2227 | 2397 | $error = self::update_from_15(); |
2228 | - if ($error != '') return $error; |
|
2229 | - else return self::check_version(true); |
|
2398 | + if ($error != '') { |
|
2399 | + return $error; |
|
2400 | + } else { |
|
2401 | + return self::check_version(true); |
|
2402 | + } |
|
2230 | 2403 | } elseif ($result['value'] == '16') { |
2231 | 2404 | $error = self::update_from_16(); |
2232 | - if ($error != '') return $error; |
|
2233 | - else return self::check_version(true); |
|
2405 | + if ($error != '') { |
|
2406 | + return $error; |
|
2407 | + } else { |
|
2408 | + return self::check_version(true); |
|
2409 | + } |
|
2234 | 2410 | } elseif ($result['value'] == '17') { |
2235 | 2411 | $error = self::update_from_17(); |
2236 | - if ($error != '') return $error; |
|
2237 | - else return self::check_version(true); |
|
2412 | + if ($error != '') { |
|
2413 | + return $error; |
|
2414 | + } else { |
|
2415 | + return self::check_version(true); |
|
2416 | + } |
|
2238 | 2417 | } elseif ($result['value'] == '18') { |
2239 | 2418 | $error = self::update_from_18(); |
2240 | - if ($error != '') return $error; |
|
2241 | - else return self::check_version(true); |
|
2419 | + if ($error != '') { |
|
2420 | + return $error; |
|
2421 | + } else { |
|
2422 | + return self::check_version(true); |
|
2423 | + } |
|
2242 | 2424 | } elseif ($result['value'] == '19') { |
2243 | 2425 | $error = self::update_from_19(); |
2244 | - if ($error != '') return $error; |
|
2245 | - else return self::check_version(true); |
|
2426 | + if ($error != '') { |
|
2427 | + return $error; |
|
2428 | + } else { |
|
2429 | + return self::check_version(true); |
|
2430 | + } |
|
2246 | 2431 | } elseif ($result['value'] == '20') { |
2247 | 2432 | $error = self::update_from_20(); |
2248 | - if ($error != '') return $error; |
|
2249 | - else return self::check_version(true); |
|
2433 | + if ($error != '') { |
|
2434 | + return $error; |
|
2435 | + } else { |
|
2436 | + return self::check_version(true); |
|
2437 | + } |
|
2250 | 2438 | } elseif ($result['value'] == '21') { |
2251 | 2439 | $error = self::update_from_21(); |
2252 | - if ($error != '') return $error; |
|
2253 | - else return self::check_version(true); |
|
2440 | + if ($error != '') { |
|
2441 | + return $error; |
|
2442 | + } else { |
|
2443 | + return self::check_version(true); |
|
2444 | + } |
|
2254 | 2445 | } elseif ($result['value'] == '22') { |
2255 | 2446 | $error = self::update_from_22(); |
2256 | - if ($error != '') return $error; |
|
2257 | - else return self::check_version(true); |
|
2447 | + if ($error != '') { |
|
2448 | + return $error; |
|
2449 | + } else { |
|
2450 | + return self::check_version(true); |
|
2451 | + } |
|
2258 | 2452 | } elseif ($result['value'] == '23') { |
2259 | 2453 | $error = self::update_from_23(); |
2260 | - if ($error != '') return $error; |
|
2261 | - else return self::check_version(true); |
|
2454 | + if ($error != '') { |
|
2455 | + return $error; |
|
2456 | + } else { |
|
2457 | + return self::check_version(true); |
|
2458 | + } |
|
2262 | 2459 | } elseif ($result['value'] == '24') { |
2263 | 2460 | $error = self::update_from_24(); |
2264 | - if ($error != '') return $error; |
|
2265 | - else return self::check_version(true); |
|
2461 | + if ($error != '') { |
|
2462 | + return $error; |
|
2463 | + } else { |
|
2464 | + return self::check_version(true); |
|
2465 | + } |
|
2266 | 2466 | } elseif ($result['value'] == '25') { |
2267 | 2467 | $error = self::update_from_25(); |
2268 | - if ($error != '') return $error; |
|
2269 | - else return self::check_version(true); |
|
2468 | + if ($error != '') { |
|
2469 | + return $error; |
|
2470 | + } else { |
|
2471 | + return self::check_version(true); |
|
2472 | + } |
|
2270 | 2473 | } elseif ($result['value'] == '26') { |
2271 | 2474 | $error = self::update_from_26(); |
2272 | - if ($error != '') return $error; |
|
2273 | - else return self::check_version(true); |
|
2475 | + if ($error != '') { |
|
2476 | + return $error; |
|
2477 | + } else { |
|
2478 | + return self::check_version(true); |
|
2479 | + } |
|
2274 | 2480 | } elseif ($result['value'] == '27') { |
2275 | 2481 | $error = self::update_from_27(); |
2276 | - if ($error != '') return $error; |
|
2277 | - else return self::check_version(true); |
|
2482 | + if ($error != '') { |
|
2483 | + return $error; |
|
2484 | + } else { |
|
2485 | + return self::check_version(true); |
|
2486 | + } |
|
2278 | 2487 | } elseif ($result['value'] == '28') { |
2279 | 2488 | $error = self::update_from_28(); |
2280 | - if ($error != '') return $error; |
|
2281 | - else return self::check_version(true); |
|
2489 | + if ($error != '') { |
|
2490 | + return $error; |
|
2491 | + } else { |
|
2492 | + return self::check_version(true); |
|
2493 | + } |
|
2282 | 2494 | } elseif ($result['value'] == '29') { |
2283 | 2495 | $error = self::update_from_29(); |
2284 | - if ($error != '') return $error; |
|
2285 | - else return self::check_version(true); |
|
2496 | + if ($error != '') { |
|
2497 | + return $error; |
|
2498 | + } else { |
|
2499 | + return self::check_version(true); |
|
2500 | + } |
|
2286 | 2501 | } elseif ($result['value'] == '30') { |
2287 | 2502 | $error = self::update_from_30(); |
2288 | - if ($error != '') return $error; |
|
2289 | - else return self::check_version(true); |
|
2503 | + if ($error != '') { |
|
2504 | + return $error; |
|
2505 | + } else { |
|
2506 | + return self::check_version(true); |
|
2507 | + } |
|
2290 | 2508 | } elseif ($result['value'] == '31') { |
2291 | 2509 | $error = self::update_from_31(); |
2292 | - if ($error != '') return $error; |
|
2293 | - else return self::check_version(true); |
|
2510 | + if ($error != '') { |
|
2511 | + return $error; |
|
2512 | + } else { |
|
2513 | + return self::check_version(true); |
|
2514 | + } |
|
2294 | 2515 | } elseif ($result['value'] == '32') { |
2295 | 2516 | $error = self::update_from_32(); |
2296 | - if ($error != '') return $error; |
|
2297 | - else return self::check_version(true); |
|
2517 | + if ($error != '') { |
|
2518 | + return $error; |
|
2519 | + } else { |
|
2520 | + return self::check_version(true); |
|
2521 | + } |
|
2298 | 2522 | } elseif ($result['value'] == '33') { |
2299 | 2523 | $error = self::update_from_33(); |
2300 | - if ($error != '') return $error; |
|
2301 | - else return self::check_version(true); |
|
2524 | + if ($error != '') { |
|
2525 | + return $error; |
|
2526 | + } else { |
|
2527 | + return self::check_version(true); |
|
2528 | + } |
|
2302 | 2529 | } elseif ($result['value'] == '34') { |
2303 | 2530 | $error = self::update_from_34(); |
2304 | - if ($error != '') return $error; |
|
2305 | - else return self::check_version(true); |
|
2531 | + if ($error != '') { |
|
2532 | + return $error; |
|
2533 | + } else { |
|
2534 | + return self::check_version(true); |
|
2535 | + } |
|
2306 | 2536 | } elseif ($result['value'] == '35') { |
2307 | 2537 | $error = self::update_from_35(); |
2308 | - if ($error != '') return $error; |
|
2309 | - else return self::check_version(true); |
|
2538 | + if ($error != '') { |
|
2539 | + return $error; |
|
2540 | + } else { |
|
2541 | + return self::check_version(true); |
|
2542 | + } |
|
2310 | 2543 | } elseif ($result['value'] == '36') { |
2311 | 2544 | $error = self::update_from_36(); |
2312 | - if ($error != '') return $error; |
|
2313 | - else return self::check_version(true); |
|
2545 | + if ($error != '') { |
|
2546 | + return $error; |
|
2547 | + } else { |
|
2548 | + return self::check_version(true); |
|
2549 | + } |
|
2314 | 2550 | } elseif ($result['value'] == '37') { |
2315 | 2551 | $error = self::update_from_37(); |
2316 | - if ($error != '') return $error; |
|
2317 | - else return self::check_version(true); |
|
2552 | + if ($error != '') { |
|
2553 | + return $error; |
|
2554 | + } else { |
|
2555 | + return self::check_version(true); |
|
2556 | + } |
|
2318 | 2557 | } elseif ($result['value'] == '38') { |
2319 | 2558 | $error = self::update_from_38(); |
2320 | - if ($error != '') return $error; |
|
2321 | - else return self::check_version(true); |
|
2559 | + if ($error != '') { |
|
2560 | + return $error; |
|
2561 | + } else { |
|
2562 | + return self::check_version(true); |
|
2563 | + } |
|
2322 | 2564 | } elseif ($result['value'] == '39') { |
2323 | 2565 | $error = self::update_from_39(); |
2324 | - if ($error != '') return $error; |
|
2325 | - else return self::check_version(true); |
|
2566 | + if ($error != '') { |
|
2567 | + return $error; |
|
2568 | + } else { |
|
2569 | + return self::check_version(true); |
|
2570 | + } |
|
2326 | 2571 | } elseif ($result['value'] == '40') { |
2327 | 2572 | $error = self::update_from_40(); |
2328 | - if ($error != '') return $error; |
|
2329 | - else return self::check_version(true); |
|
2573 | + if ($error != '') { |
|
2574 | + return $error; |
|
2575 | + } else { |
|
2576 | + return self::check_version(true); |
|
2577 | + } |
|
2330 | 2578 | } elseif ($result['value'] == '41') { |
2331 | 2579 | $error = self::update_from_41(); |
2332 | - if ($error != '') return $error; |
|
2333 | - else return self::check_version(true); |
|
2580 | + if ($error != '') { |
|
2581 | + return $error; |
|
2582 | + } else { |
|
2583 | + return self::check_version(true); |
|
2584 | + } |
|
2334 | 2585 | } elseif ($result['value'] == '42') { |
2335 | 2586 | $error = self::update_from_42(); |
2336 | - if ($error != '') return $error; |
|
2337 | - else return self::check_version(true); |
|
2587 | + if ($error != '') { |
|
2588 | + return $error; |
|
2589 | + } else { |
|
2590 | + return self::check_version(true); |
|
2591 | + } |
|
2338 | 2592 | } elseif ($result['value'] == '43') { |
2339 | 2593 | $error = self::update_from_43(); |
2340 | - if ($error != '') return $error; |
|
2341 | - else return self::check_version(true); |
|
2594 | + if ($error != '') { |
|
2595 | + return $error; |
|
2596 | + } else { |
|
2597 | + return self::check_version(true); |
|
2598 | + } |
|
2342 | 2599 | } elseif ($result['value'] == '44') { |
2343 | 2600 | $error = self::update_from_44(); |
2344 | - if ($error != '') return $error; |
|
2345 | - else return self::check_version(true); |
|
2601 | + if ($error != '') { |
|
2602 | + return $error; |
|
2603 | + } else { |
|
2604 | + return self::check_version(true); |
|
2605 | + } |
|
2346 | 2606 | } elseif ($result['value'] == '45') { |
2347 | 2607 | $error = self::update_from_45(); |
2348 | - if ($error != '') return $error; |
|
2349 | - else return self::check_version(true); |
|
2350 | - } else return ''; |
|
2608 | + if ($error != '') { |
|
2609 | + return $error; |
|
2610 | + } else { |
|
2611 | + return self::check_version(true); |
|
2612 | + } |
|
2613 | + } else { |
|
2614 | + return ''; |
|
2615 | + } |
|
2351 | 2616 | } else { |
2352 | - if (isset($result['value']) && $result['value'] != '') return $result['value']; |
|
2353 | - else return 0; |
|
2617 | + if (isset($result['value']) && $result['value'] != '') { |
|
2618 | + return $result['value']; |
|
2619 | + } else { |
|
2620 | + return 0; |
|
2621 | + } |
|
2354 | 2622 | } |
2355 | 2623 | } |
2356 | - } else return $version; |
|
2624 | + } else { |
|
2625 | + return $version; |
|
2626 | + } |
|
2357 | 2627 | } |
2358 | 2628 | } |
2359 | 2629 | } |
@@ -33,7 +33,9 @@ discard block |
||
33 | 33 | if (file_exists('images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png')) |
34 | 34 | { |
35 | 35 | print '<img src="'.$globalURL.'/images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png" alt="'._("Click to see alliance activity").'" title="'._("Click to see alliance activity").'" /> '; |
36 | - } else print $alliance['alliance']; |
|
36 | + } else { |
|
37 | + print $alliance['alliance']; |
|
38 | + } |
|
37 | 39 | print '</a>'; |
38 | 40 | print '</div>'; |
39 | 41 | } |
@@ -42,13 +44,21 @@ discard block |
||
42 | 44 | } |
43 | 45 | print '<div class="select-item"><form action="'.$globalURL.'/airline" method="post"><select name="airline_type" class="selectpicker" data-live-search="true">'; |
44 | 46 | print '<option value="all"'; |
45 | - if ($airline_type == 'all') print 'selected="selected" '; |
|
47 | + if ($airline_type == 'all') { |
|
48 | + print 'selected="selected" '; |
|
49 | + } |
|
46 | 50 | print '>'._("All").'</option><option value="passenger"'; |
47 | - if ($airline_type == 'passenger') print 'selected="selected" '; |
|
51 | + if ($airline_type == 'passenger') { |
|
52 | + print 'selected="selected" '; |
|
53 | + } |
|
48 | 54 | print '>'._("Passenger").'</option><option value="cargo"'; |
49 | - if ($airline_type == 'cargo') print 'selected="selected" '; |
|
55 | + if ($airline_type == 'cargo') { |
|
56 | + print 'selected="selected" '; |
|
57 | + } |
|
50 | 58 | print '>'._("Cargo").'</option><option value="military"'; |
51 | - if ($airline_type == 'military') print 'selected="selected" '; |
|
59 | + if ($airline_type == 'military') { |
|
60 | + print 'selected="selected" '; |
|
61 | + } |
|
52 | 62 | print '>'._("Military").'</option></select>'; |
53 | 63 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button></form></div>'; |
54 | 64 | |
@@ -75,7 +85,9 @@ discard block |
||
75 | 85 | $firstLetter = strtoupper($Common->replace_mb_substr($value['airline_name'], 0, 1)); |
76 | 86 | if($previous !== $firstLetter) |
77 | 87 | { |
78 | - if ($previous !== null) print ' | '; |
|
88 | + if ($previous !== null) { |
|
89 | + print ' | '; |
|
90 | + } |
|
79 | 91 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
80 | 92 | } |
81 | 93 | $previous = $firstLetter; |
@@ -88,7 +100,9 @@ discard block |
||
88 | 100 | { |
89 | 101 | if($previous !== $firstLetter) |
90 | 102 | { |
91 | - if ($previous !== null) print '</div>'; |
|
103 | + if ($previous !== null) { |
|
104 | + print '</div>'; |
|
105 | + } |
|
92 | 106 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
93 | 107 | } |
94 | 108 | $previous = $firstLetter; |
@@ -102,10 +116,14 @@ discard block |
||
102 | 116 | } elseif (file_exists('images/airlines/'.$value['airline_icao'].'.png')) |
103 | 117 | { |
104 | 118 | print '<img src="'.$globalURL.'/images/airlines/'.$value['airline_icao'].'.png" alt="'._("Click to see airline activity").'" title="'._("Click to see airline activity").'" /> '; |
105 | - if (isset($value['ban_eu']) && $value['ban_eu'] == 1) print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
119 | + if (isset($value['ban_eu']) && $value['ban_eu'] == 1) { |
|
120 | + print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
121 | + } |
|
106 | 122 | } else { |
107 | 123 | print $value['airline_name']; |
108 | - if (isset($value['ban_eu']) && $value['ban_eu'] == 1) print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
124 | + if (isset($value['ban_eu']) && $value['ban_eu'] == 1) { |
|
125 | + print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
126 | + } |
|
109 | 127 | } |
110 | 128 | print '</a>'; |
111 | 129 | print '</div>'; |
@@ -105,8 +105,11 @@ |
||
105 | 105 | } elseif (isset($_GET['satellite'])) { |
106 | 106 | readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/satellites/'.$filename); |
107 | 107 | } else { |
108 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
109 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
108 | + if ($color == 'FF0000') { |
|
109 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
110 | + } else { |
|
111 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
112 | + } |
|
110 | 113 | } |
111 | 114 | } |
112 | 115 | ?> |
113 | 116 | \ No newline at end of file |
@@ -3,11 +3,18 @@ discard block |
||
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | 5 | // Compressed GeoJson is used if true |
6 | -if (!isset($globalJsonCompress)) $compress = true; |
|
7 | -else $compress = $globalJsonCompress; |
|
6 | +if (!isset($globalJsonCompress)) { |
|
7 | + $compress = true; |
|
8 | +} else { |
|
9 | + $compress = $globalJsonCompress; |
|
10 | +} |
|
8 | 11 | |
9 | -if (isset($_GET['ident'])) $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
10 | -if (isset($_GET['flightaware_id'])) $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
12 | +if (isset($_GET['ident'])) { |
|
13 | + $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
14 | +} |
|
15 | +if (isset($_GET['flightaware_id'])) { |
|
16 | + $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
17 | +} |
|
11 | 18 | ?> |
12 | 19 | |
13 | 20 | |
@@ -72,9 +79,12 @@ discard block |
||
72 | 79 | |
73 | 80 | function update_airportsLayer() { |
74 | 81 | <?php |
75 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
76 | - else $getZoom = '7'; |
|
77 | -?> |
|
82 | + if (isset($_COOKIE['AirportZoom'])) { |
|
83 | + $getZoom = $_COOKIE['AirportZoom']; |
|
84 | + } else { |
|
85 | + $getZoom = '7'; |
|
86 | + } |
|
87 | + ?> |
|
78 | 88 | if (typeof airportsLayer != 'undefined') { |
79 | 89 | if (map.hasLayer(airportsLayer) == true) { |
80 | 90 | map.removeLayer(airportsLayer); |
@@ -320,9 +330,13 @@ discard block |
||
320 | 330 | if (callsign != ""){ markerLabel += callsign; } |
321 | 331 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
322 | 332 | <?php |
323 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
324 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
325 | - else $IconColor = '1a3151'; |
|
333 | + if (isset($_COOKIE['IconColor'])) { |
|
334 | + $IconColor = $_COOKIE['IconColor']; |
|
335 | + } elseif (isset($globalAircraftIconColor)) { |
|
336 | + $IconColor = $globalAircraftIconColor; |
|
337 | + } else { |
|
338 | + $IconColor = '1a3151'; |
|
339 | + } |
|
326 | 340 | if (!isset($ident) && !isset($flightaware_id)) { |
327 | 341 | ?> |
328 | 342 | //info_update(feature.properties.fc); |
@@ -370,7 +384,12 @@ discard block |
||
370 | 384 | <?php |
371 | 385 | } else { |
372 | 386 | ?> |
373 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
387 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
388 | + print $archiveupdatetime*1000; |
|
389 | +} else { |
|
390 | + print $globalMapRefresh*1000+20000; |
|
391 | +} |
|
392 | +?>+feature.properties.sqt*1000); |
|
374 | 393 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
375 | 394 | <?php |
376 | 395 | } |
@@ -419,7 +438,12 @@ discard block |
||
419 | 438 | <?php |
420 | 439 | } else { |
421 | 440 | ?> |
422 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
441 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
442 | + print $archiveupdatetime*1000; |
|
443 | +} else { |
|
444 | + print $globalMapRefresh*1000+20000; |
|
445 | +} |
|
446 | +?>+feature.properties.sqt*1000); |
|
423 | 447 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
424 | 448 | <?php |
425 | 449 | } |
@@ -466,7 +490,12 @@ discard block |
||
466 | 490 | <?php |
467 | 491 | } else { |
468 | 492 | ?> |
469 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
493 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
494 | + print $archiveupdatetime*1000; |
|
495 | +} else { |
|
496 | + print $globalMapRefresh*1000+20000; |
|
497 | +} |
|
498 | +?>+feature.properties.sqt*1000); |
|
470 | 499 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
471 | 500 | <?php |
472 | 501 | } |
@@ -820,13 +849,23 @@ discard block |
||
820 | 849 | if (isset($archive) && $archive) { |
821 | 850 | ?> |
822 | 851 | //then load it again every 30 seconds |
823 | - // var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
852 | + // var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
853 | + print ($globalMapRefresh*1000)/2; |
|
854 | +} else { |
|
855 | + print '15000'; |
|
856 | +} |
|
857 | +?>); |
|
824 | 858 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
825 | 859 | <?php |
826 | 860 | } else { |
827 | 861 | ?> |
828 | 862 | //then load it again every 30 seconds |
829 | - reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
863 | + reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
864 | + print $globalMapRefresh*1000; |
|
865 | +} else { |
|
866 | + print '30000'; |
|
867 | +} |
|
868 | +?>); |
|
830 | 869 | var currentdate = new Date(); |
831 | 870 | var currentyear = new Date().getFullYear(); |
832 | 871 | var begindate = new Date(Date.UTC(currentyear,11,24,2,0,0,0)); |
@@ -838,7 +877,12 @@ discard block |
||
838 | 877 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
839 | 878 | ?> |
840 | 879 | update_polarLayer(); |
841 | - setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
880 | + setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
881 | + print $globalMapRefresh*1000*2; |
|
882 | +} else { |
|
883 | + print '60000'; |
|
884 | +} |
|
885 | +?>); |
|
842 | 886 | <?php |
843 | 887 | } |
844 | 888 | ?> |
@@ -853,7 +897,12 @@ discard block |
||
853 | 897 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
854 | 898 | ?> |
855 | 899 | update_atcLayer(); |
856 | - setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
900 | + setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
901 | + print $globalMapRefresh*1000*2; |
|
902 | +} else { |
|
903 | + print '60000'; |
|
904 | +} |
|
905 | +?>); |
|
857 | 906 | <?php |
858 | 907 | } |
859 | 908 | ?> |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -156,9 +159,13 @@ discard block |
||
156 | 159 | if (callsign != ""){ markerMarineLabel += callsign; } |
157 | 160 | if (type != ""){ markerMarineLabel += ' - '+type; } |
158 | 161 | <?php |
159 | - if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
160 | - elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
161 | - else $MarineIconColor = '1a3151'; |
|
162 | + if (isset($_COOKIE['MarineIconColor'])) { |
|
163 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
164 | + } elseif (isset($globalMarineIconColor)) { |
|
165 | + $MarineIconColor = $globalMarineIconColor; |
|
166 | + } else { |
|
167 | + $MarineIconColor = '1a3151'; |
|
168 | + } |
|
162 | 169 | if (!isset($ident) && !isset($fammarine_id)) { |
163 | 170 | ?> |
164 | 171 | //info_marine_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -594,14 +616,24 @@ discard block |
||
594 | 616 | if (isset($archive) && $archive) { |
595 | 617 | ?> |
596 | 618 | //then load it again every 30 seconds |
597 | -// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
619 | +// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
620 | + print ($globalMapRefresh*1000)/2; |
|
621 | +} else { |
|
622 | + print '15000'; |
|
623 | +} |
|
624 | +?>); |
|
598 | 625 | reloadMarinePage = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php print $archiveupdatetime*1000; ?>); |
599 | 626 | <?php |
600 | 627 | } else { |
601 | 628 | ?> |
602 | 629 | //then load it again every 30 seconds |
603 | 630 | reloadMarinePage = setInterval( |
604 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
631 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
632 | + print $globalMapRefresh*1000; |
|
633 | +} else { |
|
634 | + print '30000'; |
|
635 | +} |
|
636 | +?>); |
|
605 | 637 | <?php |
606 | 638 | } |
607 | 639 | ?> |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -157,9 +160,13 @@ discard block |
||
157 | 160 | if (callsign != ""){ markerTrackerLabel += callsign; } |
158 | 161 | if (type != ""){ markerTrackerLabel += ' - '+type; } |
159 | 162 | <?php |
160 | - if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor']; |
|
161 | - elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor; |
|
162 | - else $IconColor = '1a3151'; |
|
163 | + if (isset($_COOKIE['TrackerIconColor'])) { |
|
164 | + $IconColor = $_COOKIE['TrackerIconColor']; |
|
165 | + } elseif (isset($globalTrackerIconColor)) { |
|
166 | + $IconColor = $globalTrackerIconColor; |
|
167 | + } else { |
|
168 | + $IconColor = '1a3151'; |
|
169 | + } |
|
163 | 170 | if (!isset($ident) && !isset($famtrackid)) { |
164 | 171 | ?> |
165 | 172 | //info_tracker_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -595,14 +617,24 @@ discard block |
||
595 | 617 | if (isset($archive) && $archive) { |
596 | 618 | ?> |
597 | 619 | //then load it again every 30 seconds |
598 | -// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
620 | +// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
621 | + print ($globalMapRefresh*1000)/2; |
|
622 | +} else { |
|
623 | + print '15000'; |
|
624 | +} |
|
625 | +?>); |
|
599 | 626 | reloadTrackerPage = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php print $archiveupdatetime*1000; ?>); |
600 | 627 | <?php |
601 | 628 | } else { |
602 | 629 | ?> |
603 | 630 | //then load it again every 30 seconds |
604 | 631 | reloadTrackerPage = setInterval( |
605 | - function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
632 | + function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
633 | + print $globalMapRefresh*1000; |
|
634 | +} else { |
|
635 | + print '30000'; |
|
636 | +} |
|
637 | +?>); |
|
606 | 638 | <?php |
607 | 639 | } |
608 | 640 | ?> |
@@ -74,7 +74,9 @@ discard block |
||
74 | 74 | if ($error != '') { |
75 | 75 | $_SESSION['error'] = $error; |
76 | 76 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Create database')); |
77 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
77 | + } else { |
|
78 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
79 | + } |
|
78 | 80 | $_SESSION['install'] = 'database_import'; |
79 | 81 | $_SESSION['next'] = 'Create and import tables'; |
80 | 82 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -89,7 +91,9 @@ discard block |
||
89 | 91 | if ($error != '') { |
90 | 92 | $_SESSION['error'] = $error; |
91 | 93 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Create and import tables')); |
92 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
94 | + } else { |
|
95 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
96 | + } |
|
93 | 97 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
94 | 98 | $_SESSION['install'] = 'populate'; |
95 | 99 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
@@ -104,7 +108,9 @@ discard block |
||
104 | 108 | if ($error != '') { |
105 | 109 | $_SESSION['error'] = $error; |
106 | 110 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Update schema if needed')); |
107 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
111 | + } else { |
|
112 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
113 | + } |
|
108 | 114 | $_SESSION['install'] = 'sources'; |
109 | 115 | $_SESSION['next'] = 'Insert data in source table'; |
110 | 116 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -117,7 +123,9 @@ discard block |
||
117 | 123 | if ($error != '') { |
118 | 124 | $_SESSION['error'] = $error; |
119 | 125 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate waypoints database')); |
120 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
126 | + } else { |
|
127 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
128 | + } |
|
121 | 129 | $_SESSION['install'] = 'airspace'; |
122 | 130 | $_SESSION['next'] = 'Populate airspace table'; |
123 | 131 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -129,7 +137,9 @@ discard block |
||
129 | 137 | if ($error != '') { |
130 | 138 | $_SESSION['error'] = $error; |
131 | 139 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate airspace database')); |
132 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
140 | + } else { |
|
141 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
142 | + } |
|
133 | 143 | $_SESSION['install'] = 'countries'; |
134 | 144 | $_SESSION['next'] = 'Populate countries table'; |
135 | 145 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -141,7 +151,9 @@ discard block |
||
141 | 151 | if ($error != '') { |
142 | 152 | $_SESSION['error'] = $error; |
143 | 153 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate countries database')); |
144 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
154 | + } else { |
|
155 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
156 | + } |
|
145 | 157 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
146 | 158 | $_SESSION['install'] = 'notam'; |
147 | 159 | $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
@@ -173,7 +185,9 @@ discard block |
||
173 | 185 | if ($error != '') { |
174 | 186 | $_SESSION['error'] = $error; |
175 | 187 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate aircraft_modes table with externals data for ADS-B')); |
176 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
188 | + } else { |
|
189 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
190 | + } |
|
177 | 191 | $_SESSION['install'] = 'populate_flarm'; |
178 | 192 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM'; |
179 | 193 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -194,18 +208,26 @@ discard block |
||
194 | 208 | if ($error != '') { |
195 | 209 | $_SESSION['error'] = $error; |
196 | 210 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate aircraft_modes table with externals data for FLARM')); |
197 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
211 | + } else { |
|
212 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
213 | + } |
|
198 | 214 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
199 | 215 | $_SESSION['install'] = 'vatsim'; |
200 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
201 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
216 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
217 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
218 | + } else { |
|
219 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
220 | + } |
|
202 | 221 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
203 | 222 | $_SESSION['install'] = 'vatsim'; |
204 | 223 | $_SESSION['next'] = 'Insert VATSIM data'; |
205 | 224 | } elseif (isset($globalIVAO) && $globalIVAO) { |
206 | 225 | $_SESSION['install'] = 'vatsim'; |
207 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
208 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
226 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
227 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
228 | + } else { |
|
229 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
230 | + } |
|
209 | 231 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
210 | 232 | $_SESSION['install'] = 'vatsim'; |
211 | 233 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -230,7 +252,9 @@ discard block |
||
230 | 252 | if ($error != '') { |
231 | 253 | $_SESSION['error'] = $error; |
232 | 254 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate routes table with externals data')); |
233 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
255 | + } else { |
|
256 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
257 | + } |
|
234 | 258 | $_SESSION['install'] = 'translation'; |
235 | 259 | $_SESSION['next'] = 'Populate translation table with externals data'; |
236 | 260 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -250,7 +274,9 @@ discard block |
||
250 | 274 | if ($error != '') { |
251 | 275 | $_SESSION['error'] = $error; |
252 | 276 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate translation table with externals data')); |
253 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
277 | + } else { |
|
278 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
279 | + } |
|
254 | 280 | if ($_SESSION['waypoints'] == 1) { |
255 | 281 | $_SESSION['install'] = 'waypoints'; |
256 | 282 | $_SESSION['next'] = 'Populate waypoints table'; |
@@ -283,7 +309,9 @@ discard block |
||
283 | 309 | if ($error != '') { |
284 | 310 | $_SESSION['error'] = $error; |
285 | 311 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate owner table with externals data')); |
286 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
312 | + } else { |
|
313 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
314 | + } |
|
287 | 315 | $_SESSION['install'] = 'sources'; |
288 | 316 | $_SESSION['next'] = 'Insert data in source table'; |
289 | 317 | $result = array('error' => $error,'errorlst' => $_SESSION['errorlst'],'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
@@ -304,12 +332,16 @@ discard block |
||
304 | 332 | if ($error != '') { |
305 | 333 | $_SESSION['error'] = $error; |
306 | 334 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate notam table with externals data')); |
307 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
335 | + } else { |
|
336 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
337 | + } |
|
308 | 338 | } else { |
309 | 339 | if ($error != '') { |
310 | 340 | $_SESSION['error'] = $error; |
311 | 341 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Populate notam table with externals data (no source defined)')); |
312 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
342 | + } else { |
|
343 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
344 | + } |
|
313 | 345 | } |
314 | 346 | if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
315 | 347 | $_SESSION['install'] = 'owner'; |
@@ -357,7 +389,9 @@ discard block |
||
357 | 389 | $Source = new Source(); |
358 | 390 | $Source->deleteAllLocation(); |
359 | 391 | foreach ($sources as $src) { |
360 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
392 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
393 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
394 | + } |
|
361 | 395 | } |
362 | 396 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
363 | 397 | unset($_SESSION['sources']); |
@@ -368,15 +402,21 @@ discard block |
||
368 | 402 | */ |
369 | 403 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
370 | 404 | $_SESSION['install'] = 'vatsim'; |
371 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
372 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
405 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
406 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
407 | + } else { |
|
408 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
409 | + } |
|
373 | 410 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
374 | 411 | $_SESSION['install'] = 'vatsim'; |
375 | 412 | $_SESSION['next'] = 'Insert VATSIM data'; |
376 | 413 | } elseif (isset($globalIVAO) && $globalIVAO) { |
377 | 414 | $_SESSION['install'] = 'vatsim'; |
378 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
379 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
415 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
416 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
417 | + } else { |
|
418 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
419 | + } |
|
380 | 420 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
381 | 421 | $_SESSION['install'] = 'vatsim'; |
382 | 422 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -397,33 +437,43 @@ discard block |
||
397 | 437 | if ($error != '') { |
398 | 438 | $_SESSION['error'] = $error; |
399 | 439 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Insert IVAO data')); |
400 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
440 | + } else { |
|
441 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
442 | + } |
|
401 | 443 | } else { |
402 | 444 | $error .= update_db::update_vatsim(); |
403 | 445 | if ($error != '') { |
404 | 446 | $_SESSION['error'] = $error; |
405 | 447 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Insert VATSIM data')); |
406 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
448 | + } else { |
|
449 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
450 | + } |
|
407 | 451 | } |
408 | 452 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
409 | 453 | $error .= update_db::update_vatsim(); |
410 | 454 | if ($error != '') { |
411 | 455 | $_SESSION['error'] = $error; |
412 | 456 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Insert VATSIM data')); |
413 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
457 | + } else { |
|
458 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
459 | + } |
|
414 | 460 | } elseif (isset($globalIVAO) && $globalIVAO) { |
415 | 461 | if (file_exists('tmp/ivae_feb2013.zip')) { |
416 | 462 | $error .= update_db::update_IVAO(); |
417 | 463 | if ($error != '') { |
418 | 464 | $_SESSION['error'] = $error; |
419 | 465 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Insert IVAO data')); |
420 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
466 | + } else { |
|
467 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
468 | + } |
|
421 | 469 | } else { |
422 | 470 | $error .= update_db::update_vatsim(); |
423 | 471 | if ($error != '') { |
424 | 472 | $_SESSION['error'] = $error; |
425 | 473 | $_SESSION['errorlst'] = array_merge($_SESSION['errorlst'],array('Insert VATSIM data (IVAO not found)')); |
426 | - } else $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
474 | + } else { |
|
475 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
476 | + } |
|
427 | 477 | } |
428 | 478 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
429 | 479 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data')); |
@@ -10,7 +10,9 @@ discard block |
||
10 | 10 | public static function import_file($filename) { |
11 | 11 | $filename = filter_var($filename,FILTER_SANITIZE_STRING); |
12 | 12 | $Connection = new Connection(); |
13 | - if (!$Connection->connectionExists()) return 'error: DB connection failed'; |
|
13 | + if (!$Connection->connectionExists()) { |
|
14 | + return 'error: DB connection failed'; |
|
15 | + } |
|
14 | 16 | //Connection::$db->beginTransaction(); |
15 | 17 | $templine = ''; |
16 | 18 | $handle = @fopen($filename,"r"); |
@@ -19,7 +21,9 @@ discard block |
||
19 | 21 | //foreach ($lines as $line) |
20 | 22 | while (($line = fgets($handle,4096)) !== false) |
21 | 23 | { |
22 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
24 | + if (substr($line,0,2) == '--' || $line == '') { |
|
25 | + continue; |
|
26 | + } |
|
23 | 27 | $templine .= $line; |
24 | 28 | if (substr(trim($line), -1,1) == ';') |
25 | 29 | { |
@@ -45,7 +49,9 @@ discard block |
||
45 | 49 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
46 | 50 | while(false !== ($filename = readdir($dh))) |
47 | 51 | { |
48 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
52 | + if (preg_match('/\.sql$/',$filename)) { |
|
53 | + $error .= create_db::import_file($directory.$filename); |
|
54 | + } |
|
49 | 55 | } |
50 | 56 | return $error; |
51 | 57 | } |
@@ -58,19 +64,29 @@ discard block |
||
58 | 64 | $db = filter_var($db,FILTER_SANITIZE_STRING); |
59 | 65 | $db_type = filter_var($db_type,FILTER_SANITIZE_STRING); |
60 | 66 | $host = filter_var($host,FILTER_SANITIZE_STRING); |
61 | - if ($db_type == 'mysql' && $port == '') $port = 3306; |
|
62 | - elseif ($port == '') $port = 5432; |
|
67 | + if ($db_type == 'mysql' && $port == '') { |
|
68 | + $port = 3306; |
|
69 | + } elseif ($port == '') { |
|
70 | + $port = 5432; |
|
71 | + } |
|
63 | 72 | // Dirty hack |
64 | 73 | if ($host != 'localhost' && $host != '127.0.0.1') { |
65 | 74 | $grantright = $_SERVER['SERVER_ADDR']; |
66 | - } else $grantright = 'localhost'; |
|
75 | + } else { |
|
76 | + $grantright = 'localhost'; |
|
77 | + } |
|
67 | 78 | try { |
68 | - if ($host == 'localhost') $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
69 | - else $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
79 | + if ($host == 'localhost') { |
|
80 | + $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
81 | + } else { |
|
82 | + $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
83 | + } |
|
70 | 84 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
71 | 85 | if ($db_type == 'mysql') { |
72 | 86 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
73 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
87 | + if ($grantright == 'localhost') { |
|
88 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
89 | + } |
|
74 | 90 | } else if ($db_type == 'pgsql') { |
75 | 91 | $dbh->exec("CREATE DATABASE ".$db.";"); |
76 | 92 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | public function __construct($dbc = null) { |
13 | 13 | $Connection = new Connection($dbc); |
14 | 14 | $this->db = $Connection->db(); |
15 | - if ($this->db === null) die('Error: No DB connection.'); |
|
15 | + if ($this->db === null) { |
|
16 | + die('Error: No DB connection.'); |
|
17 | + } |
|
16 | 18 | } |
17 | 19 | |
18 | 20 | public function get_tle($name) { |
@@ -24,8 +26,11 @@ discard block |
||
24 | 26 | echo $e->getMessage(); |
25 | 27 | } |
26 | 28 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
27 | - if (isset($result[0])) return $result[0]; |
|
28 | - else return array(); |
|
29 | + if (isset($result[0])) { |
|
30 | + return $result[0]; |
|
31 | + } else { |
|
32 | + return array(); |
|
33 | + } |
|
29 | 34 | } |
30 | 35 | public function get_tle_types() { |
31 | 36 | $query = 'SELECT DISTINCT tle_type FROM tle ORDER BY tle_type'; |
@@ -36,8 +41,11 @@ discard block |
||
36 | 41 | echo $e->getMessage(); |
37 | 42 | } |
38 | 43 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
39 | - if (isset($result[0])) return $result; |
|
40 | - else return array(); |
|
44 | + if (isset($result[0])) { |
|
45 | + return $result; |
|
46 | + } else { |
|
47 | + return array(); |
|
48 | + } |
|
41 | 49 | } |
42 | 50 | public function get_tle_names() { |
43 | 51 | $query = 'SELECT DISTINCT tle_name, tle_type FROM tle'; |
@@ -48,8 +56,11 @@ discard block |
||
48 | 56 | echo $e->getMessage(); |
49 | 57 | } |
50 | 58 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
51 | - if (isset($result[0])) return $result; |
|
52 | - else return array(); |
|
59 | + if (isset($result[0])) { |
|
60 | + return $result; |
|
61 | + } else { |
|
62 | + return array(); |
|
63 | + } |
|
53 | 64 | } |
54 | 65 | public function get_tle_names_type($type) { |
55 | 66 | $query = 'SELECT tle_name, tle_type FROM tle WHERE tle_type = :type ORDER BY tle_name'; |
@@ -60,8 +71,11 @@ discard block |
||
60 | 71 | echo $e->getMessage(); |
61 | 72 | } |
62 | 73 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
63 | - if (isset($result[0])) return $result; |
|
64 | - else return array(); |
|
74 | + if (isset($result[0])) { |
|
75 | + return $result; |
|
76 | + } else { |
|
77 | + return array(); |
|
78 | + } |
|
65 | 79 | } |
66 | 80 | |
67 | 81 | public function position_all($timestamp_begin = '',$timestamp_end = '',$second = 10) { |
@@ -79,8 +93,11 @@ discard block |
||
79 | 93 | $result = array(); |
80 | 94 | foreach ($all_sat as $sat) { |
81 | 95 | $position = $this->position($sat['tle_name'],$timestamp_begin,$timestamp_end,$second); |
82 | - if (isset($position[0])) $result = array_merge($position,$result); |
|
83 | - else $result[] = $position; |
|
96 | + if (isset($position[0])) { |
|
97 | + $result = array_merge($position,$result); |
|
98 | + } else { |
|
99 | + $result[] = $position; |
|
100 | + } |
|
84 | 101 | } |
85 | 102 | return $result; |
86 | 103 | } |
@@ -96,7 +113,9 @@ discard block |
||
96 | 113 | $sat = new Predict_Sat($tle); |
97 | 114 | $predict = new Predict(); |
98 | 115 | //if ($timestamp == '') $now = Predict_Time::get_current_daynum(); |
99 | - if ($timestamp_begin == '') $timestamp_begin = time(); |
|
116 | + if ($timestamp_begin == '') { |
|
117 | + $timestamp_begin = time(); |
|
118 | + } |
|
100 | 119 | if ($timestamp_end == '') { |
101 | 120 | $now = Predict_Time::unix2daynum($timestamp_begin); |
102 | 121 | $predict->predict_calc($sat,$qth,$now); |
@@ -121,8 +140,11 @@ discard block |
||
121 | 140 | echo $e->getMessage(); |
122 | 141 | } |
123 | 142 | $result = $sth->fetchAll(PDO::FETCH_ASSOC); |
124 | - if (isset($result[0])) return $result[0]; |
|
125 | - else return array(); |
|
143 | + if (isset($result[0])) { |
|
144 | + return $result[0]; |
|
145 | + } else { |
|
146 | + return array(); |
|
147 | + } |
|
126 | 148 | } |
127 | 149 | |
128 | 150 | /** |
@@ -140,7 +162,9 @@ discard block |
||
140 | 162 | FROM satellite".$filter_query." satellite.launch_site <> '' AND satellite.launch_site IS NOT NULL"; |
141 | 163 | $query_values = array(); |
142 | 164 | $query .= " GROUP BY satellite.launch_site ORDER BY launch_site_count DESC"; |
143 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
165 | + if ($limit) { |
|
166 | + $query .= " LIMIT 10 OFFSET 0"; |
|
167 | + } |
|
144 | 168 | $sth = $this->db->prepare($query); |
145 | 169 | $sth->execute($query_values); |
146 | 170 | $launch_site_array = array(); |
@@ -169,7 +193,9 @@ discard block |
||
169 | 193 | FROM satellite".$filter_query." satellite.owner <> '' AND satellite.owner IS NOT NULL"; |
170 | 194 | $query_values = array(); |
171 | 195 | $query .= " GROUP BY satellite.owner ORDER BY owner_count DESC"; |
172 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
196 | + if ($limit) { |
|
197 | + $query .= " LIMIT 10 OFFSET 0"; |
|
198 | + } |
|
173 | 199 | $sth = $this->db->prepare($query); |
174 | 200 | $sth->execute($query_values); |
175 | 201 | $owner_array = array(); |
@@ -198,7 +224,9 @@ discard block |
||
198 | 224 | FROM satellite".$filter_query." satellite.country_owner <> '' AND satellite.country_owner IS NOT NULL"; |
199 | 225 | $query_values = array(); |
200 | 226 | $query .= " GROUP BY satellite.country_owner ORDER BY country_count DESC"; |
201 | - if ($limit) $query .= " LIMIT 10 OFFSET 0"; |
|
227 | + if ($limit) { |
|
228 | + $query .= " LIMIT 10 OFFSET 0"; |
|
229 | + } |
|
202 | 230 | $sth = $this->db->prepare($query); |
203 | 231 | $sth->execute($query_values); |
204 | 232 | $owner_array = array(); |
@@ -225,20 +253,26 @@ discard block |
||
225 | 253 | date_default_timezone_set($globalTimezone); |
226 | 254 | $datetime = new DateTime(); |
227 | 255 | $offset = $datetime->format('P'); |
228 | - } else $offset = '+00:00'; |
|
256 | + } else { |
|
257 | + $offset = '+00:00'; |
|
258 | + } |
|
229 | 259 | //$filter_query = $this->getFilter($filters,true,true); |
230 | 260 | $filter_query = ' WHERE'; |
231 | 261 | if ($globalDBdriver == 'mysql') { |
232 | 262 | $query = "SELECT MONTH(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS month_name, YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
233 | 263 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 YEAR)"; |
234 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
264 | + if ($sincedate != '') { |
|
265 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
266 | + } |
|
235 | 267 | $query .= " GROUP BY year_name, month_name |
236 | 268 | ORDER BY year_name, month_name ASC"; |
237 | 269 | $query_data = array(':offset' => $offset); |
238 | 270 | } else { |
239 | 271 | $query = "SELECT EXTRACT(MONTH FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS month_name, EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
240 | 272 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '1 YEARS'"; |
241 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
273 | + if ($sincedate != '') { |
|
274 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
275 | + } |
|
242 | 276 | $query .= " GROUP BY year_name, month_name |
243 | 277 | ORDER BY year_name, month_name ASC"; |
244 | 278 | $query_data = array(':offset' => $offset); |
@@ -270,20 +304,26 @@ discard block |
||
270 | 304 | date_default_timezone_set($globalTimezone); |
271 | 305 | $datetime = new DateTime(); |
272 | 306 | $offset = $datetime->format('P'); |
273 | - } else $offset = '+00:00'; |
|
307 | + } else { |
|
308 | + $offset = '+00:00'; |
|
309 | + } |
|
274 | 310 | //$filter_query = $this->getFilter($filters,true,true); |
275 | 311 | $filter_query = ' WHERE'; |
276 | 312 | if ($globalDBdriver == 'mysql') { |
277 | 313 | $query = "SELECT YEAR(CONVERT_TZ(satellite.launch_date,'+00:00', :offset)) AS year_name, count(*) as date_count |
278 | 314 | FROM satellite".$filter_query." satellite.launch_date >= DATE_SUB(UTC_TIMESTAMP(),INTERVAL 10 YEAR)"; |
279 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
315 | + if ($sincedate != '') { |
|
316 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
317 | + } |
|
280 | 318 | $query .= " GROUP BY year_name |
281 | 319 | ORDER BY year_name ASC"; |
282 | 320 | $query_data = array(':offset' => $offset); |
283 | 321 | } else { |
284 | 322 | $query = "SELECT EXTRACT(YEAR FROM satellite.launch_date AT TIME ZONE INTERVAL :offset) AS year_name, count(*) as date_count |
285 | 323 | FROM satellite".$filter_query." satellite.launch_date >= CURRENT_TIMESTAMP AT TIME ZONE INTERVAL :offset - INTERVAL '10 YEARS'"; |
286 | - if ($sincedate != '') $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
324 | + if ($sincedate != '') { |
|
325 | + $query .= " AND satellite.launch_date > '".$sincedate."'"; |
|
326 | + } |
|
287 | 327 | $query .= " GROUP BY year_name |
288 | 328 | ORDER BY year_name ASC"; |
289 | 329 | $query_data = array(':offset' => $offset); |