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

77 lines
3.2 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid p-4">
<div class="card shadow-sm p-3">
<h4 class="fw-bold" style="color: #063986;">Data Customer</h4>
<div class="d-flex justify-content-between align-items-center mb-3">
<!-- Tombol Tambah Data -->
<a href="{{ route('admin.createcustomer') }}" class="btn text-white"
style="background: linear-gradient(135deg, #8AC0DF, #48499B); border: none;">
<i class="bi bi-plus-circle"></i> Tambah Data
</a>
<!-- Form Pencarian -->
<form method="GET" action="{{ route('admin.customer') }}" class="d-flex">
<input type="text" name="search" class="form-control form-control-sm me-2"
placeholder="Cari customer..." value="{{ request()->search }}" style="max-width: 200px;">
<button type="submit" class="btn btn-outline-secondary btn-sm">Cari</button>
</form>
</div>
<!-- Tabel Data Customer -->
<div class="table-responsive">
<table class="table table-bordered text-center">
<thead class="table-primary">
<tr>
<th>No</th>
<th>Nama</th>
<th>Email</th>
<th>Rental Approved</th>
<th>Card</th>
<th>Tanggal Daftar</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach($users as $index => $user)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
<td>
@if($user->rental_approved)
<span class="badge bg-success">Disetujui</span>
@else
<span class="badge bg-warning text-dark">Belum Disetujui</span>
@endif
</td>
<td>
@if($user->id_card_path)
<a href="{{ asset($user->id_card_path) }}" target="_blank" class="btn btn-sm btn-info text-white">
Lihat
</a>
@else
<span class="text-muted">Belum Upload</span>
@endif
</td>
<td>{{ $user->created_at ? $user->created_at->format('d-m-Y') : '-' }}</td>
<td>
<a href="{{ route('admin.editcustomer', ['id_user' => $user->id_user]) }}" class="text-primary me-2">
<i class="bi bi-pencil-square"></i>
</a>
<a href="{{ route('admin.deletecustomer', ['id_user' => $user->id_user]) }}" class="text-danger"
onclick="return confirm('Apakah Anda yakin ingin menghapus user ini?');">
<i class="bi bi-trash-fill"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection