alblua Posted September 18, 2015 Report Share Posted September 18, 2015 A virtual airline would like me to help them create a function in phpVMS in which the pilot can only bid from a flight that they had previously arrived from. I'm wondering if such function is possible, or should I suggest just reject flights that don't follow the criteria (that would seem mean, )? Haven't touched phpVMS for a whole summer, so I'm extremely rusty on the matter. Any input would be great, thanks! Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 19, 2015 Moderators Report Share Posted September 19, 2015 Unfortunately there is not any default function except if you add an if statement inside the schedule_results.tpl foreach and show only schedules from the last pilot's location. The thing is that you will have to get into consideration the fact that sometimes the schedules are not rounded. I believe that rejecting a pirep if it was not flown from the last pilot's location is too bureaucratic. If you search the forum there are some freeware and payware modules too. Freeware: http://forum.phpvms.net/topic/2791-realschedulelite-beta-10-deprecated/ Freeware: http://forum.phpvms.net/topic/8315-flightbookingsystem-v10/ Payware: http://php-mods.eu/site/index.php/real-booking-system/ Quote Link to comment Share on other sites More sharing options...
CPC900 Posted September 24, 2015 Report Share Posted September 24, 2015 or should I suggest just reject flights that don't follow the criteria (that would seem mean, )? That's what I always did. That is one of the only 'rules' we have and no one seems too annoyed by that. Quote Link to comment Share on other sites More sharing options...
mseiwald Posted September 25, 2015 Report Share Posted September 25, 2015 Oh come on this is a very simple request no need for payware stuff or manual reject nonsense. In your schedule_results.tpl use $pid = Auth::$userinfo->pilotid; $sql = "SELECT arricao FROM ".TABLE_PREFIX."pireps WHERE pilotid = '$pid' ORDER BY submitdate DESC LIMIT 1"; $myloc = DB::get_row($sql); if($myloc && $myloc->arricao != $route->depicao) { continue; } Or better would be open PIREPData.class.php and add a function in there like public function mylastlocation($pilotid) { $sql = "SELECT arricao FROM ".TABLE_PREFIX."pireps WHERE pilotid = '$pilotid' ORDER BY submitdate DESC LIMIT 1"; return DB::get_row($sql); } and then in schedule_results.tpl use $myloc = PIREPData::mylastlocation(Auth::$userinfo->pilotid); if($myloc && $myloc->arricao != $route->depicao) { continue; } Quote Link to comment Share on other sites More sharing options...
alblua Posted September 27, 2015 Author Report Share Posted September 27, 2015 Thanks for the help everyone, I think it works now and now I'll see if the client is happy with the results. Quote Link to comment Share on other sites More sharing options...
XLineVA Posted October 4, 2015 Report Share Posted October 4, 2015 Is this also possible for the fleet. I want the aircrafts depart from its last known location. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.