@php
$company = DB::table('gnr_company')->first();
@endphp
{{ $company->name }}
{{ $company->address }}
@if(isset($company->poCode) && $company->poCode == 215 && Session::has('currentModule') && Session::get('currentModule') == 'microfinance' && isset($fillDateTo) && !empty($fillDateTo))
@include('microfin/miscellaneous/draftReport', ['filDate' => $fillDateTo])
@endif
@php
$empPositionId = DB::table('hr_emp_org_info')->where('emp_id_fk', Auth::user()->emp_id_fk)->value('position_id_fk');
$responsibility = DB::table('gnr_responsibilities')
->where('position_id_fk', $empPositionId)
->where(function ($query)
{
$query->where('emp_id_fk', null)
->orWhere('emp_id_fk', Auth::user()->emp_id_fk);
})
->first();
// dd($empPositionId, $responsibility);
// this is only for Region, ZOnal and Area manager
$headingParameterTitle = '';
$headingParameteValue = '';
if ($responsibility != null) {
if ($responsibility->type_code == 'REGION') {
$headingParameterTitle = 'Region:';
$headingParameteValue = DB::table('gnr_region')
->where('id', json_decode($responsibility->id_list)[0])
->value('name');
}
elseif($responsibility->type_code == 'ZONE'){
$empAreaId = DB::table('gnr_area')->where('branchId', 'REGEXP', '"' . Auth::user()->branchId .'"')->value('id');
$headingParameterTitle = 'Zone:';
$headingParameteValue = DB::table('gnr_zone')
->where('areaId', 'REGEXP', '"' . $empAreaId .'"')
->value('name');
}
elseif($responsibility->type_code == 'AREA'){
$empAreaId = DB::table('gnr_area')->where('branchId', 'REGEXP', '"' . Auth::user()->branchId .'"')->value('id');
$headingParameterTitle = 'Area:';
$headingParameteValue = DB::table('gnr_area')
->where('branchId', 'REGEXP', '"' . Auth::user()->branchId .'"')
->value('name');
}
}
@endphp