@section('title', 'Schedule') @section('heading', 'Schedule') @section('top-menu-items') @can('write_schedule') @endcan @endsection 5 passengers {{ \Carbon\Carbon::parse($currentDate)->format('D M j, Y') }} < > Today {{ $totalTripsToday }} Total Trips Today Notes @foreach ($vessels as $vessel) {{ $vessel->name }} @if ($vessel->default_availability != 'available') Not Available @endif @php $vesselNote = $vesselNotes[$vessel->id] ?? null; @endphp @if($vesselNote && ($vesselNote['pilot_name'] || $vesselNote['aircraft_id'])) @if($vesselNote['pilot_name']) Pilot: {{ $vesselNote['pilot_name'] }} @endif @if($vesselNote['aircraft_id']) Aircraft: {{ $vesselNote['aircraft_id'] }} @endif @else Click to add pilot/aircraft @endif @endforeach @foreach ($timeSlots as $slot) {{ $slot }} @foreach ($vessels as $vessel) @php $bookingCount = 0; $bookingDetails = []; $bookedSeats = 0; @endphp @foreach ($bookings as $booking) @php $slotStart = \Carbon\Carbon::parse($slot); $slotEnd = (clone $slotStart)->addMinutes((int) $increment); $bookingTime = \Carbon\Carbon::parse($booking['start']); $slotStartTime = $slotStart->format('H:i:s'); $bookingTimeTime = $bookingTime->format('H:i:s'); $formattedSlotStart = $slotStart->format('H:i:s'); $formattedSlotEnd = $slotEnd->format('H:i:s'); $formattedBookingTime = $bookingTime->format('H:i:s'); @endphp @if ( $formattedBookingTime >= $formattedSlotStart && $formattedBookingTime < $formattedSlotEnd && $booking['vessel']==$vessel->id) @php $bookingCount++; $bookingDetails[] = $booking; $bookedSeats += $booking['seats']; @endphp @endif @endforeach @php // Calculate remaining seats based on regular bookings only (exclude block bookings) $regularBookings = collect($bookingDetails)->filter(function($b) { return !($b['hasBlockedBooking'] ?? false); }); $regularBookedSeats = $regularBookings->sum('seats'); $maxSeatsForRegular = $regularBookings->max('tour_max_seats') ?? 0; $totalSeats = min($vessel->seats, $maxSeatsForRegular); $remSeats = $totalSeats - $regularBookedSeats; $remainingSeats = max(0, $remSeats); $lastTopOffset = 0; @endphp hasRole(['Owner', 'Administrator']) || Auth::user()->can('schedule_override'); @endphp @if ( !$isHoliday && $vessel->default_availability == 'available' && (!$this->isSlotUnavailable($slot, $currentDate) || $canBooking ) && (!$this->isSlotUnavailableTour($slot, $currentDate, $vessel->id) || $canBooking ) ) wire:click="openSidebar('{{ $slot }}', '{{ $vessel->name }}', {{ $vessel->vessel_type_id }}, {{ $vessel->id }})" @else @click="window.dispatchEvent(new CustomEvent('show-blockbooking-modal'))" @endif> @foreach ($bookingDetails as $booking) @php $isRelated = in_array( $booking['id'], is_array($this->relatedBookingIds) ? $this->relatedBookingIds : $this->relatedBookingIds->toArray(), ); $isSelected = $this->selectedBookingId === $booking['id']; $slotStart = \Carbon\Carbon::parse($slot); $bookingTime = \Carbon\Carbon::parse($booking['start']); $slotStartTime = $slotStart->format('H:i:s'); $bookingTimeTime = $bookingTime->format('H:i:s'); $timeDifference = Carbon\Carbon::parse($slotStartTime)->diffInMinutes( Carbon\Carbon::parse($bookingTimeTime), false, ); $topOffset = $timeDifference * ($increment == '15' ? 4 : 2); $lastTopOffset = $topOffset; @endphp {!! $booking['notes'] !!} @if(!($booking['block'] ?? false) || ($booking['is_blocked_seats'] ?? false)) {{ $booking['seats'] }} {!! $booking['customer_partner'] !!} @if(!($booking['block'] ?? false)) {{ $booking['order'] }} {!! $booking['icon_status'] !!} @endif @endif @foreach (['customer_name', 'partner_name', 'group_title', 'title'] as $field) @if(!empty($booking[$field])) {{ $booking[$field] }} @endif @endforeach @endforeach @php $hasRegularBooking = collect($bookingDetails)->contains(function($b) { return !is_null($b['tour_id']) && !($b['hasBlockedBooking'] ?? false); }); // Get the first regular booking for duration calculation $firstRegularBooking = collect($bookingDetails)->first(function($b) { return !is_null($b['tour_id']) && !($b['hasBlockedBooking'] ?? false); }); @endphp @if ( $remainingSeats > 0 && $hasRegularBooking && $firstRegularBooking && !$booking['hasBlockedBooking'] && !$booking['private_flight'] ) + {{ $remainingSeats }} @endif @endforeach @endforeach ✖ @if ($showVesselNotes) Pilot & Aircraft Details @if($selectedVesselForNotes) @php $selectedVessel = $vessels->firstWhere('id', $selectedVesselForNotes); @endphp Vessel: {{ $selectedVessel->name }} Date: {{ \Carbon\Carbon::parse($currentDate)->format('M j, Y') }} @endif Pilot Name Aircraft ID Close @endif @if (!$showBlockSchedule && !$showBlockSeats && !$blockSchedule && !$showNotes && !$showVesselNotes ) @if ($skipBlockScheduleReset) @else @endif @endif OR @foreach ($partners as $partner) {{ $partner->organization_name }} @endforeach @if ($showBlockSchedule) @if ($selectedCustomer) Blocking Details {{-- Customer: {{ $selectedCustomer->first_name }} {{ $selectedCustomer->last_name }} --}} {{-- Tour: {{ $tourSelected->name }} --}} Seats: {{ $selectedSeats }} Dutation: {{ $selectedDuration }} Minutes @if (count($seatAllocation) > 0) Seat Allocation Vessel Name Time Slot Allocated Seats Duration @foreach ($seatAllocation as $allocation) {{ $allocation['vessel_name'] }} {{ $allocation['time'] }} {{ $allocation['allocated_seats'] }} {{ $allocation['duration'] }} min {{-- {{ \Carbon\Carbon::parse($allocation['duration'])->diffInMinutes(\Carbon\Carbon::now()) }} mins --}} @endforeach @endif Block Schedule @endif @endif @if ($showBlockSeats) @endif OR @foreach ($customers as $customer) {{ $customer->name }} ({{ $customer->email }}) @endforeach @if ($beforeStayAddress && !$orderable_id) Before Stay City - Select - Canmore Banff Calgary Edmonton Lake Louise Alberta Other British Columbia Other @error('before_stay_address') {{ $message }} @enderror @endif @if ($afterStayAddress && !$orderable_id) After Stay City - Select - Canmore Banff Calgary Edmonton Lake Louise Alberta Other British Columbia Other @error('after_stay_address') {{ $message }} @enderror @endif Primary Contact First Name Last Name Email Phone @if ($selectedPartner) Concierge Name: @endif Next Select Tour @foreach ($tours as $tour) {{ $tour['name'] }} @endforeach @error('tour_id') {{ $message }} @enderror @if ($order) Done @endif @livewire('customer-form') @livewire('partner-form') @if ($showNewOrder && !$showNotes ) @if ($selectedCustomer && $selectedCustomer->partner_id ) Partner Reference ID @error('partner_ref_id') {{ $message }} @enderror @endif @endif @if ($showNotes) Notes @endif @if ($selectedBooking) @endif @if (($showAddParticipantModal && $selectedTour) && !$isEditing) Add Participants ✖ @if(!$selectedBookingId) Max Participants canOverrideSchedule) oninput="if(parseInt(this.value) > {{ $selectedTour->max_seats }}) { this.value = {{ $selectedTour->max_seats }}; }" @endunless > Max Allowed: {{ $selectedTour->max_seats }} @error('selectedSeats') {{ $message }} @enderror @endif @if ($selectedTour->price_by_tour !== null && $selectedTour->pricePerPersons->isNotEmpty() && ( !$selectedBooking || !$selectedBooking->passengers->first()?->type === 'tour') ) Price per Tour @endif @if ($filteredPricePerPersons->isNotEmpty() && ( !$selectedBooking || $selectedBooking->passengers->first()?->type !== 'tour')) @foreach ($filteredPricePerPersons as $personType) @php $key = 'type_' . $personType['id']; @endphp {{ $personType['name'] }} Enter Names (One per row) @endforeach @if($selectedTour->private_flight_fee && !$selectedBookingId ) Private Flight Private Flight Fee @endif @endif @if ($selectedTour->price_by_tour !== null && ( !$selectedBooking || $selectedBooking->passengers->first()?->type === 'tour') ) Person Enter Names (One per row) @endif @error('seats') Error: {{ $message }} @enderror @endif {{-- JS Section --}} @push('scripts') @endpush Max Flights Reached ✖ Maximum flights reached for this date. Please create booking on another day. Add Booking ✖ Select a time slot to create a booking for order no {{ $orderId }} {{-- Block booking Model --}} Add Booking ✖ Not available Loading... @push('modals') @livewire('modals.refund-modal', ['calledFrom' => 'calendar']) @livewire('modals.bulk-discount-modal') @livewire('modals.participant-actions') @livewire('manage-participants') @endpush @push('styles') @endpush @push('scripts') @endpush
{{ $booking[$field] }}
Vessel: {{ $selectedVessel->name }}
Date: {{ \Carbon\Carbon::parse($currentDate)->format('M j, Y') }}
OR
Customer: {{ $selectedCustomer->first_name }} {{ $selectedCustomer->last_name }}
Tour: {{ $tourSelected->name }}
Seats: {{ $selectedSeats }}
Dutation: {{ $selectedDuration }} Minutes