Jump to content
Sign in to follow this  
vbegin7

Hide Unless High enough hours

Recommended Posts

what will be the php code to hide something if a pilot doesnt have enough hours say you dont want something seen by any member or pilot unless they have a minimum of 30 hours ? I have seen this before somewhere but dont remember

 

Share this post


Link to post
Share on other sites
2 hours ago, vbegin7 said:

what will be the php code to hide something if a pilot doesnt have enough hours say you dont want something seen by any member or pilot unless they have a minimum of 30 hours ? I have seen this before somewhere but dont remember

 

Hi, see if it works.

if(Auth::$userinfo->totalhours < 30){
echo 'You do not have permission to access this page. You must have at least 30 hours of flight';

return;
                }

Share this post


Link to post
Share on other sites

I know it's somewhere in the free charter module but I don't know exactly where. It is set for 30 hours I think and I changed it to 10 hours, but can't remember exact;y! Should be able to figure out how to use that code, maybe :)

Share this post


Link to post
Share on other sites

This should be it. Of course you'll have to figure out how to use it :) Should be if they have over 10 hours ( which is what I have my Charter Access set too ) they are granted access to use the Charter Module. Once again you would have to edit for your needs. Above my pay grade at this time! I'll post what looks to be the enter code, but I could be wrong.

 

<?php
if ((Auth::$userinfo->totalhours + Auth::$userinfo->transferhours)>10)
{
?>

 

Entire code for access:

 

 

- Of course login access

<?php
        }
        elseif(Auth::LoggedIn())
        {
        ?>

- Grant access at 10 or above hours

<?php
if ((Auth::$userinfo->totalhours + Auth::$userinfo->transferhours)>10)
{
?>

- I think this sets it for the pilot to be able to make 30 charter schedules and counts it down to zero I guess

<?php
$icao = 'CH';
$price = Auth::$userinfo->pilotid;
$count = SchedulesData::countCharterSchedules($icao, $price);
if($count < 30)
{
?>

 

Good luck. Share you code if you figure it out for another purpose :)

Edited by in2tech

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×