@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
|
11 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
10 | +$country = ucwords(str_replace("-", " ", filter_input(INPUT_GET, 'country', FILTER_SANITIZE_STRING))); |
|
11 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | if (isset($_GET['sort'])) { |
14 | 14 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Routes from %s"),$country); |
|
21 | + $title = sprintf(_("Most Common Routes from %s"), $country); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="select-item">'; |
24 | 24 | print '<form action="'.$globalURL.'/country" method="post">'; |
25 | 25 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
26 | 26 | print '<option></option>'; |
27 | 27 | $all_countries = $Spotter->getAllCountries(); |
28 | - foreach($all_countries as $all_country) |
|
28 | + foreach ($all_countries as $all_country) |
|
29 | 29 | { |
30 | - if($country == $all_country['country']) |
|
30 | + if ($country == $all_country['country']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
33 | 33 | } else { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($_GET['country'] != "NA") |
43 | 43 | { |
44 | 44 | print '<div class="info column">'; |
45 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
45 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
46 | 46 | print '</div>'; |
47 | 47 | } else { |
48 | 48 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | include('country-sub-menu.php'); |
52 | 52 | print '<div class="column">'; |
53 | 53 | print '<h2>'._("Most Common Routes").'</h2>'; |
54 | - print '<p>'.sprintf(_("The statistic below shows the most common routes of airports & airlines from <strong>%s</strong>."),$country).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The statistic below shows the most common routes of airports & airlines from <strong>%s</strong>."), $country).'</p>'; |
|
55 | 55 | $route_array = $Spotter->countAllRoutesByCountry($country); |
56 | 56 | if (!empty($route_array)) |
57 | 57 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | print '</thead>'; |
67 | 67 | print '<tbody>'; |
68 | 68 | $i = 1; |
69 | - foreach($route_array as $route_item) |
|
69 | + foreach ($route_array as $route_item) |
|
70 | 70 | { |
71 | 71 | print '<tr>'; |
72 | 72 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['country'])) { |
6 | - header('Location: '.$globalURL.'/country'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/country'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $country = ucwords(str_replace("-", " ", filter_input(INPUT_GET,'country',FILTER_SANITIZE_STRING))); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['country'])) { |
6 | - header('Location: '.$globalURL.'/country'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/country'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | |
11 | 11 | $country = ucwords(str_replace("-", " ", $_GET['country'])); |
12 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
12 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
13 | 13 | $spotter_array = $Spotter->getSpotterDataByCountry($country, "0,1", $sort); |
14 | 14 | |
15 | 15 | if (!empty($spotter_array)) |
16 | 16 | { |
17 | - $title = sprintf(_("Most Common Aircraft from %s"),$country); |
|
17 | + $title = sprintf(_("Most Common Aircraft from %s"), $country); |
|
18 | 18 | |
19 | 19 | require_once('header.php'); |
20 | 20 | print '<div class="select-item">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | print '<select name="country" class="selectpicker" data-live-search="true">'; |
23 | 23 | print '<option></option>'; |
24 | 24 | $all_countries = $Spotter->getAllCountries(); |
25 | - foreach($all_countries as $all_country) |
|
25 | + foreach ($all_countries as $all_country) |
|
26 | 26 | { |
27 | - if($country == $all_country['country']) |
|
27 | + if ($country == $all_country['country']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.strtolower(str_replace(" ", "-", $all_country['country'])).'" selected="selected">'.$all_country['country'].'</option>'; |
30 | 30 | } else { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ($_GET['country'] != "NA") |
40 | 40 | { |
41 | 41 | print '<div class="info column">'; |
42 | - print '<h1>'.sprintf(_("Airports & Airlines from %s"),$country).'</h1>'; |
|
42 | + print '<h1>'.sprintf(_("Airports & Airlines from %s"), $country).'</h1>'; |
|
43 | 43 | print '</div>'; |
44 | 44 | } else { |
45 | 45 | print '<div class="alert alert-warning">'._("This special country profile shows all flights that do <u>not</u> have a country of a airline or departure/arrival airport associated with them.").'</div>'; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | include('country-sub-menu.php'); |
49 | 49 | print '<div class="column">'; |
50 | 50 | print '<h2>'._("Most Common Aircraft").'</h2>'; |
51 | - print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."),$country).'</p>'; |
|
51 | + print '<p>'.sprintf(_("The statistic below shows the most common aircrafts of flights from <strong>%s</strong>."), $country).'</p>'; |
|
52 | 52 | |
53 | 53 | $aircraft_array = $Spotter->countAllAircraftTypesByCountry($country); |
54 | 54 | if (!empty($aircraft_array)) |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '</thead>'; |
63 | 63 | print '<tbody>'; |
64 | 64 | $i = 1; |
65 | - foreach($aircraft_array as $aircraft_item) |
|
65 | + foreach ($aircraft_array as $aircraft_item) |
|
66 | 66 | { |
67 | 67 | print '<tr>'; |
68 | 68 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,17 +3,17 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | |
6 | -if (!isset($_GET['registration'])){ |
|
6 | +if (!isset($_GET['registration'])) { |
|
7 | 7 | header('Location: '.$globalURL.''); |
8 | 8 | } else { |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | //calculuation for the pagination |
11 | - if(!isset($_GET['limit'])) |
|
11 | + if (!isset($_GET['limit'])) |
|
12 | 12 | { |
13 | 13 | $limit_start = 0; |
14 | 14 | $limit_end = 25; |
15 | 15 | $absolute_difference = 25; |
16 | - } else { |
|
16 | + } else { |
|
17 | 17 | $limit_explode = explode(",", $_GET['limit']); |
18 | 18 | $limit_start = $limit_explode[0]; |
19 | 19 | $limit_end = $limit_explode[1]; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $limit_next = $limit_end + $absolute_difference; |
27 | 27 | $limit_previous_1 = $limit_start - $absolute_difference; |
28 | 28 | $limit_previous_2 = $limit_end - $absolute_difference; |
29 | - $registration = filter_input(INPUT_GET,'registration',FILTER_SANITIZE_STRING); |
|
30 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
29 | + $registration = filter_input(INPUT_GET, 'registration', FILTER_SANITIZE_STRING); |
|
30 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
31 | 31 | |
32 | 32 | $page_url = $globalURL.'/registration/'.$registration; |
33 | 33 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | if (!empty($spotter_array)) |
42 | 42 | { |
43 | - $title = sprintf(_("Detailed View of aircraft with registration %s"),$registration); |
|
43 | + $title = sprintf(_("Detailed View of aircraft with registration %s"), $registration); |
|
44 | 44 | require_once('header.php'); |
45 | 45 | print '<div class="info column">'; |
46 | 46 | print '<h1>'.$registration.' - '.$aircraft_array[0]['aircraft_name'].' ('.$aircraft_array[0]['aircraft_icao'].')</h1>'; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | include('registration-sub-menu.php'); |
53 | 53 | print '<div class="table column">'; |
54 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights of aircraft with the registration <strong>%s</strong>."),$registration).'</p>'; |
|
54 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights of aircraft with the registration <strong>%s</strong>."), $registration).'</p>'; |
|
55 | 55 | |
56 | 56 | include('table-output.php'); |
57 | 57 | print '<div class="pagination">'; |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Aircraft Manufacturer of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Aircraft Manufacturer of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Aircraft Manufacturer").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights using the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows the most common Aircraft Manufacturer of flights using the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | |
29 | 29 | $manufacturers_array = $Spotter->countAllAircraftManufacturerByIdent($ident); |
30 | 30 | if (!empty($manufacturers_array)) |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | print '</thead>'; |
40 | 40 | print '<tbody>'; |
41 | 41 | $i = 1; |
42 | - foreach($manufacturers_array as $manufacturer_item) |
|
42 | + foreach ($manufacturers_array as $manufacturer_item) |
|
43 | 43 | { |
44 | 44 | print '<tr>'; |
45 | 45 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | if (!isset($_GET['ident'])) { |
6 | - header('Location: '.$globalURL.'/ident'); |
|
7 | - die(); |
|
6 | + header('Location: '.$globalURL.'/ident'); |
|
7 | + die(); |
|
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | 10 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | <?php |
5 | 5 | if (isset($sql_time)) { |
6 | 6 | ?> |
7 | - <i><?php echo _("Page generated in").' '.round($sql_time+$page_time,2); ?>s (<?php print round($page_time,2); ?>ms PHP - <?php print round($sql_time,2); ?>ms SQL)</i> |
|
7 | + <i><?php echo _("Page generated in").' '.round($sql_time + $page_time, 2); ?>s (<?php print round($page_time, 2); ?>ms PHP - <?php print round($sql_time, 2); ?>ms SQL)</i> |
|
8 | 8 | <br /> |
9 | 9 | <?php |
10 | 10 | } |
@@ -6,12 +6,12 @@ |
||
6 | 6 | </div> |
7 | 7 | <footer class="container"> |
8 | 8 | <?php |
9 | - if (isset($sql_time)) { |
|
9 | + if (isset($sql_time)) { |
|
10 | 10 | ?> |
11 | 11 | <i><?php echo _("Page generated in").' '.round($sql_time+$page_time,2); ?>s (<?php print round($page_time,2); ?>ms PHP - <?php print round($sql_time,2); ?>ms SQL)</i> |
12 | 12 | <br /> |
13 | 13 | <?php |
14 | - } |
|
14 | + } |
|
15 | 15 | ?> |
16 | 16 | <span>Developed in Barrie by <a href="http://mtru.nz/" target="_blank">Mario Trunz</a> & at <a href="http://www.zugaina.com" target="_blank">Zugaina</a> by Ycarus</span> - <span><a href="<?php if (isset($globalURL)) print $globalURL; ?>/about#source">Source & Credits</a></span> - <span><a href="https://www.flightairmap.fr/" target="_blank">Get source code</a></span> |
17 | 17 | </footer> |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $page_url = $globalURL.'/tools-acars'; |
10 | 10 | |
11 | -$message = filter_input(INPUT_POST,'acars_message',FILTER_SANITIZE_STRING); |
|
11 | +$message = filter_input(INPUT_POST, 'acars_message', FILTER_SANITIZE_STRING); |
|
12 | 12 | |
13 | 13 | print '<div class="info column">'; |
14 | 14 | print '<h1>'._("Parse ACARS messages").'</h1>'; |
@@ -1,23 +1,23 @@ |
||
1 | 1 | #!/usr/bin/php |
2 | 2 | <?php |
3 | - require_once('../require/settings.php'); |
|
4 | - if ($globalInstalled) { |
|
5 | - echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | - exit; |
|
7 | - } |
|
8 | - require('class.update_db.php'); |
|
9 | - if (isset($globalVATSIM) && $globalVATSIM) { |
|
3 | + require_once('../require/settings.php'); |
|
4 | + if ($globalInstalled) { |
|
5 | + echo '$globalInstalled must be set to FALSE in require/settings.php'; |
|
6 | + exit; |
|
7 | + } |
|
8 | + require('class.update_db.php'); |
|
9 | + if (isset($globalVATSIM) && $globalVATSIM) { |
|
10 | 10 | echo "Install VATSIM airlines..."; |
11 | 11 | update_db::update_vatsim(); |
12 | 12 | echo "Done !\n"; |
13 | - } |
|
14 | - if (isset($globalIVAO) && $globalIVAO) { |
|
13 | + } |
|
14 | + if (isset($globalIVAO) && $globalIVAO) { |
|
15 | 15 | if (!file_exists('tmp/ivae_feb2013.zip')) { |
16 | 16 | echo "You have to download the file ivae_feb2013.zip from https://www.ivao.aero/softdev/mirrors.asp?software=IvAeDataUp and put it in install/tmp directory"; |
17 | 17 | } else { |
18 | - echo "Install IVAO airlines and logos..."; |
|
19 | - update_db::update_IVAO(); |
|
18 | + echo "Install IVAO airlines and logos..."; |
|
19 | + update_db::update_IVAO(); |
|
20 | 20 | echo "Done !\n"; |
21 | 21 | } |
22 | - } |
|
22 | + } |
|
23 | 23 | ?> |
24 | 24 | \ No newline at end of file |
@@ -10,37 +10,37 @@ discard block |
||
10 | 10 | |
11 | 11 | # to document: CGIParams |
12 | 12 | |
13 | -function sparql_connect( $endpoint ) { return new sparql_connection( $endpoint ); } |
|
13 | +function sparql_connect($endpoint) { return new sparql_connection($endpoint); } |
|
14 | 14 | |
15 | -function sparql_ns( $short, $long, $db = null ) { return _sparql_a_connection( $db )->ns( $short, $long ); } |
|
16 | -function sparql_query( $sparql, $db = null ) { return _sparql_a_connection( $db )->query( $sparql ); } |
|
17 | -function sparql_errno( $db = null ) { return _sparql_a_connection( $db )->errno(); } |
|
18 | -function sparql_error( $db = null ) { return _sparql_a_connection( $db )->error(); } |
|
15 | +function sparql_ns($short, $long, $db = null) { return _sparql_a_connection($db)->ns($short, $long); } |
|
16 | +function sparql_query($sparql, $db = null) { return _sparql_a_connection($db)->query($sparql); } |
|
17 | +function sparql_errno($db = null) { return _sparql_a_connection($db)->errno(); } |
|
18 | +function sparql_error($db = null) { return _sparql_a_connection($db)->error(); } |
|
19 | 19 | |
20 | -function sparql_fetch_array( $result ) { return $result->fetch_array(); } |
|
21 | -function sparql_num_rows( $result ) { return $result->num_rows(); } |
|
22 | -function sparql_field_array( $result ) { return $result->field_array(); } |
|
23 | -function sparql_field_name( $result, $i ) { return $result->field_name( $i ); } |
|
20 | +function sparql_fetch_array($result) { return $result->fetch_array(); } |
|
21 | +function sparql_num_rows($result) { return $result->num_rows(); } |
|
22 | +function sparql_field_array($result) { return $result->field_array(); } |
|
23 | +function sparql_field_name($result, $i) { return $result->field_name($i); } |
|
24 | 24 | |
25 | -function sparql_fetch_all( $result ) { return $result->fetch_all(); } |
|
25 | +function sparql_fetch_all($result) { return $result->fetch_all(); } |
|
26 | 26 | |
27 | -function sparql_get( $endpoint, $sparql ) |
|
27 | +function sparql_get($endpoint, $sparql) |
|
28 | 28 | { |
29 | - $db = sparql_connect( $endpoint ); |
|
30 | - if( !$db ) { return; } |
|
31 | - $result = $db->query( $sparql ); |
|
32 | - if( !$result ) { return; } |
|
29 | + $db = sparql_connect($endpoint); |
|
30 | + if (!$db) { return; } |
|
31 | + $result = $db->query($sparql); |
|
32 | + if (!$result) { return; } |
|
33 | 33 | return $result->fetch_all(); |
34 | 34 | } |
35 | 35 | |
36 | -function _sparql_a_connection( $db ) |
|
36 | +function _sparql_a_connection($db) |
|
37 | 37 | { |
38 | 38 | global $sparql_last_connection; |
39 | - if( !isset( $db ) ) |
|
39 | + if (!isset($db)) |
|
40 | 40 | { |
41 | - if( !isset( $sparql_last_connection ) ) |
|
41 | + if (!isset($sparql_last_connection)) |
|
42 | 42 | { |
43 | - print( "No currect SPARQL connection (connection) in play!" ); |
|
43 | + print("No currect SPARQL connection (connection) in play!"); |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | $db = $sparql_last_connection; |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | var $params = null; |
63 | 63 | # capabilities are either true, false or null if not yet tested. |
64 | 64 | |
65 | - function __construct( $endpoint ) |
|
65 | + function __construct($endpoint) |
|
66 | 66 | { |
67 | 67 | $this->endpoint = $endpoint; |
68 | 68 | global $sparql_last_connection; |
69 | 69 | $sparql_last_connection = $this; |
70 | 70 | } |
71 | 71 | |
72 | - function ns( $short, $long ) |
|
72 | + function ns($short, $long) |
|
73 | 73 | { |
74 | 74 | $this->ns[$short] = $long; |
75 | 75 | } |
@@ -77,77 +77,77 @@ discard block |
||
77 | 77 | function errno() { return $this->errno; } |
78 | 78 | function error() { return $this->error; } |
79 | 79 | |
80 | - function cgiParams( $params = null ) |
|
80 | + function cgiParams($params = null) |
|
81 | 81 | { |
82 | - if( $params === null ) { return $this->params; } |
|
83 | - if( $params === "" ) { $this->params = null; return; } |
|
82 | + if ($params === null) { return $this->params; } |
|
83 | + if ($params === "") { $this->params = null; return; } |
|
84 | 84 | $this->params = $params; |
85 | 85 | } |
86 | 86 | |
87 | - function query( $query, $timeout=null ) |
|
87 | + function query($query, $timeout = null) |
|
88 | 88 | { |
89 | 89 | $prefixes = ""; |
90 | - foreach( $this->ns as $k=>$v ) |
|
90 | + foreach ($this->ns as $k=>$v) |
|
91 | 91 | { |
92 | 92 | $prefixes .= "PREFIX $k: <$v>\n"; |
93 | 93 | } |
94 | - $output = $this->dispatchQuery( $prefixes.$query, $timeout ); |
|
95 | - if( $this->errno ) { return; } |
|
94 | + $output = $this->dispatchQuery($prefixes.$query, $timeout); |
|
95 | + if ($this->errno) { return; } |
|
96 | 96 | $parser = new xx_xml($output, 'contents'); |
97 | - if( $parser->error() ) |
|
97 | + if ($parser->error()) |
|
98 | 98 | { |
99 | 99 | $this->errno = -1; # to not clash with CURLOPT return; } |
100 | 100 | $this->error = $parser->error(); |
101 | 101 | return; |
102 | 102 | } |
103 | - return new sparql_result( $this, $parser->rows, $parser->fields ); |
|
103 | + return new sparql_result($this, $parser->rows, $parser->fields); |
|
104 | 104 | } |
105 | 105 | |
106 | - function alive( $timeout=3 ) |
|
106 | + function alive($timeout = 3) |
|
107 | 107 | { |
108 | - $result = $this->query( "SELECT * WHERE { ?s ?p ?o } LIMIT 1", $timeout ); |
|
108 | + $result = $this->query("SELECT * WHERE { ?s ?p ?o } LIMIT 1", $timeout); |
|
109 | 109 | |
110 | - if( $this->errno ) { return false; } |
|
110 | + if ($this->errno) { return false; } |
|
111 | 111 | |
112 | 112 | return true; |
113 | 113 | } |
114 | 114 | |
115 | - function dispatchQuery( $sparql, $timeout=null ) |
|
115 | + function dispatchQuery($sparql, $timeout = null) |
|
116 | 116 | { |
117 | - $url = $this->endpoint."?query=".urlencode( $sparql ); |
|
118 | - if( $this->params !== null ) |
|
117 | + $url = $this->endpoint."?query=".urlencode($sparql); |
|
118 | + if ($this->params !== null) |
|
119 | 119 | { |
120 | 120 | $url .= "&".$this->params; |
121 | 121 | } |
122 | - if( $this->debug ) { print "<div class='debug'><a href='".htmlspecialchars($url)."'>".htmlspecialchars($prefixes.$query)."</a></div>\n"; } |
|
122 | + if ($this->debug) { print "<div class='debug'><a href='".htmlspecialchars($url)."'>".htmlspecialchars($prefixes.$query)."</a></div>\n"; } |
|
123 | 123 | $this->errno = null; |
124 | 124 | $this->error = null; |
125 | 125 | $ch = curl_init($url); |
126 | 126 | #curl_setopt($ch, CURLOPT_HEADER, 1); |
127 | - if( $timeout !== null ) |
|
127 | + if ($timeout !== null) |
|
128 | 128 | { |
129 | - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ); |
|
129 | + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
|
130 | 130 | } |
131 | 131 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
132 | - curl_setopt($ch, CURLOPT_HTTPHEADER,array ( |
|
132 | + curl_setopt($ch, CURLOPT_HTTPHEADER, array( |
|
133 | 133 | "Accept: application/sparql-results+xml" |
134 | 134 | )); |
135 | 135 | |
136 | 136 | $output = curl_exec($ch); |
137 | 137 | $info = curl_getinfo($ch); |
138 | - if(curl_errno($ch)) |
|
138 | + if (curl_errno($ch)) |
|
139 | 139 | { |
140 | - $this->errno = curl_errno( $ch ); |
|
141 | - $this->error = 'Curl error: ' . curl_error($ch); |
|
140 | + $this->errno = curl_errno($ch); |
|
141 | + $this->error = 'Curl error: '.curl_error($ch); |
|
142 | 142 | return; |
143 | 143 | } |
144 | - if( $output === '' ) |
|
144 | + if ($output === '') |
|
145 | 145 | { |
146 | 146 | $this->errno = "-1"; |
147 | 147 | $this->error = 'URL returned no data'; |
148 | 148 | return; |
149 | 149 | } |
150 | - if( $info['http_code'] != 200) |
|
150 | + if ($info['http_code'] != 200) |
|
151 | 151 | { |
152 | 152 | $this->errno = $info['http_code']; |
153 | 153 | $this->error = 'Bad response, '.$info['http_code'].': '.$output; |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | |
180 | 180 | var $caps_cache; |
181 | 181 | var $caps_anysubject; |
182 | - function capabilityCache( $filename, $dba_type='db4' ) |
|
182 | + function capabilityCache($filename, $dba_type = 'db4') |
|
183 | 183 | { |
184 | - $this->caps_cache = dba_open($filename, "c", $dba_type ); |
|
184 | + $this->caps_cache = dba_open($filename, "c", $dba_type); |
|
185 | 185 | } |
186 | 186 | function capabilityCodes() |
187 | 187 | { |
188 | - return array_keys( $this->caps_desc ); |
|
188 | + return array_keys($this->caps_desc); |
|
189 | 189 | } |
190 | 190 | function capabilityDescription($code) |
191 | 191 | { |
@@ -194,19 +194,19 @@ discard block |
||
194 | 194 | |
195 | 195 | # return true if the endpoint supports a capability |
196 | 196 | # nb. returns false if connecion isn't authoriased to use the feature, eg LOAD |
197 | - function supports( $code ) |
|
197 | + function supports($code) |
|
198 | 198 | { |
199 | - if( isset( $this->caps[$code] ) ) { return $this->caps[$code]; } |
|
199 | + if (isset($this->caps[$code])) { return $this->caps[$code]; } |
|
200 | 200 | $was_cached = false; |
201 | - if( isset( $this->caps_cache ) ) |
|
201 | + if (isset($this->caps_cache)) |
|
202 | 202 | { |
203 | 203 | $CACHE_TIMEOUT_SECONDS = 7*24*60*60; |
204 | 204 | $db_key = $this->endpoint.";".$code; |
205 | - $db_val = dba_fetch( $db_key, $this->caps_cache ); |
|
206 | - if( $db_val !== false ) |
|
205 | + $db_val = dba_fetch($db_key, $this->caps_cache); |
|
206 | + if ($db_val !== false) |
|
207 | 207 | { |
208 | - list( $result, $when ) = preg_split( '/;/', $db_val ); |
|
209 | - if( $when + $CACHE_TIMEOUT_SECONDS > time() ) |
|
208 | + list($result, $when) = preg_split('/;/', $db_val); |
|
209 | + if ($when + $CACHE_TIMEOUT_SECONDS > time()) |
|
210 | 210 | { |
211 | 211 | return $result; |
212 | 212 | } |
@@ -215,26 +215,26 @@ discard block |
||
215 | 215 | } |
216 | 216 | $r = null; |
217 | 217 | |
218 | - if( $code == "select" ) { $r = $this->test_select(); } |
|
219 | - elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } |
|
220 | - elseif( $code == "math_as" ) { $r = $this->test_math_as(); } |
|
221 | - elseif( $code == "count" ) { $r = $this->test_count(); } |
|
222 | - elseif( $code == "max" ) { $r = $this->test_max(); } |
|
223 | - elseif( $code == "load" ) { $r = $this->test_load(); } |
|
224 | - elseif( $code == "sample" ) { $r = $this->test_sample(); } |
|
218 | + if ($code == "select") { $r = $this->test_select(); } |
|
219 | + elseif ($code == "constant_as") { $r = $this->test_constant_as(); } |
|
220 | + elseif ($code == "math_as") { $r = $this->test_math_as(); } |
|
221 | + elseif ($code == "count") { $r = $this->test_count(); } |
|
222 | + elseif ($code == "max") { $r = $this->test_max(); } |
|
223 | + elseif ($code == "load") { $r = $this->test_load(); } |
|
224 | + elseif ($code == "sample") { $r = $this->test_sample(); } |
|
225 | 225 | else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
226 | 226 | $this->caps[$code] = $r; |
227 | - if( isset( $this->caps_cache ) ) |
|
227 | + if (isset($this->caps_cache)) |
|
228 | 228 | { |
229 | 229 | $db_key = $this->endpoint.";".$code; |
230 | 230 | $db_val = $r.";".time(); |
231 | - if( $was_cached ) |
|
231 | + if ($was_cached) |
|
232 | 232 | { |
233 | - dba_replace( $db_key, $db_val, $this->caps_cache ); |
|
233 | + dba_replace($db_key, $db_val, $this->caps_cache); |
|
234 | 234 | } |
235 | 235 | else |
236 | 236 | { |
237 | - dba_insert( $db_key, $db_val, $this->caps_cache ); |
|
237 | + dba_insert($db_key, $db_val, $this->caps_cache); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | return $r; |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | |
243 | 243 | function anySubject() |
244 | 244 | { |
245 | - if( !isset( $this->caps_anysubject ) ) |
|
245 | + if (!isset($this->caps_anysubject)) |
|
246 | 246 | { |
247 | 247 | $results = $this->query( |
248 | 248 | "SELECT * WHERE { ?s ?p ?o } LIMIT 1" ); |
249 | - if( sizeof($results)) |
|
249 | + if (sizeof($results)) |
|
250 | 250 | { |
251 | 251 | $row = $results->fetch_array(); |
252 | 252 | $this->caps_anysubject = $row["s"]; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | $output = $this->dispatchQuery( |
262 | 262 | "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 1" ); |
263 | - return !isset( $this->errno ); |
|
263 | + return !isset($this->errno); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | # return true if the endpoint supports AS |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | { |
269 | 269 | $output = $this->dispatchQuery( |
270 | 270 | "SELECT (1+2 AS ?bar) WHERE { ?s ?p ?o } LIMIT 1" ); |
271 | - return !isset( $this->errno ); |
|
271 | + return !isset($this->errno); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | # return true if the endpoint supports AS |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | $output = $this->dispatchQuery( |
278 | 278 | "SELECT (\"foo\" AS ?bar) WHERE { ?s ?p ?o } LIMIT 1" ); |
279 | - return !isset( $this->errno ); |
|
279 | + return !isset($this->errno); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | # return true if the endpoint supports SELECT (COUNT(?x) as ?n) ... GROUP BY |
@@ -284,35 +284,35 @@ discard block |
||
284 | 284 | { |
285 | 285 | # assumes at least one rdf:type predicate |
286 | 286 | $s = $this->anySubject(); |
287 | - if( !isset($s) ) { return false; } |
|
287 | + if (!isset($s)) { return false; } |
|
288 | 288 | $output = $this->dispatchQuery( |
289 | 289 | "SELECT (COUNT(?p) AS ?n) ?o WHERE { <$s> ?p ?o } GROUP BY ?o" ); |
290 | - return !isset( $this->errno ); |
|
290 | + return !isset($this->errno); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | function test_max() |
294 | 294 | { |
295 | 295 | $s = $this->anySubject(); |
296 | - if( !isset($s) ) { return false; } |
|
296 | + if (!isset($s)) { return false; } |
|
297 | 297 | $output = $this->dispatchQuery( |
298 | 298 | "SELECT (MAX(?p) AS ?max) ?o WHERE { <$s> ?p ?o } GROUP BY ?o" ); |
299 | - return !isset( $this->errno ); |
|
299 | + return !isset($this->errno); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | function test_sample() |
303 | 303 | { |
304 | 304 | $s = $this->anySubject(); |
305 | - if( !isset($s) ) { return false; } |
|
305 | + if (!isset($s)) { return false; } |
|
306 | 306 | $output = $this->dispatchQuery( |
307 | 307 | "SELECT (SAMPLE(?p) AS ?sam) ?o WHERE { <$s> ?p ?o } GROUP BY ?o" ); |
308 | - return !isset( $this->errno ); |
|
308 | + return !isset($this->errno); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | function test_load() |
312 | 312 | { |
313 | 313 | $output = $this->dispatchQuery( |
314 | 314 | "LOAD <http://graphite.ecs.soton.ac.uk/sparqllib/examples/loadtest.rdf>" ); |
315 | - return !isset( $this->errno ); |
|
315 | + return !isset($this->errno); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | var $fields; |
325 | 325 | var $db; |
326 | 326 | var $i = 0; |
327 | - function __construct( $db, $rows, $fields ) |
|
327 | + function __construct($db, $rows, $fields) |
|
328 | 328 | { |
329 | 329 | $this->rows = $rows; |
330 | 330 | $this->fields = $fields; |
@@ -333,17 +333,17 @@ discard block |
||
333 | 333 | |
334 | 334 | function fetch_array() |
335 | 335 | { |
336 | - if( !@$this->rows[$this->i] ) { return; } |
|
336 | + if (!@$this->rows[$this->i]) { return; } |
|
337 | 337 | $r = array(); |
338 | - foreach( $this->rows[$this->i++] as $k=>$v ) |
|
338 | + foreach ($this->rows[$this->i++] as $k=>$v) |
|
339 | 339 | { |
340 | 340 | $r[$k] = $v["value"]; |
341 | 341 | $r["$k.type"] = $v["type"]; |
342 | - if( isset( $v["language"] ) ) |
|
342 | + if (isset($v["language"])) |
|
343 | 343 | { |
344 | 344 | $r["$k.language"] = $v["language"]; |
345 | 345 | } |
346 | - if( isset( $v["datatype"] ) ) |
|
346 | + if (isset($v["datatype"])) |
|
347 | 347 | { |
348 | 348 | $r["$k.datatype"] = $v["datatype"]; |
349 | 349 | } |
@@ -355,16 +355,16 @@ discard block |
||
355 | 355 | { |
356 | 356 | $r = new sparql_results(); |
357 | 357 | $r->fields = $this->fields; |
358 | - foreach( $this->rows as $i=>$row ) |
|
358 | + foreach ($this->rows as $i=>$row) |
|
359 | 359 | { |
360 | - $r []= $this->fetch_array(); |
|
360 | + $r [] = $this->fetch_array(); |
|
361 | 361 | } |
362 | 362 | return $r; |
363 | 363 | } |
364 | 364 | |
365 | 365 | function num_rows() |
366 | 366 | { |
367 | - return sizeof( $this->rows ); |
|
367 | + return sizeof($this->rows); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | function field_array() |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | var $type; |
401 | 401 | |
402 | 402 | // function with the default parameter value |
403 | - function xx_xml($url='http://www.opocot.com', $type='url') { |
|
403 | + function xx_xml($url = 'http://www.opocot.com', $type = 'url') { |
|
404 | 404 | $this->type = $type; |
405 | 405 | $this->url = $url; |
406 | 406 | $this->parse(); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $this->rows = array(); |
415 | 415 | $this->fields = array(); |
416 | 416 | $data = ''; |
417 | - $this->parser = xml_parser_create ("UTF-8"); |
|
417 | + $this->parser = xml_parser_create("UTF-8"); |
|
418 | 418 | xml_set_object($this->parser, $this); |
419 | 419 | xml_set_element_handler($this->parser, 'startXML', 'endXML'); |
420 | 420 | xml_set_character_data_handler($this->parser, 'charXML'); |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | } else if ($this->type == 'contents') { |
440 | 440 | // Now we can pass the contents, maybe if you want |
441 | 441 | // to use CURL, SOCK or other method. |
442 | - $lines = explode("\n",$this->url); |
|
442 | + $lines = explode("\n", $this->url); |
|
443 | 443 | foreach ($lines as $val) { |
444 | - $data = $val . "\n"; |
|
444 | + $data = $val."\n"; |
|
445 | 445 | if (!xml_parse($this->parser, $data)) { |
446 | 446 | $this->error = $data."\n".sprintf('XML error at line %d column %d', |
447 | 447 | xml_get_current_line_number($this->parser), |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | } |
453 | - if( !$this->looks_legit ) |
|
453 | + if (!$this->looks_legit) |
|
454 | 454 | { |
455 | 455 | $this->error = "Didn't even see a sparql element, is this really an endpoint?"; |
456 | 456 | } |
@@ -458,53 +458,53 @@ discard block |
||
458 | 458 | |
459 | 459 | function startXML($parser, $name, $attr) |
460 | 460 | { |
461 | - if( $name == "sparql" ) { $this->looks_legit = true; } |
|
462 | - if( $name == "result" ) |
|
461 | + if ($name == "sparql") { $this->looks_legit = true; } |
|
462 | + if ($name == "result") |
|
463 | 463 | { |
464 | 464 | $this->result = array(); |
465 | 465 | } |
466 | - if( $name == "binding" ) |
|
466 | + if ($name == "binding") |
|
467 | 467 | { |
468 | 468 | $this->part = $attr["name"]; |
469 | 469 | } |
470 | - if( $name == "uri" || $name == "bnode" ) |
|
470 | + if ($name == "uri" || $name == "bnode") |
|
471 | 471 | { |
472 | 472 | $this->part_type = $name; |
473 | 473 | $this->chars = ""; |
474 | 474 | } |
475 | - if( $name == "literal" ) |
|
475 | + if ($name == "literal") |
|
476 | 476 | { |
477 | 477 | $this->part_type = "literal"; |
478 | - if( isset( $attr["datatype"] ) ) |
|
478 | + if (isset($attr["datatype"])) |
|
479 | 479 | { |
480 | 480 | $this->part_datatype = $attr["datatype"]; |
481 | 481 | } |
482 | - if( isset( $attr["xml:lang"] ) ) |
|
482 | + if (isset($attr["xml:lang"])) |
|
483 | 483 | { |
484 | 484 | $this->part_lang = $attr["xml:lang"]; |
485 | 485 | } |
486 | 486 | $this->chars = ""; |
487 | 487 | } |
488 | - if( $name == "variable" ) |
|
488 | + if ($name == "variable") |
|
489 | 489 | { |
490 | 490 | $this->fields[] = $attr["name"]; |
491 | 491 | } |
492 | 492 | } |
493 | 493 | |
494 | - function endXML($parser, $name) { |
|
495 | - if( $name == "result" ) |
|
494 | + function endXML($parser, $name) { |
|
495 | + if ($name == "result") |
|
496 | 496 | { |
497 | 497 | $this->rows[] = $this->result; |
498 | 498 | $this->result = array(); |
499 | 499 | } |
500 | - if( $name == "uri" || $name == "bnode" || $name == "literal" ) |
|
500 | + if ($name == "uri" || $name == "bnode" || $name == "literal") |
|
501 | 501 | { |
502 | - $this->result[$this->part] = array( "type"=>$name, "value"=>$this->chars ); |
|
503 | - if( isset( $this->part_lang ) ) |
|
502 | + $this->result[$this->part] = array("type"=>$name, "value"=>$this->chars); |
|
503 | + if (isset($this->part_lang)) |
|
504 | 504 | { |
505 | 505 | $this->result[$this->part]["lang"] = $this->part_lang; |
506 | 506 | } |
507 | - if( isset( $this->part_datatype ) ) |
|
507 | + if (isset($this->part_datatype)) |
|
508 | 508 | { |
509 | 509 | $this->result[$this->part]["datatype"] = $this->part_datatype; |
510 | 510 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
516 | - function charXML($parser, $data) { |
|
516 | + function charXML($parser, $data) { |
|
517 | 517 | @$this->chars .= $data; |
518 | 518 | } |
519 | 519 | |
@@ -527,28 +527,28 @@ discard block |
||
527 | 527 | function render_table() |
528 | 528 | { |
529 | 529 | $html = "<table class='sparql-results'><tr>"; |
530 | - foreach( $this->fields as $i=>$field ) |
|
530 | + foreach ($this->fields as $i=>$field) |
|
531 | 531 | { |
532 | 532 | $html .= "<th>?$field</th>"; |
533 | 533 | } |
534 | 534 | $html .= "</tr>"; |
535 | - foreach( $this as $row ) |
|
535 | + foreach ($this as $row) |
|
536 | 536 | { |
537 | - $html.="<tr>"; |
|
538 | - foreach( $row as $cell ) |
|
537 | + $html .= "<tr>"; |
|
538 | + foreach ($row as $cell) |
|
539 | 539 | { |
540 | - $html .= "<td>".htmlspecialchars( $cell )."</td>"; |
|
540 | + $html .= "<td>".htmlspecialchars($cell)."</td>"; |
|
541 | 541 | } |
542 | - $html.="</tr>"; |
|
542 | + $html .= "</tr>"; |
|
543 | 543 | } |
544 | - $html.="</table> |
|
544 | + $html .= "</table> |
|
545 | 545 | <style> |
546 | 546 | table.sparql-results { border-collapse: collapse; } |
547 | 547 | table.sparql-results tr td { border: solid 1px #000 ; padding:4px;vertical-align:top} |
548 | 548 | table.sparql-results tr th { border: solid 1px #000 ; padding:4px;vertical-align:top ; background-color:#eee;} |
549 | 549 | </style> |
550 | 550 | "; |
551 | - return $html;exit; |
|
551 | + return $html; exit; |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | } |
@@ -68,27 +68,27 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
69 | 69 | if (update_schema::check_version(false) == '0') { |
70 | 70 | if ($globalDBdriver == 'mysql') { |
71 | - $error .= create_db::import_all_db('../db/'); |
|
71 | + $error .= create_db::import_all_db('../db/'); |
|
72 | 72 | } elseif ($globalDBdriver == 'pgsql') { |
73 | - $error .= create_db::import_all_db('../db/pgsql/'); |
|
73 | + $error .= create_db::import_all_db('../db/pgsql/'); |
|
74 | 74 | } |
75 | 75 | if ($error != '') { |
76 | - $_SESSION['error'] = $error; |
|
76 | + $_SESSION['error'] = $error; |
|
77 | 77 | } |
78 | 78 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
79 | 79 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
80 | 80 | $_SESSION['install'] = 'populate'; |
81 | 81 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
82 | 82 | } else { |
83 | - $_SESSION['install'] = 'sources'; |
|
84 | - $_SESSION['next'] = 'Insert data in source table'; |
|
83 | + $_SESSION['install'] = 'sources'; |
|
84 | + $_SESSION['next'] = 'Insert data in source table'; |
|
85 | 85 | } |
86 | 86 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
87 | 87 | print json_encode($result); |
88 | 88 | } else { |
89 | 89 | $error .= update_schema::check_version(true); |
90 | 90 | if ($error != '') { |
91 | - $_SESSION['error'] = $error; |
|
91 | + $_SESSION['error'] = $error; |
|
92 | 92 | } |
93 | 93 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
94 | 94 | $_SESSION['install'] = 'sources'; |
@@ -118,25 +118,25 @@ discard block |
||
118 | 118 | $error .= update_db::update_countries(); |
119 | 119 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
120 | 120 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
121 | - $_SESSION['install'] = 'notam'; |
|
122 | - $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | - print json_encode($result); |
|
121 | + $_SESSION['install'] = 'notam'; |
|
122 | + $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
|
123 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
124 | + print json_encode($result); |
|
125 | 125 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
126 | - $_SESSION['install'] = 'owner'; |
|
127 | - $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | - unset($_SESSION['owner']); |
|
129 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | - print json_encode($result); |
|
126 | + $_SESSION['install'] = 'owner'; |
|
127 | + $_SESSION['next'] = 'Populate owner table with externals data'; |
|
128 | + unset($_SESSION['owner']); |
|
129 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
130 | + print json_encode($result); |
|
131 | 131 | } else { |
132 | - $_SESSION['install'] = 'sources'; |
|
133 | - $_SESSION['next'] = 'Insert data in source table'; |
|
134 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | - print json_encode($result); |
|
132 | + $_SESSION['install'] = 'sources'; |
|
133 | + $_SESSION['next'] = 'Insert data in source table'; |
|
134 | + $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
135 | + print json_encode($result); |
|
136 | 136 | } |
137 | 137 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
138 | 138 | if (!is_writable('tmp')) { |
139 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
139 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
140 | 140 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
141 | 141 | print json_encode($result); |
142 | 142 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
154 | 154 | if (!is_writable('tmp')) { |
155 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
155 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
156 | 156 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
157 | 157 | print json_encode($result); |
158 | 158 | } else { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
187 | 187 | if (!is_writable('tmp')) { |
188 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
188 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
189 | 189 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
190 | 190 | print json_encode($result); |
191 | 191 | } else { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
202 | 202 | if (!is_writable('tmp')) { |
203 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
203 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
204 | 204 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
205 | 205 | print json_encode($result); |
206 | 206 | } else { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
231 | 231 | if (!is_writable('tmp')) { |
232 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
232 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
233 | 233 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
234 | 234 | print json_encode($result); |
235 | 235 | } else { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
246 | 246 | if (!is_writable('tmp')) { |
247 | - $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
247 | + $error = 'The directory <i>install/tmp</i> must be writable.'; |
|
248 | 248 | $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
249 | 249 | print json_encode($result); |
250 | 250 | } else { |
@@ -296,17 +296,17 @@ discard block |
||
296 | 296 | */ |
297 | 297 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'sources') { |
298 | 298 | if (isset($_SESSION['sources']) && count($_SESSION['sources']) > 0) { |
299 | - $sources = $_SESSION['sources']; |
|
299 | + $sources = $_SESSION['sources']; |
|
300 | 300 | |
301 | - include_once('../require/class.Source.php'); |
|
302 | - $globalDebug = FALSE; |
|
303 | - $Source = new Source(); |
|
304 | - $Source->deleteAllLocation(); |
|
305 | - foreach ($sources as $src) { |
|
301 | + include_once('../require/class.Source.php'); |
|
302 | + $globalDebug = FALSE; |
|
303 | + $Source = new Source(); |
|
304 | + $Source->deleteAllLocation(); |
|
305 | + foreach ($sources as $src) { |
|
306 | 306 | if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
307 | - } |
|
308 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | - unset($_SESSION['sources']); |
|
307 | + } |
|
308 | + $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
309 | + unset($_SESSION['sources']); |
|
310 | 310 | } |
311 | 311 | /* |
312 | 312 | if (isset($globalIVAO) && $globalIVAO) $_SESSION['install'] = 'ivao'; |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_create') { |
69 | 69 | $dbroot = $_SESSION['database_root']; |
70 | 70 | $dbrootpass = $_SESSION['database_rootpass']; |
71 | - $error .= create_db::create_database($dbroot,$dbrootpass,$globalDBuser,$globalDBpass,$globalDBname,$globalDBdriver,$globalDBhost); |
|
71 | + $error .= create_db::create_database($dbroot, $dbrootpass, $globalDBuser, $globalDBpass, $globalDBname, $globalDBdriver, $globalDBhost); |
|
72 | 72 | sleep(5); |
73 | 73 | if ($error != '') { |
74 | 74 | $_SESSION['error'] = $error; |
75 | 75 | } |
76 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create database')); |
|
76 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create database')); |
|
77 | 77 | $_SESSION['install'] = 'database_import'; |
78 | 78 | $_SESSION['next'] = 'Create and import tables'; |
79 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
79 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
80 | 80 | print json_encode($result); |
81 | 81 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'database_import') { |
82 | 82 | if (update_schema::check_version(false) == '0') { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if ($error != '') { |
89 | 89 | $_SESSION['error'] = $error; |
90 | 90 | } |
91 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Create and import tables')); |
|
91 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Create and import tables')); |
|
92 | 92 | if ($globalSBS1 && !$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
93 | 93 | $_SESSION['install'] = 'populate'; |
94 | 94 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for ADS-B'; |
@@ -96,84 +96,84 @@ discard block |
||
96 | 96 | $_SESSION['install'] = 'sources'; |
97 | 97 | $_SESSION['next'] = 'Insert data in source table'; |
98 | 98 | } |
99 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
99 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
100 | 100 | print json_encode($result); |
101 | 101 | } else { |
102 | 102 | $error .= update_schema::check_version(true); |
103 | 103 | if ($error != '') { |
104 | 104 | $_SESSION['error'] = $error; |
105 | 105 | } |
106 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Update schema if needed')); |
|
106 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Update schema if needed')); |
|
107 | 107 | $_SESSION['install'] = 'sources'; |
108 | 108 | $_SESSION['next'] = 'Insert data in source table'; |
109 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
109 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
110 | 110 | print json_encode($result); |
111 | 111 | } |
112 | 112 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'waypoints') { |
113 | 113 | include_once('class.update_db.php'); |
114 | 114 | $error .= update_db::update_waypoints(); |
115 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate waypoints database')); |
|
115 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate waypoints database')); |
|
116 | 116 | |
117 | 117 | $_SESSION['install'] = 'airspace'; |
118 | 118 | $_SESSION['next'] = 'Populate airspace table'; |
119 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
119 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
120 | 120 | print json_encode($result); |
121 | 121 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'airspace') { |
122 | 122 | include_once('class.update_db.php'); |
123 | 123 | $error .= update_db::update_airspace_fam(); |
124 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate airspace database')); |
|
124 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate airspace database')); |
|
125 | 125 | $_SESSION['install'] = 'countries'; |
126 | 126 | $_SESSION['next'] = 'Populate countries table'; |
127 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
127 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
128 | 128 | print json_encode($result); |
129 | 129 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'countries') { |
130 | 130 | include_once('class.update_db.php'); |
131 | 131 | $error .= update_db::update_countries(); |
132 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate countries database')); |
|
132 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate countries database')); |
|
133 | 133 | if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
134 | 134 | $_SESSION['install'] = 'notam'; |
135 | 135 | $_SESSION['next'] = 'Populate NOTAM table with externals data'; |
136 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
136 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
137 | 137 | print json_encode($result); |
138 | 138 | } elseif (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
139 | 139 | $_SESSION['install'] = 'owner'; |
140 | 140 | $_SESSION['next'] = 'Populate owner table with externals data'; |
141 | 141 | unset($_SESSION['owner']); |
142 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
142 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
143 | 143 | print json_encode($result); |
144 | 144 | } else { |
145 | 145 | $_SESSION['install'] = 'sources'; |
146 | 146 | $_SESSION['next'] = 'Insert data in source table'; |
147 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
147 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
148 | 148 | print json_encode($result); |
149 | 149 | } |
150 | 150 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate') { |
151 | 151 | if (!is_writable('tmp')) { |
152 | 152 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
153 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
153 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
154 | 154 | print json_encode($result); |
155 | 155 | } else { |
156 | 156 | include_once('class.update_db.php'); |
157 | 157 | $globalDebug = FALSE; |
158 | 158 | $error .= update_db::update_ModeS_fam(); |
159 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for ADS-B')); |
|
159 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for ADS-B')); |
|
160 | 160 | |
161 | 161 | $_SESSION['install'] = 'populate_flarm'; |
162 | 162 | $_SESSION['next'] = 'Populate aircraft_modes table with externals data for FLARM'; |
163 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
163 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
164 | 164 | print json_encode($result); |
165 | 165 | } |
166 | 166 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'populate_flarm') { |
167 | 167 | if (!is_writable('tmp')) { |
168 | 168 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
169 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
169 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
170 | 170 | print json_encode($result); |
171 | 171 | } else { |
172 | 172 | include_once('class.update_db.php'); |
173 | 173 | $globalDebug = FALSE; |
174 | 174 | //$error .= update_db::update_ModeS_flarm(); |
175 | 175 | $error .= update_db::update_ModeS_ogn(); |
176 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate aircraft_modes table with externals data for FLARM')); |
|
176 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate aircraft_modes table with externals data for FLARM')); |
|
177 | 177 | |
178 | 178 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
179 | 179 | $_SESSION['install'] = 'vatsim'; |
@@ -193,34 +193,34 @@ discard block |
||
193 | 193 | $_SESSION['install'] = 'routes'; |
194 | 194 | $_SESSION['next'] = 'Populate routes table with externals data'; |
195 | 195 | } |
196 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
196 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
197 | 197 | print json_encode($result); |
198 | 198 | } |
199 | 199 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'routes') { |
200 | 200 | if (!is_writable('tmp')) { |
201 | 201 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
202 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
202 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
203 | 203 | print json_encode($result); |
204 | 204 | } else { |
205 | 205 | include_once('class.update_db.php'); |
206 | 206 | $globalDebug = FALSE; |
207 | 207 | $error .= update_db::update_routes_fam(); |
208 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate routes table with externals data')); |
|
208 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate routes table with externals data')); |
|
209 | 209 | $_SESSION['install'] = 'translation'; |
210 | 210 | $_SESSION['next'] = 'Populate translation table with externals data'; |
211 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
211 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
212 | 212 | print json_encode($result); |
213 | 213 | } |
214 | 214 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'translation') { |
215 | 215 | if (!is_writable('tmp')) { |
216 | 216 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
217 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
217 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
218 | 218 | print json_encode($result); |
219 | 219 | } else { |
220 | 220 | include_once('class.update_db.php'); |
221 | 221 | $globalDebug = FALSE; |
222 | 222 | $error .= update_db::update_translation(); |
223 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate translation table with externals data')); |
|
223 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate translation table with externals data')); |
|
224 | 224 | |
225 | 225 | if ($_SESSION['waypoints'] == 1) { |
226 | 226 | $_SESSION['install'] = 'waypoints'; |
@@ -237,48 +237,48 @@ discard block |
||
237 | 237 | $_SESSION['install'] = 'sources'; |
238 | 238 | $_SESSION['next'] = 'Insert data in source table'; |
239 | 239 | } |
240 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
240 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
241 | 241 | print json_encode($result); |
242 | 242 | } |
243 | 243 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') { |
244 | 244 | if (!is_writable('tmp')) { |
245 | 245 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
246 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
246 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
247 | 247 | print json_encode($result); |
248 | 248 | } else { |
249 | 249 | include_once('class.update_db.php'); |
250 | 250 | $globalDebug = FALSE; |
251 | 251 | $error = update_db::update_owner_fam(); |
252 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate owner table with externals data')); |
|
252 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data')); |
|
253 | 253 | $_SESSION['install'] = 'sources'; |
254 | 254 | $_SESSION['next'] = 'Insert data in source table'; |
255 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
255 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
256 | 256 | print json_encode($result); |
257 | 257 | } |
258 | 258 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') { |
259 | 259 | if (!is_writable('tmp')) { |
260 | 260 | $error = 'The directory <i>install/tmp</i> must be writable.'; |
261 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
261 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
262 | 262 | print json_encode($result); |
263 | 263 | } else { |
264 | 264 | include_once('class.update_db.php'); |
265 | 265 | $globalDebug = FALSE; |
266 | 266 | if (isset($globalNOTAMSource) && $globalNOTAMSource != '') { |
267 | 267 | $error .= update_db::update_notam(); |
268 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data')); |
|
268 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data')); |
|
269 | 269 | } else { |
270 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Populate notam table with externals data (no source defined)')); |
|
270 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate notam table with externals data (no source defined)')); |
|
271 | 271 | } |
272 | 272 | if (isset($_SESSION['owner']) && $_SESSION['owner'] == 1) { |
273 | 273 | $_SESSION['install'] = 'owner'; |
274 | 274 | $_SESSION['next'] = 'Populate owner table'; |
275 | 275 | unset($_SESSION['owner']); |
276 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
276 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
277 | 277 | print json_encode($result); |
278 | 278 | } else { |
279 | 279 | $_SESSION['install'] = 'sources'; |
280 | 280 | $_SESSION['next'] = 'Insert data in source table'; |
281 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
281 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
282 | 282 | print json_encode($result); |
283 | 283 | } |
284 | 284 | } |
@@ -316,9 +316,9 @@ discard block |
||
316 | 316 | $Source = new Source(); |
317 | 317 | $Source->deleteAllLocation(); |
318 | 318 | foreach ($sources as $src) { |
319 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
319 | + if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'], $src['latitude'], $src['longitude'], $src['altitude'], $src['city'], $src['country'], $src['source'], 'antenna.png'); |
|
320 | 320 | } |
321 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
|
321 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert data in source table')); |
|
322 | 322 | unset($_SESSION['sources']); |
323 | 323 | } |
324 | 324 | /* |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $_SESSION['install'] = 'finish'; |
344 | 344 | $_SESSION['next'] = 'finish'; |
345 | 345 | } |
346 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
346 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
347 | 347 | print json_encode($result); |
348 | 348 | } else if (isset($_SESSION['install']) && $_SESSION['install'] == 'vatsim') { |
349 | 349 | include_once('../install/class.create_db.php'); |
@@ -353,36 +353,36 @@ discard block |
||
353 | 353 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
354 | 354 | if (file_exists('tmp/ivae_feb2013.zip')) { |
355 | 355 | $error .= update_db::update_IVAO(); |
356 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
356 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
357 | 357 | } else { |
358 | 358 | $error .= update_db::update_vatsim(); |
359 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
359 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
360 | 360 | } |
361 | 361 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
362 | 362 | $error .= update_db::update_vatsim(); |
363 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data')); |
|
363 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data')); |
|
364 | 364 | } elseif (isset($globalIVAO) && $globalIVAO) { |
365 | 365 | if (file_exists('tmp/ivae_feb2013.zip')) { |
366 | 366 | $error .= update_db::update_IVAO(); |
367 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert IVAO data')); |
|
367 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert IVAO data')); |
|
368 | 368 | } else { |
369 | 369 | $error .= update_db::update_vatsim(); |
370 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert VATSIM data (IVAO not found)')); |
|
370 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert VATSIM data (IVAO not found)')); |
|
371 | 371 | } |
372 | 372 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
373 | - $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert phpVMS data')); |
|
373 | + $_SESSION['done'] = array_merge($_SESSION['done'], array('Insert phpVMS data')); |
|
374 | 374 | } |
375 | 375 | //$_SESSION['install'] = 'routes'; |
376 | 376 | //$_SESSION['next'] = 'Populate routes table with externals data'; |
377 | 377 | $_SESSION['install'] = 'finish'; |
378 | 378 | $_SESSION['next'] = 'finish'; |
379 | 379 | |
380 | - $result = array('error' => $error,'done' => $_SESSION['done'],'next' => $_SESSION['next'],'install' => $_SESSION['install']); |
|
380 | + $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']); |
|
381 | 381 | print json_encode($result); |
382 | 382 | } else { |
383 | 383 | //unset($_SESSION['install']); |
384 | 384 | $_SESSION['error'] = 'Unknwon task : '.$_SESSION['install']; |
385 | - $result = array('error' => 'Unknwon task : '.$_SESSION['install'],'done' => $_SESSION['done'],'next' => 'finish','install' => 'finish'); |
|
385 | + $result = array('error' => 'Unknwon task : '.$_SESSION['install'], 'done' => $_SESSION['done'], 'next' => 'finish', 'install' => 'finish'); |
|
386 | 386 | print json_encode($result); |
387 | 387 | } |
388 | 388 | ?> |
389 | 389 | \ No newline at end of file |