Hi, I have a report which I pass the logged user id to filter information based on what is assigned to their name something like 'My Report' But also, managers should be able to select an employee and see exactly the same information.
So, right now, I have two reports one for employee 'My Report' and another for managers 'Managers employee my report' . They both have different access who can see them through my application.
At the employee, I get $id = $this->params["userId"]; //Auth::user()->id;
$staff_id = Staff::where(['user_id' => $id])->value('id');
passed through the controller (using Laravel)
Manager's report, I do a drop-down so managers can select the employee they want to see. <h1>Planners</h1>
<div class="row form-group">
<div class="col-md-6 offset-md-3">
<?php
Select::create(array(
"name"=>"plannerNumber",
"dataStore"=>$this->dataStore("planners"),
"dataBind"=>array(
"text"=>"plannerName",
"value"=>"plannerNumber",
),
"attributes"=>array(
"class"=>"form-control"
)
));
?>
</div>
</div>
It is painful to maintain TWO reports, so would anyone have any suggestion(s) on a better way of designing this ? Ideally, I'd have one report. IF I am a manager, I can see a drop-down, if I am NOT a manager, I won't see this drop-down and system will just use my login info.
thank you