Disable Pilot Registration

Hello Guys,

I need your help.

We would like to disable the Pilot Registration Site if i.E. 300 Pilots are in our VA.

When we delete a Pilot and came so bellow 300 again it should be enabled again.

Here a snipout of our Website to show the Registration:

<li class=“b-top-nav__2level_title f-top-nav__2level_title”>Register</li>
                <li class=“b-top-nav__2level f-top-nav__2level f-primary”><a href=“<?php echo SITE_URL?>/index.php/registration”><i class=“fa fa-angle-right”></i>Register</a></li>

 

Thanks in advance for your help! :slight_smile:

Do you want to count the active pilots of your virtual airlines or the pilots that are includes in your virtual airline’s database?

Hi Servetas,

we want to count the total Pilots in our Database :slight_smile:

And.. if its possible… insted of disable the registration when the maximum is reached, just forward the person to a site which says (“sorry our VA is currently full…”)

Thanks for your support

On 08/12/2017 at 8:22 PM, Thomasha said:

Hi Servetas,

we want to count the total Pilots in our Database :slight_smile:

And.. if its possible… insted of disable the registration when the maximum is reached, just forward the person to a site which says (“sorry our VA is currently full…”)

Thanks for your support

  1. To count your total pilots, I guess there’s a function for it on StatsData.class.php 

Just open that file from core > Common and search up for the function. Once you find the right function, call it

 For example

<?php echo StatsData::get_all_pilots(); ?> 

 

  1. Okay, I guess I can help with that, Had done this for a VA. 

It’s really simple, once you find the total pilots, write a simple conditional statement, " if($totalpilots > 299) { echo ‘We are currently not hiring’; } else { echo 'We are hiring pilots, Register now! } " 

 

^ this is just for an example, if you want a full code of this, please wait till tomorrow, I will reach home and send you. 

7 hours ago, LeonardIGO4036 said:

  1. To count your total pilots, I guess there’s a function for it on StatsData.class.php 

Just open that file from core > Common and search up for the function. Once you find the right function, call it

 For example

<?php echo StatsData::get_all_pilots(); ?> 

 

  1. Okay, I guess I can help with that, Had done this for a VA. 

It’s really simple, once you find the total pilots, write a simple conditional statement, " if($totalpilots > 299) { echo ‘We are currently not hiring’; } else { echo 'We are hiring pilots, Register now! } " 

 

^ this is just for an example, if you want a full code of this, please wait till tomorrow, I will reach home and send you. 

Hi,

thanks for your reply.

  1. Yes to count the total Pilots we use: <?php echo StatsData::PilotCount(); ?>

  2. Something in this direction I’ve also thought, unfortunately I havn’t yet managed to implement it.

If you can send me your code it would be highly appreciated.

Thanks in advance :slight_smile: