@foreach (['S01C', 'S01E', 'S01K', 'S01H', 'S01I', 'S01J'] as $kode)
@php
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@endforeach
@php
$kode = 'S01A';
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
// Jika array
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
// Jika string dengan \n
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@foreach (['S01M', 'S01G'] as $kode)
@php
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@endforeach
@foreach (['S01F', 'S01N'] as $kode)
@php
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@endforeach
@foreach (['S01L', 'S01O', 'S01P'] as $kode)
@php
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@endforeach
@foreach (['S01B', 'S01D', 'S01Q'] as $kode)
@php
$filtered_pintu = $semua_pintu->filter(function ($pintu) use ($kode) {
return str_starts_with($pintu->kodepintu, $kode);
});
$first_pintu = $filtered_pintu->first();
$has_borrower =
$first_pintu &&
isset($loker_info[$first_pintu->kodepintu]) &&
!empty($loker_info[$first_pintu->kodepintu]);
$tooltip_content = '';
if ($has_borrower) {
$names = $loker_info[$first_pintu->kodepintu];
if (is_array($names)) {
$formatted_names = array_map(function ($name) use ($first_pintu) {
return $first_pintu->kodepintu . ' - ' . $name;
}, $names);
$tooltip_content = implode('
', $formatted_names);
} else {
$tooltip_content = str_replace(
"\n",
'
' . $first_pintu->kodepintu . ' - ',
$first_pintu->kodepintu . ' - ' . $names,
);
}
}
@endphp
{{ $kode }}
@endforeach