Jump to content

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


CarlosEduardo2409

Recommended Posts

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.

Edited by CarlosEduardo2409
Link to comment
Share on other sites

 

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 

 

  • Thanks 1
Link to comment
Share on other sites

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...