Files
Mark Gregory 1e06af2105
tests / ci (push) Canceled after 0s
Initial Commit
2026-10-15 16:51:54 +01:00

1 line
2.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('lodge.layout')@section('title','Manage bookings | Cresta 31')@section('content')<div class="subhero"><div class="wrap"><h1>Manage bookings</h1></div></div><main class="section wrap">@if(session('success'))<p>{{ session('success') }}</p>@endif@if($errors->any())<div class="errors">{{ $errors->first() }}</div>@endif<div style="overflow-x:auto"><table><thead><tr><th>Reference</th><th>Guest</th><th>Dates</th><th>Guests</th><th>Total</th><th>Status</th><th>Action</th></tr></thead><tbody>@forelse($bookings as $b)<tr><td>{{ $b->reference }}</td><td>{{ $b->guest_name }}<br><small>{{ $b->guest_email }}<br>{{ $b->guest_phone }}</small></td><td>{{ $b->check_in->format('d M Y') }} – {{ $b->check_out->format('d M Y') }}</td><td>{{ $b->guests }}</td><td>£{{ number_format($b->total_pence/100,2) }}</td><td>{{ ucfirst($b->status) }}</td><td><form method="post" action="{{ route('lodge.update',$b) }}">@csrf @method('PATCH')<select name="status"><option value="pending" @selected($b->status==='pending')>Pending</option><option value="confirmed" @selected($b->status==='confirmed')>Confirmed</option><option value="cancelled" @selected($b->status==='cancelled')>Cancelled</option></select><button style="margin-top:8px">Save</button></form></td></tr>@empty<tr><td colspan="7">No bookings yet.</td></tr>@endforelse</tbody></table></div><div style="margin-top:25px">{{ $bookings->links() }}</div><section style="margin-top:45px"><h2>Lodge photographs</h2><p>Upload JPEG, PNG or WebP photographs. Images are automatically resized and converted to WebP, and remain available after deployments.</p><form action="{{ route('lodge.photos.store') }}" method="post" enctype="multipart/form-data" style="background:#fff;padding:24px">@csrf<label for="photos">Photographs (up to 10 at once, 15 MB each)</label><input id="photos" name="photos[]" type="file" accept="image/jpeg,image/png,image/webp" multiple required><button style="margin-top:15px">Upload and optimise</button></form><div class="gallery" style="margin-top:25px">@foreach($photos as $photo)<div><img src="{{ asset('storage/'.$photo->thumbnail_path) }}" alt="{{ $photo->alt_text }}" loading="lazy"><form action="{{ route('lodge.photos.destroy',$photo) }}" method="post" onsubmit="return confirm('Delete this photograph?')">@csrf @method('DELETE')<button style="margin-top:8px">Delete</button></form></div>@endforeach</div></section></main>@endsection