Flightguy123 Posted March 13, 2010 Report Posted March 13, 2010 Hi, I know I brought this post up in the past, but I was unable to set it up. The code I had was completely wrong and closed out all the schedules besides AAL001. Does anyone have any other idea on how I can erstrict New Hires from flying like 777's? Like in the real world, new pilots first start small, as there hours get bigger so do the aircraft they can fly. Thanks Ada Quote
Guest lorathon Posted March 13, 2010 Report Posted March 13, 2010 We restrict by Airline. We have the following PVX - Phoenix Express - All pilots assigned to this airline are only allowed to bid on and fly PVX flights. The schedule is designed so that all PVX flights are Saab 340 / CRJ-200 / etc... PVA - Phoenix Airways - Same as above except that the schedules are setup with A320 / 737 / etc... PVI - Phoenix International - you get the picture When a pilot searches for a flight my code checks there pilot code (PVX, PVA, PVI) and then determines which to show. A PVX only sees PVX. A PVA sees PVX and PVA. A PVI sees all. Quote
Guest lorathon Posted March 13, 2010 Report Posted March 13, 2010 You could also code it to show only certain airframe based on rank. The options are limitless here. One of the things I really like about phpVMS. Quote
Administrators simpilot Posted March 13, 2010 Administrators Report Posted March 13, 2010 You could use something like this inside of your foreach loop in schedule_results.tpl -> <?php if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777') { continue; } ?> That will tell the loop to continue past any route that has a B777 aircraft unless the user is a Senior Captain. You would have to change "Senior Captain" and "B777" to fit your needs but it would accomplish what you are trying to do I think. Quote
Flightguy123 Posted March 14, 2010 Author Report Posted March 14, 2010 You could use something like this inside of your foreach loop in schedule_results.tpl -> <?php if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777') { continue; } ?> That will tell the loop to continue past any route that has a B777 aircraft unless the user is a Senior Captain. You would have to change "Senior Captain" and "B777" to fit your needs but it would accomplish what you are trying to do I think. roger, um Simpilot how would I go about doing this, what do you mean each loop? Quote
Guest lorathon Posted March 14, 2010 Report Posted March 14, 2010 Add it into your schedules_results.tpl Before the start of the table. // Filter by airline if(Auth::$userinfo->code != $route->code) { continue; } This above filters by airline code. Whatever filter you want to use stick right before the ?>. The table starts somewhere around line 80. Quote
Administrators simpilot Posted March 14, 2010 Administrators Report Posted March 14, 2010 Open up the schedule_results.tpl and find <?php foreach($allroutes as $route) { and insert the code directly after it so it looks like this -> <?php foreach($allroutes as $route) { if(Auth::$userinfo->rank <> 'Senior Captain' && $route->aircraft == 'B777') { continue; } 1 Quote
Flightguy123 Posted March 15, 2010 Author Report Posted March 15, 2010 Now simpilot, first thanks for helping! And second, for the aircraft do I put in Aircraft IACO , Aircraft Name , Aircraft Full Name, Aircraft Registration?? Ada Quote
Administrators simpilot Posted March 15, 2010 Administrators Report Posted March 15, 2010 It needs to match whatever you are using for the "name", look in the db aircraft table, and it is whatever is in the name column. Quote
Flightguy123 Posted March 15, 2010 Author Report Posted March 15, 2010 Still no response.... I tried the IACO, the Name even the full name... nothing.. Quote
Flightguy123 Posted March 18, 2010 Author Report Posted March 18, 2010 Can you help me Simpilot? Quote
Guest lorathon Posted March 18, 2010 Report Posted March 18, 2010 Post your code Flightguy. Maybe there is an error. Quote
Administrators simpilot Posted March 18, 2010 Administrators Report Posted March 18, 2010 Are you logged in when you are trying it? If not the Auth class will be empty. Pastebin your page and post the link and I will take a look at it. Also try a print_r($route) inside the foreach and see if [name] => blah is in the array. I have not tested this so the variable we are looking for may not be there or may be getting written into another variable name. Quote
Flightguy123 Posted March 19, 2010 Author Report Posted March 19, 2010 ok, here is the website www.aavirtual.net at the top login area put in AAL003 and password is password1 Quote
Administrators simpilot Posted March 20, 2010 Administrators Report Posted March 20, 2010 Did you try a print_r to see what is in the array and make sure the itme we are looking for is there? Quote
Administrators simpilot Posted March 21, 2010 Administrators Report Posted March 21, 2010 Put a print_r($route); inside of the foreach loop for the routes and see what it spits out. Look for a variable in the array that has the acircraft icao code. It is under name in the db but may be getting renamed in the new array. Quote
Administrators simpilot Posted March 22, 2010 Administrators Report Posted March 22, 2010 Can you pastebin the code? Quote
Flightguy123 Posted March 22, 2010 Author Report Posted March 22, 2010 Can you pastebin the code? How do you do that?? Do you have Skype or messenger? can you PM me on those?? We can talk through there... Quote
Administrators simpilot Posted March 22, 2010 Administrators Report Posted March 22, 2010 You can add me to messenger - I pm'ed you the name - I am on most evenings 8pm till 11pm EST Quote
Administrators Nabeel Posted March 23, 2010 Administrators Report Posted March 23, 2010 You can wait for this one, I'm implementing aircraft restrictions on ranks for 2.1. A few things I though I'd present: Do schedules show if they are on an aircraft they're not qualified for? I can add a bit into the template which will skip it (like there are for several cases now). Since schedules can be flown with any aircraft, does it even matter If they file a PIREP, what happens if they used an aircraft they can't fly Do aircraft they can't fly show up on the PIREP form? ACARS flights - if they use an aircraft they're not supposed to - I presume it would notify the admin in the accept screen Statistics - excluding aircraft they can't fly from showing up in the stats screen Quote
Flightguy123 Posted March 24, 2010 Author Report Posted March 24, 2010 You can wait for this one, I'm implementing aircraft restrictions on ranks for 2.1. A few things I though I'd present: Do schedules show if they are on an aircraft they're not qualified for? I can add a bit into the template which will skip it (like there are for several cases now). Since schedules can be flown with any aircraft, does it even matter If they file a PIREP, what happens if they used an aircraft they can't fly Do aircraft they can't fly show up on the PIREP form? ACARS flights - if they use an aircraft they're not supposed to - I presume it would notify the admin in the accept screen Statistics - excluding aircraft they can't fly from showing up in the stats screen yeah wow, this would be great! It would help out A LOT, Simpilot, I added you on my messenger account.. Nabeel, when will this be out?? Thanks Ada Quote
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.