@if($isToday && $status==='occupied' && $current)
@php
$sMin=(int)substr($current->start_time,0,2)*60+(int)substr($current->start_time,3,2);
$eMin=(int)substr($current->end_time,0,2)*60+(int)substr($current->end_time,3,2);
$nMin=\Carbon\Carbon::now('Asia/Jakarta')->hour*60+\Carbon\Carbon::now('Asia/Jakarta')->minute;
$pct=min(100,max(0,round(($nMin-$sMin)/($eMin-$sMin)*100)));
$sisaMenit=max(0,$eMin-$nMin);
$nextAfter=$upcomings->isNotEmpty()?substr($upcomings->last()->end_time,0,5):substr($current->end_time,0,5);
@endphp
Sedang Digunakan
Free {{ $nextAfter }}
{{ $current->requester_name }}
@if($current->department)
{{ $current->department }}
@endif
Keperluan
{{ $current->purpose ?: '-' }}
โฐ {{ substr($current->start_time,0,5) }} โ {{ substr($current->end_time,0,5) }}
sisa {{ $sisaMenit }} menit
Mulai {{ substr($current->start_time,0,5) }}
{{ $pct }}% selesai
Selesai {{ substr($current->end_time,0,5) }}
@elseif($activeSched->isNotEmpty())
@php $next=$activeSched->first(); @endphp
โ {{ $isToday?'Jadwal Berikutnya':'Jadwal '.$filterCarbon->format('d M') }}
@if($freeAfter)Free {{ $freeAfter }}@endif
{{ $next->requester_name }}
@if($next->department)
{{ $next->department }}
@endif
Keperluan
{{ $next->purpose ?: '-' }}
โฐ {{ substr($next->start_time,0,5) }} โ {{ substr($next->end_time,0,5) }}
@else
โ
Ruangan Tersedia
Tidak ada jadwal {{ $isToday?'hari ini':$filterCarbon->format('d M') }}
@endif
Jadwal {{ $isToday?'Hari Ini':$filterCarbon->format('d M Y') }}
@if($activeSched->count()>0)
{{ $activeSched->count() }}
@endif
@if($activeSched->count()>0)
Nama ยท Dept
Keperluan
Jam
@foreach($activeSched as $i=>$sched)
@php
$isNow=$isToday && substr($sched->start_time,0,5)<=$nowTime && $nowTime
end_time,0,5);
$border=$i<$activeSched->count()-1?'border-bottom:1px solid #f3f4f6;':'';
@endphp
{{ $sched->requester_name }}
@if($sched->department)
{{ $sched->department }}
@endif
{{ Str::limit($sched->purpose,28) }}
{{ substr($sched->start_time,0,5) }}โ{{ substr($sched->end_time,0,5) }}
@if($isNow)
AKTIF
@else
BERIKUTNYA
@endif
@endforeach
@else
๐ญ
Belum ada jadwal {{ $isToday?'hari ini':$filterCarbon->format('d M Y') }}
@endif