# Aircraft Restrictions

**URL:** <https://forum.phpvms.net/t/aircraft-restrictions/2210>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [March 13, 2010, 4:50pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210 "2010-03-13T16:50:54Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 13, 2010, 4:50pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/1 "2010-03-13T16:50:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 13, 2010, 7:48pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/2 "2010-03-13T19:48:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 14, 2010, 1:07am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/3 "2010-03-14T01:07:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 14, 2010, 4:14am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/4 "2010-03-14T04:14:45Z")

</div>

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; }

```

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 15, 2010, 1:49am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/5 "2010-03-15T01:49:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 15, 2010, 3:51am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/6 "2010-03-15T03:51:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 15, 2010, 9:38pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/7 "2010-03-15T21:38:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 18, 2010, 9:55pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/8 "2010-03-18T21:55:56Z")

</div>

Can you help me Simpilot?

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 18, 2010, 11:37pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/9 "2010-03-18T23:37:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 19, 2010, 3:13pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/10 "2010-03-19T15:13:47Z")

</div>

ok, here is the website [www.aavirtual.net](http://www.aavirtual.net) at the top login area put in AAL003 and password is password1

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 20, 2010, 4:02am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/11 "2010-03-20T04:02:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 20, 2010, 6:21pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/12 "2010-03-20T18:21:29Z")

</div>

How would I do that?

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 21, 2010, 12:01pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/13 "2010-03-21T12:01:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 21, 2010, 6:53pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/14 "2010-03-21T18:53:41Z")

</div>

No response

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 22, 2010, 2:12am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/15 "2010-03-22T02:12:18Z")

</div>

Can you pastebin the code?

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 22, 2010, 3:32am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/16 "2010-03-22T03:32:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 22, 2010, 4:15am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/17 "2010-03-22T04:15:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [March 23, 2010, 4:03pm UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/18 "2010-03-23T16:03:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flightguy123](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Flightguy123](https://forum.phpvms.net/u/Flightguy123)\
**Post date:** [March 24, 2010, 3:52am UTC](https://forum.phpvms.net/t/aircraft-restrictions/2210/19 "2010-03-24T03:52:17Z")

</div>

> 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
