@extends('layouts.master')
@section('title', 'Hotel Booking')
@section('content')
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h3 class="mb-0">Hotel Booking List</h3>
<a href="{{ route('hotel.create') }}" class="btn btn-primary btn-sm">
Add New Hotel
</a>
</div>
<div class="card-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>SL</th>
<th>Agency</th>
<th>Hotel Name</th>
<th>Owner Name</th>
<th>Representative</th>
<th>Tasria</th>
<th>Total Site</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($hotels as $hotel)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $hotel->agency->name }}</td>
<td>{{ $hotel->hotel_name }}</td>
<td>{{ $hotel->owner_name }}</td>
<td>
{{ $hotel->representative_name }} <br>
{{ $hotel->phone_number }}
</td>
<td>
{{ $hotel->tasria_owner }} <br>
{{ $hotel->tasria_number }}
</td>
<td>{{ $hotel->total_seat }}</td>
<td>
@if ($hotel->status == 0)
<span class="btn btn-warning btn-sm">Pandding</span>
@elseif ($hotel->status == 1)
<span class="btn btn-success btn-sm">Active</span>
@else
<span class="btn btn-danger btn-sm">Blocked</span>
@endif
</td>
<td>
<a href="{{ route('hotel.show', $hotel->id) }}" class="btn btn-primary btn-sm">
View
</a>
</td>
</tr>
@empty
<tr>
<td colspan="8" class="text-center">No hotels found.</td>
</tr>
@endforelse
</tbody>
<tfoot>
<tr>
<th>SL</th>
<th>Agency</th>
<th>Hotel Name</th>
<th>Owner Name</th>
<th>Representative</th>
<th>Tasria</th>
<th>Total Site</th>
<th>Status</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div> <!-- /.card-body -->
</div> <!-- /.card -->
</div> <!-- /.col -->
</div> <!-- /.row -->
</div>
@endsection
@section('scripts')
<script>
$(function() {
$("#example1").DataTable({
"responsive": true,
"lengthChange": false,
"autoWidth": false,
"buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
}).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
});
</script>
@endsection