Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,46 @@
|
||||
<x-app-layout>
|
||||
<div class="container mx-auto my-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h2 class="text-2xl font-semibold">Cancel booking</h2>
|
||||
<a href="{{ route('student.bookings.index') }}" class="text-blue-600 hover:underline">← Back to My bookings</a>
|
||||
</div>
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="mb-4 p-3 rounded bg-red-50 text-red-700 text-sm">
|
||||
<ul class="list-disc pl-5">
|
||||
@foreach ($errors->all() as $err)
|
||||
<li>{{ $err }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="border rounded p-4 bg-white shadow-sm space-y-2">
|
||||
<p><span class="font-semibold">When:</span> {{ $weekdayName }} {{ $prettyDate }} at {{ $prettyTime }}</p>
|
||||
<p><span class="font-semibold">Refund:</span> {{ $refundPercent }}%</p>
|
||||
<p class="text-sm text-gray-600">
|
||||
Cancellations made 24 hours or more in advance receive a full (100%) refund.
|
||||
Cancellations within 24 hours receive a 50% refund.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{{-- Confirm cancel (POST) --}}
|
||||
<form action="{{ route('student.bookings.cancel.store', ['booking' => $booking->id]) }}"
|
||||
method="POST"
|
||||
class="mt-6 border rounded p-4 bg-white shadow-sm flex items-center gap-3">
|
||||
@csrf
|
||||
<button type="submit" class="px-4 py-2 rounded bg-red-600 text-white hover:bg-red-700">
|
||||
Confirm cancellation
|
||||
</button>
|
||||
<a href="{{ route('student.bookings.index') }}" class="text-blue-600 hover:underline">
|
||||
Keep this booking
|
||||
</a>
|
||||
</form>
|
||||
|
||||
@if ($minutesUntil < 24*60)
|
||||
<div class="mt-3 text-sm text-amber-700 bg-amber-50 border border-amber-200 rounded p-3">
|
||||
Heads up: this session starts in less than 24 hours, so the refund will be 50%.
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,51 @@
|
||||
<x-app-layout>
|
||||
<div class="container mx-auto my-6">
|
||||
<h2 class="text-2xl font-semibold mb-4">Book a Session</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">← Back to calendar</a>
|
||||
</div>
|
||||
|
||||
{{-- Prefilled details from controller (no Carbon in Blade) --}}
|
||||
<div class="border rounded p-4 bg-white shadow-sm space-y-1">
|
||||
<p><span class="font-semibold">When:</span> {{ $weekdayName }} {{ $prettyDate }} at {{ $prettyTime }}</p>
|
||||
<p><span class="font-semibold">Date (value to save):</span> {{ $date }}</p>
|
||||
<p><span class="font-semibold">Slot ID:</span> {{ $slot->id }}</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 text-sm text-gray-600">
|
||||
Next step: we’ll add a confirmation step (and later, payment) before creating the booking.
|
||||
</div>
|
||||
|
||||
<form action="{{ route('student.bookings.store') }}" method="POST" class="mt-6 border rounded p-4 bg-white shadow-sm space-y-4">
|
||||
@csrf
|
||||
|
||||
{{-- keep the selected date/slot --}}
|
||||
<input type="hidden" name="date" value="{{ $date }}">
|
||||
<input type="hidden" name="slot_id" value="{{ $slot->id }}">
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="p-3 rounded bg-red-50 text-red-700 text-sm">
|
||||
<ul class="list-disc pl-5">
|
||||
@foreach ($errors->all() as $err)
|
||||
<li>{{ $err }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1" for="message">Message (optional)</label>
|
||||
<textarea id="message" name="message" rows="3" class="w-full border rounded px-3 py-2">{{ old('message') }}</textarea>
|
||||
@error('message') <p class="text-sm text-red-600 mt-1">{{ $message }}</p> @enderror
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<button type="submit" class="px-4 py-2 rounded bg-indigo-600 text-white hover:bg-indigo-700">
|
||||
Confirm booking
|
||||
</button>
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,31 @@
|
||||
@include('partials.flash')
|
||||
<x-app-layout>
|
||||
<div class="container mx-auto my-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h2 class="text-2xl font-semibold">My bookings</h2>
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">← Back to calendar</a>
|
||||
</div>
|
||||
|
||||
@if ($bookings->isEmpty())
|
||||
<div class="border rounded p-4 bg-white shadow-sm text-gray-700">
|
||||
You don’t have any upcoming bookings yet.
|
||||
</div>
|
||||
@else
|
||||
<div class="space-y-3">
|
||||
@foreach ($bookings as $b)
|
||||
<div class="border rounded p-4 bg-white shadow-sm flex items-center justify-between">
|
||||
<div>
|
||||
<div class="font-semibold">{{ $b['weekday'] }} {{ $b['prettyDate'] }} at {{ $b['prettyTime'] }}</div>
|
||||
<div class="text-sm text-gray-600">Status: {{ ucfirst($b['status']) }}</div>
|
||||
</div>
|
||||
{{-- Cancel action will be added in the next step --}}
|
||||
<a href="{{ route('student.bookings.cancel.confirm', ['booking' => $b['id']]) }}"
|
||||
class="px-3 py-2 rounded bg-red-600 text-white hover:bg-red-700">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,71 @@
|
||||
<x-app-layout>
|
||||
<div class="container mx-auto my-6">
|
||||
<h2 class="text-2xl font-semibold mb-4">Book a Weekly Series</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">← Back to calendar</a>
|
||||
</div>
|
||||
|
||||
{{-- Prefilled details from controller (no Carbon in Blade) --}}
|
||||
<div class="border rounded p-4 bg-white shadow-sm space-y-1 mb-6">
|
||||
<p><span class="font-semibold">When:</span> {{ $weekdayName }} {{ $prettyDate }} at {{ $prettyTime }}</p>
|
||||
<p><span class="font-semibold">Start date (value to save):</span> {{ $date }}</p>
|
||||
<p><span class="font-semibold">Slot ID:</span> {{ $slot->id }}</p>
|
||||
</div>
|
||||
|
||||
{{-- Adjust weeks via GET (keeps things simple for now) --}}
|
||||
<form action="{{ route('student.bookings.series.create') }}" method="GET" class="border rounded p-4 bg-white shadow-sm space-y-4">
|
||||
<input type="hidden" name="date" value="{{ $date }}">
|
||||
<input type="hidden" name="slot_id" value="{{ $slot->id }}">
|
||||
|
||||
<div>
|
||||
<label for="weeks" class="block text-sm font-medium mb-1">How many weeks?</label>
|
||||
<input id="weeks" name="weeks" type="number" min="1" max="52" value="{{ $weeks }}" class="w-32 border rounded px-3 py-2">
|
||||
<p class="text-xs text-gray-600 mt-1">We’ll repeat this weekday/time for the next N weeks.</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<button type="submit" class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300">
|
||||
Update weeks
|
||||
</button>
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="mt-6 text-sm text-gray-600">
|
||||
Next: we’ll add a <em>Confirm series</em> step (and later, a payment step) before creating the bookings.
|
||||
</div>
|
||||
|
||||
<form action="{{ route('student.bookings.series.store') }}" method="POST" class="mt-6 border rounded p-4 bg-white shadow-sm space-y-4">
|
||||
@csrf
|
||||
|
||||
{{-- keep selected values --}}
|
||||
<input type="hidden" name="date" value="{{ $date }}">
|
||||
<input type="hidden" name="slot_id" value="{{ $slot->id }}">
|
||||
<input type="hidden" name="weeks" value="{{ $weeks }}">
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="p-3 rounded bg-red-50 text-red-700 text-sm">
|
||||
<ul class="list-disc pl-5">
|
||||
@foreach ($errors->all() as $err)
|
||||
<li>{{ $err }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<p class="text-sm text-gray-700">
|
||||
This will create <strong>{{ $weeks }}</strong> weekly bookings starting
|
||||
{{ $weekdayName }} {{ $prettyDate }} at {{ $prettyTime }}.
|
||||
</p>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<button type="submit" class="px-4 py-2 rounded bg-indigo-600 text-white hover:bg-indigo-700">
|
||||
Confirm series ({{ $weeks }} weeks)
|
||||
</button>
|
||||
<a href="{{ route('student.calendar') }}" class="text-blue-600 hover:underline">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in new issue
Block a user