MIF_E31220480/resources/views/Admin/dashboard.blade.php

114 lines
7.1 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid p-4" style="background-color: #F5F5F5; border-radius: 10px;">
<h3 class="fw-bold" style="color: #063986;">Selamat Datang Di Kos Calista</h3>
<div class="row mt-4">
<div class="col-md-4">
<div class="card border shadow-sm">
<div class="card-body text-center p-4">
<div class="d-flex justify-content-center">
<div class="rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px; background-color: #0080B5;">
<i class="bi bi-person-badge-fill text-white" style="font-size: 30px;"></i>
</div>
</div>
<h3 class="fw-bold mt-3 mb-0">{{ $totalUsers }}</h3>
<p class="mb-0">Total Customer</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card border shadow-sm">
<div class="card-body text-center p-4">
<div class="d-flex justify-content-center">
<div class="rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px; background-color: #0080B5;">
<i class="bi bi-door-closed-fill text-white" style="font-size: 30px;"></i>
</div>
</div>
<h3 class="fw-bold mt-3 mb-0">{{ $totalRooms }}</h3>
<p class="mb-0">Total Kamar</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card border shadow-sm">
<div class="card-body text-center p-4">
<div class="d-flex justify-content-center">
<div class="rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px; background-color: #0080B5;">
<i class="bi bi-journal-check text-white" style="font-size: 30px;"></i>
</div>
</div>
<h3 class="fw-bold mt-3 mb-0">{{ $totalBookings }}</h3>
<p class="mb-0">Total Booking</p>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<div class="card border shadow-sm">
<div class="card-header bg-white">
<h5 class="mb-0 fw-bold text-primary">Pemesanan Belum Dikonfirmasi</h5>
</div>
<div class="card-body p-4">
@if($pendingBookings->isEmpty())
<p class="text-muted mb-0">Belum ada pemesanan yang menunggu konfirmasi.</p>
@else
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead class="table-light">
<tr>
<th>No</th>
<th>Nama Customer</th>
<th>Kamar</th>
<th>Tanggal Pemesanan</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@foreach ($pendingBookings as $index => $booking)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $booking->user->name }}</td>
<td>{{ $booking->room->room_type }}</td>
<td>
{{ \Carbon\Carbon::parse($booking->tanggal_checkin)->format('d M Y') }}
-
{{ \Carbon\Carbon::parse($booking->tanggal_checkout)->format('d M Y') }}
</td>
<td>
<span class="badge bg-warning text-dark">Belum Dikonfirmasi</span>
</td>
<td class="flex gap-2 justify-start">
<!-- Tombol Konfirmasi -->
<form action="{{ route('admin.bookingconfirm', $booking->id_booking) }}" method="POST" class="flex items-center">
@csrf
@method('PUT')
<button type="submit" class="btn btn-sm btn-success flex items-center gap-1">
<i class="bi bi-check-circle-fill"></i> Konfirmasi
</button>
</form>
<!-- Tombol Batalkan -->
<form action="{{ route('admin.bookingcancel', $booking->id_booking) }}" method="POST" class="flex items-center" onsubmit="return confirm('Apakah Anda yakin ingin membatalkan booking ini?')">
@csrf
@method('PUT')
<button type="submit" class="btn btn-sm btn-danger flex items-center gap-1">
<i class="bi bi-x-circle-fill"></i> Batalkan
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection