@extends('layouts.app') @section('title', 'Data Paket - INUFA') @section('header', 'Paket Sound System') @section('content')
@if(auth()->user()->tipe_pengguna === 'admin')
Tambah Paket
@endif
@foreach($pakets as $paket)
@if($paket->image) {{ $paket->nama_paket }} @else
@endif @php $activeSewa = $paket->sewas()->whereIn('status', ['confirmed', 'ongoing'])->count(); @endphp @if($activeSewa > 0)

Sedang Disewa

{{ $activeSewa }} dari {{ $paket->stok }} unit disewa

@endif

{{ $paket->nama_paket }}

Harga: Rp {{ number_format($paket->harga, 0, ',', '.') }}
Jenis: {{ ucfirst($paket->jenis_paket) }}
Stok: {{ $paket->stok }} @if($activeSewa > 0) ({{ $paket->stok - $activeSewa }} tersedia) @endif
Status: @if($paket->status == 'aktif') @if(($paket->stok - $activeSewa) > 0) Aktif ({{ $paket->stok - $activeSewa }} unit tersedia) @else Sedang Disewa Semua @endif @else {{ ucfirst($paket->status) }} @endif
@if($paket->ongkirKota->count() > 0)
Ongkir per Kota:
@foreach($paket->ongkirKota as $ongkir)
{{ $ongkir->nama_kota }} Rp {{ number_format($ongkir->biaya_ongkir, 0, ',', '.') }}
@endforeach
@endif
@if($paket->keterangan)

{{ $paket->keterangan }}

@endif @if(auth()->user()->tipe_pengguna === 'admin')
@if($activeSewa > 0)
@csrf
@csrf
@endif
Edit
@csrf @method('DELETE')
@endif
@endforeach
@endsection