@extends('layouts/gnr_layout') @section('title', '| User Role') @section('content') @include('successMsg') @php $pageNo = isset($_GET['page']) ? (int) $_GET['page']: 1; $branchSelected = isset($_GET['filBranch']) ? $_GET['filBranch'] : null; $roleSelected = isset($_GET['filRole']) ? $_GET['filRole'] : null; $empIdSelected = isset($_GET['filEmpId']) ? $_GET['filEmpId'] : null; @endphp

USER ROLE LIST

{!! Form::open(array('url' => 'viewGnrUserRole', 'role' => 'form', 'class'=>'form-horizontal form-groups', 'id' => 'filterFormId', 'method'=>'get')) !!}
@if($userBranchId == 1)
{!! Form::label('', 'Branch:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('filBranch', [''=>'--All--']+$branchList, $branchSelected ,['id'=>'filBranch','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
@endif
{!! Form::label('', 'Role:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('filRole', [''=>'--All--']+$roleList, $roleSelected ,['id'=>'filRole','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
{!! Form::label('', 'Emp. ID:', ['class' => 'control-label pull-left']) !!}
{!! Form::text('filEmpId', $empIdSelected ,['id'=>'filEmpId','class'=>'form-control input-sm','autocomplete'=>'off']) !!}
{!! Form::label('', '', ['class' => 'control-label col-md-12']) !!}
{!! Form::submit('Search', ['id' => 'searchButton', 'class' => 'btn btn-primary btn-xs']); !!}
{!! Form::close() !!} @foreach($userRoleLists as $key => $userRole) @php $empId = DB::table('users')->where('id',$userRole->userIdFK)->select('emp_id_fk','username')->first(); $employee = DB::table('hr_emp_general_info')->where('id',$empId->emp_id_fk)->select('emp_id','emp_name_english')->first(); if ($employee == NULL) { $employeeName = $empId->username; } else{ $employeeName = $employee->emp_id.'-'.$employee->emp_name_english; } $getBranchInfos = DB::table('hr_emp_general_info') ->join('hr_emp_org_info', 'hr_emp_general_info.id', '=', 'hr_emp_org_info.emp_id_fk') ->where('hr_emp_general_info.emp_id', $employee->emp_id) ->pluck('hr_emp_org_info.branch_id_fk') ->toArray(); $branchNameInfos = DB::table('gnr_branch') ->where('id', $getBranchInfos[0]) ->pluck('name') ->toArray(); $branchCodeInfos = DB::table('gnr_branch') ->where('id', $getBranchInfos[0]) ->pluck('branchCode') ->toArray(); $roleName = DB::table('gnr_role')->select('name')->where('id',$userRole->roleId)->value('name'); @endphp @endforeach
SL# User Name Branch Role Action
{{($pageNo-1)*30+($key+1)}} {{$employeeName}} {{$branchCodeInfos[0]}}-{{$branchNameInfos[0]}} {{$roleName}}  
{{ $userRoleLists->appends(request()->input())->links() }}
{{-- Valid Till Modal --}} {{-- Valid Till Modal --}} @php $roles = array(''=>'Select Role') + DB::table('gnr_role')->where('id','>=',2)->pluck('name','id')->toArray(); $modules = DB::table('gnr_module')->select('id','name','code')->get(); $subFunctions = DB::table('gnr_sub_function')->select('id','subfunctionName')->get(); @endphp {{-- Edit Modal --}} {{-- End View Modal --}} {{-- Delete Modal --}} {{-- End Delete Modal --}} @include('dataTableScript') @endsection