Jump to content

Recommended Posts

Posted

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

  • Moderators
Posted (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 by Parkho
Posted (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 by aarbee
  • Moderators
Posted
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.

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...