@php
$data = [];
if(checkAuthPermission('frontdesk.guest_complain.master_dashboard')){
$data[] = ['id' => null, 'title' => 'All'];
$data[] = ['id' => 'unassigned', 'title' => 'Unassigned', 'bg_class' => 'bg-warning', 'text-color' => 'text-dark', 'department_id' => null];
}
$common = [
['id' => 'pending', 'title' => 'Pending', 'bg_class' => 'bg-danger', 'text-color' => 'text-white', 'department_id' => null],
['id' => 'running', 'title' => 'In Progress', 'bg_class' => 'bg-primary', 'text-color' => 'text-white', 'department_id' => null],
['id' => 'closed', 'title' => 'Completed', 'bg_class' => 'bg-success', 'text-color' => 'text-white', 'department_id' => null],
['id' => 'total', 'title' => 'Total', 'bg_class' => 'bg-secondary', 'text-color' => 'text-white', 'department_id' => null]
];
$data = array_merge($data, $common);
if(checkAuthPermission('frontdesk.guest_complain.master_dashboard')){
$hk_department_id = getOptionForeachByType(17)->where('other_info4', 'HK')->first()->id ?? null;
$mantenance_department_id = getOptionForeachByType(17)->where('other_info4', 'MAINTENANCE')->first()->id ?? null;
$data[] = ['id' => null, 'title' => 'Maintenance'];
$data[] = ['id' => 'maintenance_unassigned', 'title' => 'Unassigned', 'bg_class' => 'bg-warning', 'text-color' => 'text-dark', 'department_id' => $mantenance_department_id];
$data[] = ['id' => 'maintenance_pending', 'title' => 'Pending', 'bg_class' => 'bg-danger', 'text-color' => 'text-white', 'department_id' => $mantenance_department_id];
$data[] = ['id' => 'maintenance_running', 'title' => 'In Progress', 'bg_class' => 'bg-primary', 'text-color' => 'text-white', 'department_id' => $mantenance_department_id];
$data[] = ['id' => 'maintenance_closed', 'title' => 'Completed', 'bg_class' => 'bg-success', 'text-color' => 'text-white', 'department_id' => $mantenance_department_id];
$data[] = ['id' => 'maintenance_total', 'title' => 'Total', 'bg_class' => 'bg-secondary', 'text-color' => 'text-white', 'department_id' => $mantenance_department_id];
$data[] = ['id' => null, 'title' => 'HK', 'department_id' => null];
$data[] = ['id' => 'hk_unassigned', 'title' => 'Unassigned', 'bg_class' => 'bg-warning', 'text-color' => 'text-dark', 'department_id' => $hk_department_id];
$data[] = ['id' => 'hk_pending', 'title' => 'Pending', 'bg_class' => 'bg-danger', 'text-color' => 'text-white', 'department_id' => $hk_department_id];
$data[] = ['id' => 'hk_running', 'title' => 'In Progress', 'bg_class' => 'bg-primary', 'text-color' => 'text-white', 'department_id' => $hk_department_id];
$data[] = ['id' => 'hk_closed', 'title' => 'Completed', 'bg_class' => 'bg-success', 'text-color' => 'text-white', 'department_id' => $hk_department_id];
$data[] = ['id' => 'hk_total', 'title' => 'Total', 'bg_class' => 'bg-secondary', 'text-color' => 'text-white', 'department_id' => $hk_department_id];
}
@endphp
@foreach ($data as $d)
@if($d['id'] == null)
@else
@endif
@endforeach