{{-- list --}} @extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
@if (isset($authorize) && $authorize->add == '1')
@endif
FILTER PEMINJAMAN BARANG
@include('components.alert')
@php $currentRole = strtolower(auth()->user()->idroles ?? ''); $currentRoles = array_filter(array_map('trim', explode(',', $currentRole))); if (empty($currentRoles)) { $currentRoles = ['guests']; } $isHeadSView = in_array('head.s', $currentRoles); $isItstafGuestsView = in_array('itstaf', $currentRoles) && in_array('guests', $currentRoles); $isItstafHeadSView = in_array('itstaf', $currentRoles) && in_array('head.s', $currentRoles); $showTabs = $isHeadSView || $isItstafGuestsView || $isItstafHeadSView; $hasThreeTabs = $has_three_tabs ?? false; $tabUserLabel = $isItstafHeadSView ? 'Approve IT' : ($isItstafGuestsView ? 'Approval IT' : 'Approval SPV'); @endphp @if ($showTabs)
{{-- Tab: Pengajuan Saya --}}
LIST PENGAJUAN SAYA
@include('transc.trpjbr._list_table_head') @foreach ($own_requests ?? [] as $r) @include('transc.trpjbr._list_table_row', ['r' => $r]) @endforeach
{{-- Tab: Approve IT / IT Staf / Pengajuan User --}}
{{ $tabUserLabel }}
@include('transc.trpjbr._list_table_head') @foreach ($requests ?? [] as $r) @include('transc.trpjbr._list_table_row', ['r' => $r]) @endforeach
@if ($hasThreeTabs) {{-- Tab: Pengajuan User (head.s scope) --}}
LIST PENGAJUAN USER
@include('transc.trpjbr._list_table_head') @foreach ($spv_requests ?? [] as $r) @include('transc.trpjbr._list_table_row', ['r' => $r]) @endforeach
@endif
@else {{-- Tampilan biasa: hanya itstaf atau hanya guests --}}
LIST PEMINJAMAN BARANG
@include('transc.trpjbr._list_table_head') @foreach ($requests ?? [] as $r) @include('transc.trpjbr._list_table_row', ['r' => $r]) @endforeach
@endif
{{-- Modal Konflik Perpanjangan --}} {{-- Modal Pilih Asset Pengganti --}} @endsection @php function statusBadge($status) { $status = strtolower($status); return match ($status) { 'rejected' => 'REJECTED', 'completed' => 'COMPLETE', 'approve' => 'APPROVE', 'borrowed' => 'BORROWED', 'on_progress' => 'ONPROGRESS', 'proposed' => 'PROPOSED', 'entry' => 'ENTRY', 'revisi' => 'REVISI', default => '' . e(strtoupper($status ?: '-')) . '', }; } @endphp @push('js') @endpush