Jump to content

Hide Unless High enough hours


smokey68

Recommended Posts

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

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...