aarbee Posted June 6, 2017 Report Posted June 6, 2017 I had upgraded this winter from PHPVMS 2.9 to 5.5. Today I had been notified about by a pilot with a low rank, that he could see also very new schedules meant for higher ranks. He even did send me a screenshot. I had checked everything and it seemed that all I had created was correct. After a check of the database, I saw at the fleet table, that there is a rank column and a minimum rank column. And the content is different in them. Except for changing stuf in the database I do not know where to change that on the website. Anybody a tip? Thanks ahead, RobB Quote
Moderators Parkho Posted June 7, 2017 Moderators Report Posted June 7, 2017 (edited) For the ranking limitation you have two tables to work with. First is the aircraft and second is the pilot table. In aircraft table u can use any of the table rank columns, so it doesn't matter if they're different but use the one that is more correct for your system. And finally, you'll have to hide those schedules that are assigned to an aircraft with higher rank than the pilot rank. Use the following code inside "foreach" loop in "schedule_results.php" and you should be fine. $aircraftrank = OperationsData::getAircraftByReg($schedule->registration); if($aircraft->ranklevel >= Auth::$userinfo->ranklevel) { continue; } Note: "ranklevel" can be replaced with "minranklevel". Normally they are the same in DB but in your case they're not. Edited June 7, 2017 by Parkho Quote
aarbee Posted June 7, 2017 Author Report Posted June 7, 2017 (edited) Parkho, Thanks, will try it out. I only have 1 rank table in the database.Should I have a second one? Never knew that. Rob Edited June 7, 2017 by aarbee Quote
Moderators Parkho Posted June 12, 2017 Moderators Report Posted June 12, 2017 On 6/7/2017 at 11:37 PM, aarbee said: Parkho, Thanks, will try it out. I only have 1 rank table in the database.Should I have a second one? Never knew that. Rob There is only 1 rank table but it's being used in 2 other tables. Pilots and Aircraft. Quote
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.