smokey68 Posted July 6, 2018 Report Share Posted July 6, 2018 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 Quote Link to comment Share on other sites More sharing options...
gio1961 Posted July 6, 2018 Report Share Posted July 6, 2018 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; } Quote Link to comment Share on other sites More sharing options...
in2tech Posted July 6, 2018 Report Share Posted July 6, 2018 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 Quote Link to comment Share on other sites More sharing options...
smokey68 Posted July 7, 2018 Author Report Share Posted July 7, 2018 I'll try it thanks Quote Link to comment Share on other sites More sharing options...
in2tech Posted July 7, 2018 Report Share Posted July 7, 2018 (edited) 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 July 7, 2018 by in2tech Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.