Aircraft Restrictions

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

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.

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?

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 Like

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

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.

Still no response… I tried the IACO, the Name even the full name… nothing..

Can you help me Simpilot?

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.

ok, here is the website www.aavirtual.net at the top login area put in AAL003 and password is password1

Did you try a print_r to see what is in the array and make sure the itme we are looking for is there?

How would I do that?

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.

No response

Can you pastebin the code?

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…

You can add me to messenger - I pm’ed you the name - I am on most evenings 8pm till 11pm EST

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

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