@php
$userAccessibleBranchIds = App\Service\Service::getEngagedBranchesByUserId(Auth::user()->id);
$options = ['' => 'Select any'];
$configurationTypes = [
'' => 'Select any',
'samity' => 'Samity',
'member' => 'Member',
'borrower' => 'Borrower',
'loan' => 'Loan Outstanding',
'due' => 'Loan Due',
'savings' => 'Member Savings',
];
$fiscalYears = $options + DB::table('gnr_fiscal_year')->pluck('name','id')->all();
$branchOptions = $options + DB::table('gnr_branch')->select(DB::raw("CONCAT(LPAD(branchCode, 3, 0), ' - ', name) AS nameWithCode"), 'id')
->whereIn('id', $userAccessibleBranchIds)
->pluck('nameWithCode', 'id')
->all();
$componentIds = $options + DB::table('mfn_loans_product_category')->where(['status' => 1, 'softDel' => 0, 'isActive' => 1])->pluck('name', 'id')->all();
$searchElements = [
['element' => 'custom', 'id' => 'fillBranchId', 'name' => 'fillBranchId', 'type' => 'select', 'label' => 'Branch:', 'options' => $branchOptions, 'col' => 3],
['element' => 'custom', 'id' => 'configurationType', 'name' => 'configurationType', 'type' => 'select', 'label' => 'Configuration Type:', 'options' => $configurationTypes, 'col' => 2],
['element' => 'custom', 'id' => 'fiscalYearId', 'name' => 'fiscalYearId', 'type' => 'select', 'label' => 'Fiscal Year:', 'options' => $fiscalYears, 'col' => 2],
];
@endphp
@include('partials.searchPanel.main', ['searchElements' => $searchElements, 'buttonLevel' => 'Show Configuration'])