CHANGE_User list head role based hide and show - VADIVEL J 2025-10-27 15:24

This commit is contained in:
vadivelJ96 2025-10-27 15:24:55 +05:30
parent 73a12f57a9
commit 47c4589283

View File

@ -342,6 +342,13 @@ table.dataTable tbody td {
</style>
<?php
$session = \Config\Services::session();
$currentLogInRole = $session->get()['userData']->role;
?>
<!-- End ADD and EDIT Page HTML -->
<div class="row" id="List-page">
@ -511,7 +518,16 @@ table.dataTable tbody td {
</label>
<select class="form-control" id="role" name="role" required>
<option value="">Select Role</option>
<?php foreach($roleData as $value) { ?>
<?php foreach($roleData as $value) {
$headRoleValue = $value['id']??"";
// we are showing head role only to head's who logged in
if($headRoleValue == "5" && $currentLogInRole != "5" ){
continue;
}
?>
<option value="<?= $value['id'] ?>"><?= $value['role'] ?></option>
<?php } ?>
</select>
@ -522,7 +538,16 @@ table.dataTable tbody td {
<span class="tooltip-trigger mdi mdi-information-outline" id="accessMatrixTrigger"></span>
</label>
<select hidden class="form-control" id="team" name="team[]" multiple required>
<?php foreach($teamData as $value) { ?>
<?php foreach($teamData as $value) {
$teamValue = $value['id']??"";
// we are showing head role only to head's who logged in
if( ($teamValue == "4" || $teamValue =="6" ) && $currentLogInRole != "5" ){
continue;
}
?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
<?php } ?>
</select>