[SOLVED] Latitude and longitude on bids ($bids)

Hello everyone,
 

I wanted to know if there is a code to know the airport latitude of arrival and destination of a reservation ($bid), because I am trying to put a map in the page of bids and it goes blank, I believe it is because he does not can find the latitude and longitude, because for an pyrep would be that ‘$pirep-> arrlat’ right? So if I put ‘$bid’ in place of ‘$pirep’ it does not work.

 

Thanks.

which page/template is this for? 

For schedule_bids.php

 

Ok, so in /core/common/scheduledata.class.php you go to around line 787 where you have the function getbids

change the line where the sql is set to this

$sql='SELECT dep.lat as deplat, dep.lng as deplng, arr.lat as arrlat, arr.lng as arrlng, s.*, b.bidid, a.name as aircraft, a.registration
                FROM '.TABLE_PREFIX.'schedules s, '.TABLE_PREFIX.'bids b,
                    '.TABLE_PREFIX.'aircraft a,
                    '.TABLE_PREFIX.'airports dep, '.TABLE_PREFIX.‘airports arr
                WHERE b.routeid = s.id 
                    AND s.aircraft=a.id 
                    and s.depicao=dep.icao
                    and s.arricao=arr.icao           
    AND b.pilotid=’.$pilotid;

that should give you of the deplat deplng and arrlat and arrlng and then you can add any other fields like name etc as you like. make sure you name them differently otherwise mysql gets confused 

 

1 Like

It worked! Thank you very much, thank you very much!

 

Do you know if route_details appears? Because when I do a $ bids print_r the route details looks like this: 

[route_details] => a:0:{}