You can clone with
No one assigned
The content you are editing has changed. Reload the page and try again.
Long time, no talk!
While I was writing a custom module for a virtual airline, the module is going to use the findPIREP from the PIREPData class, however, I noticed there are two same colum names "code" in the PIREP table and the Pilot table.
So I went to find the SQL query and fixed it up by adding this... "u.code AS pcode"
So to show the pilot's code would be like this $pirep->pcode and for the PIREP code is $pirep->code.
$sql = 'SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.code AS pcode,
u.pilotid, u.firstname, u.lastname, u.email, u.rank,
a.id AS aircraftid, a.name as aircraft, a.registration,
dep.name as depname, dep.lat AS deplat, dep.lng AS deplng,
arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng
FROM '.TABLE_PREFIX.'pireps p
LEFT JOIN '.TABLE_PREFIX.'aircraft a ON a.id = p.aircraft
LEFT JOIN '.TABLE_PREFIX.'airports AS dep ON dep.icao = p.depicao
LEFT JOIN '.TABLE_PREFIX.'airports AS arr ON arr.icao = p.arricao
LEFT JOIN '.TABLE_PREFIX.'pilots u ON u.pilotid = p.pilotid ';
It does that to PIREP Admin, when you are looking at the PIREP list, the code to pilot is not correct. For example, my airline code is TVA, and the PIREP that the pilot flew, the code would be WTA. The pilot id will show WTA1000, but the pilot's id is really TVA1000.
If you want me to update the forked phpVMS from my repo with the new SQL query and update the tpl files needed, and put up the pull request, then I would be happy to do that for you.
Attach images by dragging & dropping or
Uploading your images…
Unfortunately, we don't support that file type.
Try again with a PNG, GIF, or JPG.
Yowza, that's a big file.
Try again with an image file smaller than 10MB.
This browser doesn't support image attachments.
We recommend updating to the latest
Google Chrome, or
Something went really wrong, and we can't process that image.
My assumption was that you will have the pilot's information if you're running this query, so I didn't include any pilot information.
But, sure, send a pull request, I'll merge it in. Thanks!
Well, it's just only the u.code AS pcode. No another pilot info needed. There's two same columns named code since you joined the tables. It just needed to be changed little bit.
I'll grab from your repo and fix it up and put the pull request soon.
fixed with pull request #67