@extends('layouts.app') @section('title', 'Komputer & Sewa') @section('body')
@include('partials.sidebar', ['active' => 'computers'])
@include('partials.topbar', ['heading' => 'Komputer & sesi sewa'])

Komputer & sewa

Kelola unit komputer dan pantau sesi yang berjalan.

{{ $computers->count() }} unit
@include('partials.flash') @if ($editComputer)

Ubah komputer {{ $editComputer->code }}

@csrf @method('PUT')
Batal
@else

Tambah komputer

@csrf
@endif @if ($rates->isEmpty())
Belum ada tarif aktif. Tambahkan tarif sebelum memulai sesi sewa.
@endif
@forelse ($computers as $computer) @php($rental = $computer->rentals->first())
{{ $computer->code }}
{{ $computer->name }}
{{ $rental ? 'Digunakan' : 'Tersedia' }}
@if ($rental)
Pelanggan: {{ $rental->customer_name ?: 'Pelanggan umum' }}
Tarif: {{ $rental->rate->name }} · Rp {{ number_format($rental->hourly_rate, 0, ',', '.') }}/jam
Mulai: {{ $rental->started_at->format('d/m/Y H:i') }}
@csrf
@else
Unit siap digunakan.
@if ($rates->isNotEmpty())
@csrf
@endif @endif
Ubah @if (!$rental)
@csrf @method('DELETE')
@endif
@empty
Belum ada komputerTambahkan unit pertama menggunakan formulir di atas.
@endforelse
@endsection