Jump to content

New: airport lookup server with extended data


mischka

Recommended Posts

  • 1 month later...

Hello all,

 

I am new to this and am having an issue with the add new Airport and am trying to follow this thread.  However in first post it says "1) Go to your local.config.php / app.config.php to change your phpvms_api_server"  I have changed the app.config.php but I do not see anything related to phpvms_api_server in the local.config.php.  That line is it supposed to be added to the local.config.php and if so where should it be added?

 

Ok UPDATE:

 

I have added the code to local.config.php and as OzFlyer said it is still not fetching any data when adding New Airport and ICAO code.  Any help would be greatly appreciated.

 

Thank you for your time and understanding

Edited by ATACEO
Link to comment
Share on other sites

22 hours ago, ATACEO said:

Hello all,

 

I am new to this and am having an issue with the add new Airport and am trying to follow this thread.  However in first post it says "1) Go to your local.config.php / app.config.php to change your phpvms_api_server"  I have changed the app.config.php but I do not see anything related to phpvms_api_server in the local.config.php.  That line is it supposed to be added to the local.config.php and if so where should it be added?

 

Ok UPDATE:

 

I have added the code to local.config.php and as OzFlyer said it is still not fetching any data when adding New Airport and ICAO code.  Any help would be greatly appreciated.

 

Thank you for your time and understanding

The local.config.php doesn't need to be changed too much, but rather a few other files.

Have you followed the tutorial here? https://www.virtualairlines.eu/index.php/Blog

Link to comment
Share on other sites

12 hours ago, ATACEO said:

web541,

 

Yes I have followed this to a "T"  Have checked it and double checked it.  

Can you please PM me with the name of your VA so I can check in the logs if you are actually reaching the server, and we can take it from there

Link to comment
Share on other sites

  • 2 years later...
  • 3 years later...
  • Moderators
function lookupICAO() {
    var icao = $("#airporticao").val();

    if (icao.length != 4) {
        $("#statusbox").html("Please enter the full 4 letter ICAO");
        return false;
    }

    $("#statusbox").html("Fetching airport data...");
    $("#lookupicao").hide();

    var url = "https://virtualairlines.eu/airports.php?icao=" + icao + "&callback=?";
    console.log("URL: " + url);

    $.ajax({
        url: url,
        dataType: "jsonp", // Specifies that the request is for JSONP
        success: function(data) {
            console.log("Data received: ", data);

            if (!data.airports || data.airports.length === 0) {
                $("#statusbox").html("Nothing found. Try entering the full 4 letter ICAO");
                $("#lookupicao").show();
                return;
            }

            $.each(data.airports, function(i, item) {
                console.log("Processing item: ", item);
                $("#airporticao").val(icao);
                $("#airportname").val(item.name);
                $("#airportcountry").val(item.countryName);
                $("#airportlat").val(item.lat);
                $("#airportlong").val(item.lng);
                $("#fuelprice").val(item.jeta);

                $("#statusbox").html("");
                $("#lookupicao").show();
            });
        },
        error: function(jqxhr, textStatus, error) {
            var err = textStatus + ", " + error;
            console.error("Request Failed: " + err);
            $("#statusbox").html("Error fetching data. Please try again.");
            $("#lookupicao").show();
        }
    });

    return false;
}

 

Change your function to this, it's been tested and working on both Chrome and Firefox

Link to comment
Share on other sites

  • Administrators
9 hours ago, Parkho said:
function lookupICAO() {
    var icao = $("#airporticao").val();

    if (icao.length != 4) {
        $("#statusbox").html("Please enter the full 4 letter ICAO");
        return false;
    }

    $("#statusbox").html("Fetching airport data...");
    $("#lookupicao").hide();

    var url = "https://virtualairlines.eu/airports.php?icao=" + icao + "&callback=?";
    console.log("URL: " + url);

    $.ajax({
        url: url,
        dataType: "jsonp", // Specifies that the request is for JSONP
        success: function(data) {
            console.log("Data received: ", data);

            if (!data.airports || data.airports.length === 0) {
                $("#statusbox").html("Nothing found. Try entering the full 4 letter ICAO");
                $("#lookupicao").show();
                return;
            }

            $.each(data.airports, function(i, item) {
                console.log("Processing item: ", item);
                $("#airporticao").val(icao);
                $("#airportname").val(item.name);
                $("#airportcountry").val(item.countryName);
                $("#airportlat").val(item.lat);
                $("#airportlong").val(item.lng);
                $("#fuelprice").val(item.jeta);

                $("#statusbox").html("");
                $("#lookupicao").show();
            });
        },
        error: function(jqxhr, textStatus, error) {
            var err = textStatus + ", " + error;
            console.error("Request Failed: " + err);
            $("#statusbox").html("Error fetching data. Please try again.");
            $("#lookupicao").show();
        }
    });

    return false;
}

 

Change your function to this, it's been tested and working on both Chrome and Firefox


While you replied to a 3 year old post to a 2 year old prior post, a better solution is:

At least this will work as long as the phpVMS airport lookup API is up. This phpVMS airport lookup API is the same one in use for phpVMS v7 - and has been adapted to work with phpVMS v5. 

Link to comment
Share on other sites

  • Moderators

Well you're right the post is 3 years old and I came across it today. I think it's best if we close the unsolved old posts so people like me wouldn't dare to reply to them so late. Thanks for the update anyways.

Link to comment
Share on other sites

  • Administrators

Not sure if it's practical or worth the time to go thru all the v2/v5 posts to lock unsolved ones. 

New users should be using phpVMS v7 - and old users have usually solved their issues even if they don't post their resolution.

Based on increasing issues that v2/v5 users are experiencing (mostly do to shared hosting updates), it's probably time to move on to v7.

 

In any case, as long as phpVMS v7 airport lookup is working, the above update to the v5 files (via updated VACentral API update) should allow the airport lookup to work.

Not so much using the "virtualairlines.eu" website airport lookup as the website is sometimes unreachable and the OP author hasn't been on this forum in over 4 years.

Link to comment
Share on other sites

  • Moderators

Yeah, I am maintaining a few airlines and they're not willing to move on to v7. Besides there are not many developers for v7 and admins can't do simple tasks on their own as V7 is pretty complex for them.

  • Sad 1
Link to comment
Share on other sites

  • ProAvia unlocked this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...