83 lines
3.7 KiB
PHP
83 lines
3.7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', $customer->name)
|
|
|
|
@section('content')
|
|
<div class="mb-8">
|
|
<a href="{{ route('customers.index') }}" class="text-blue-600 hover:text-blue-800 flex items-center gap-2 mb-4">
|
|
<i class="fas fa-arrow-left"></i> Back to Customers
|
|
</a>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-200 p-8">
|
|
<div class="flex items-center gap-4 mb-6">
|
|
<div class="w-16 h-16 rounded-full bg-gradient-to-br from-purple-400 to-pink-500 flex items-center justify-center text-white text-2xl font-bold">
|
|
{{ substr($customer->name, 0, 1) }}
|
|
</div>
|
|
<div>
|
|
<h2 class="text-2xl font-bold text-gray-800">{{ $customer->name }}</h2>
|
|
<span class="px-3 py-1 rounded-full text-sm font-medium
|
|
{{ $customer->status == 'active' ? 'bg-green-100 text-green-700' :
|
|
($customer->status == 'inactive' ? 'bg-gray-100 text-gray-700' : 'bg-red-100 text-red-700') }}">
|
|
{{ ucfirst($customer->status) }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
<div>
|
|
<p class="text-sm text-gray-500">Email</p>
|
|
<p class="font-medium text-gray-800">{{ $customer->email }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">Phone</p>
|
|
<p class="font-medium text-gray-800">{{ $customer->phone }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">License Number</p>
|
|
<p class="font-medium text-gray-800">{{ $customer->license_number }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">License Expiry</p>
|
|
<p class="font-medium text-gray-800">{{ $customer->license_expiry }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-6">
|
|
<h3 class="text-xl font-bold text-gray-800 mb-4">Rental History</h3>
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden">
|
|
<table class="w-full">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Car</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Dates</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Amount</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200">
|
|
@forelse($customer->rentals as $rental)
|
|
<tr>
|
|
<td class="px-6 py-4">{{ $rental->car->brand }} {{ $rental->car->model }}</td>
|
|
<td class="px-6 py-4">{{ $rental->start_date->format('M d') }} - {{ $rental->end_date->format('M d, Y') }}</td>
|
|
<td class="px-6 py-4"> BHD {{ number_format($rental->total_amount, 0) }}</td>
|
|
<td class="px-6 py-4">
|
|
<span class="px-2 py-1 rounded text-xs font-medium
|
|
{{ $rental->status == 'active' ? 'bg-green-100 text-green-700' :
|
|
($rental->status == 'pending' ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-700') }}">
|
|
{{ $rental->status }}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="px-6 py-8 text-center text-gray-500">No rentals yet</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endsection
|