@php $propertyName = data_get($propertyDetails, 'PropertyName', 'N/A'); $propertyApi = data_get($propertyDetails, 'API', ''); /* beds24 / godo store the last NIGHT in lastNight; the actual checkout is the following day. Show the checkout date (+1) for those APIs so the End Date column matches when the guest actually leaves. */ $brafaCheckoutPlusOne = in_array(strtolower((string) $propertyApi), ['beds24', 'godo'], true); $brafaCheckoutDate = function ($lastNight) use ($brafaCheckoutPlusOne) { if (empty($lastNight)) { return 'N/A'; } if (! $brafaCheckoutPlusOne) { return $lastNight; } try { return \Carbon\Carbon::parse($lastNight)->addDay()->format('Y-m-d'); } catch (\Throwable $e) { return $lastNight; } }; @endphp
@if (session()->has('error'))
{{ session('error') }}
@endif @php /* The "Upload image" flow stores to storage/app/public/assets/img/{slug}.png, which is also the property's logo. It's frequently a transparent PNG, so we only paint it when the file actually exists and never stack a placeholder behind it (which used to bleed through transparent areas). The CSS contains the asset on a solid dark base so it FITS at any size instead of stretching. */ $heroSlug = \Illuminate\Support\Str::slug($propertyName); $heroImageExists = is_file(storage_path('app/public/assets/img/' . $heroSlug . '.png')); $heroImageUrl = $heroImageExists ? asset('storage/assets/img/' . $heroSlug . '.png') : null; $automationOn = isset($tasks['is_active']) && (int) $tasks['is_active'] === 1; $deletionOn = isset($deleteTask['is_active']) && (int) $deleteTask['is_active'] === 1; $heroTypeLabel = match (strtolower((string) $propertyApi)) { 'golfbokanir' => 'Golf', default => 'Hotel', }; $heroTypeVariant = $heroTypeLabel === 'Golf' ? 'pill--type-golf' : 'pill--type-hotel'; @endphp {{-- ============================================================ HERO — image+overlay on the left, door schedule + contact on the right. Preserves wire:submit.prevent="saveDoorTimings", wire:submit.prevent="saveEmail", wire:click="editDoorTimes", wire:click="editEmail", and the hidden file upload input. ============================================================ --}}
Property · {{ $PropertyID }}
{{ $heroTypeLabel }} @if ($automationOn) Automation on @else Automation off @endif

{{ $propertyName ?? 'N/A' }}

@if (Auth::check() && Auth::user()->role_id == 1) Staff management @endif @if (Auth::check() && in_array(Auth::user()->role_id, [1, 2])) @endif
@if (Auth::check() && in_array(Auth::user()->role_id, [1, 2])) @endif
{{-- ============================================================ STATS STRIP — black "Arrivals today" hero (2× wide) + 5 white compact cards. Reads $stats keys from the existing Livewire render() return (no PHP changes). ============================================================ --}} @php $occPercent = (int) ($stats['occupancy_percent'] ?? 0); $occHighClass = $occPercent >= 90 ? 'is-high' : ''; @endphp
Arrivals today {{ $stats['bookings_arriving_today'] ?? 0 }} guests checking in
Codes {{ $stats['codes_total'] ?? 0 }}
Rooms {{ $stats['rooms_total'] ?? 0 }}
Assigned locks {{ $stats['assigned_locks_total'] ?? 0 }}
In-house
{{ $stats['bookings_in_house'] ?? 0 }}
Rooms
{{ $stats['rooms_total'] ?? 0 }}
Assigned locks
{{ $stats['assigned_locks_total'] ?? 0 }}
Active codes
{{ $stats['codes_total'] ?? 0 }}
Occupancy
{{ $occPercent }}%
{{-- ============================================================ AUTOMATION ROW — two cards (Automation, Deletion script). Each card carries the existing wire:click bindings: register_task(), toggleTaskStatus($id), update_task_frequency($id), update_delete_task_frequency($id) and the wire:model selectedFrequency / selectedDeleteFrequency. ============================================================ --}} @if (Auth::check() && in_array(Auth::user()->role_id, [1, 2]))
{{-- ---- Automation card -------------------------- --}}

Automation

@if (!$tasks) @else @endif
{{ $automationOn ? 'Running' : 'Off' }}
{{ $tasks['frequency'] ?? 'not set' }}
Frequency @if ($tasks) @endif
{{-- ---- Deletion script card --------------------- --}}

Deletion script

@if ($deleteTask) @else Not configured @endif
{{ $deletionOn ? 'Running' : 'Off' }}
{{ $deleteTask['frequency'] ?? 'not set' }}
@if (Auth::check() && Auth::user()->role_id == 1)
Frequency @if ($deleteTask) @endif
@endif
@endif {{-- ============================================================ DETAILS CARD — tabbed table of bookings / locks / openings / assigned locks. The inner tabs and tables still emit Bootstrap markup (nav-pills, .table, dark classes). brafa-shell.css selectors below force them into the brafa look. Deep-rewrite of each table body is queued for a follow-up pass. ============================================================ --}}
Details
@if ($message) @endif @if ($error) @endif
@if($todayBookingsReady)
@if(in_array($propertyApi, ['frimann','total','fritimi'])) @endif @if(Auth::check() && Auth::user()->role_id == 3) @endif @if(empty($todayBookings)) @else @foreach($todayBookings as $booking) @if(in_array($propertyApi, ['frimann','total','fritimi'])) @endif @if(Auth::check() && Auth::user()->role_id == 3) @endif @endforeach @endif
Booking ID Name Unit NumberRoom NameStart Date End Date Info PasscodeSend Passcode Passcode Code Status Card Early CheckIn Late Checkout
No Bookings
{{ $booking['bookId'] ?? 'N/A' }} @if(!empty($booking['guestName'])) {{ $booking['guestName'] }} @else {{ $booking['guestFirstName'] ?? 'N/A' }} @endif {{ $booking['unitName'] ?? 'N/A' }}{{ $booking['roomName'] ?? 'N/A' }}{{ $booking['firstNight'] ?? 'N/A' }} {{ $brafaCheckoutDate($booking['lastNight'] ?? null) }} info

Name: {{ $booking['guestName'] ?? ($booking['guestFirstName'] ?? 'N/A') }}

Unit: {{ $booking['unitName'] ?? 'N/A' }}

@if(in_array($propertyApi, ['frimann','total','fritimi']))

Room: {{ $booking['roomName'] ?? 'N/A' }}

@endif

Start Date: {{ $booking['firstNight'] ?? 'N/A' }}

End Date: {{ $brafaCheckoutDate($booking['lastNight'] ?? null) }}

{{ substr($booking['bookId'], -4) }} @if(($booking['status'] ?? '') != 'success') @if(in_array($propertyApi, ['golf_simulator', 'golfbokanir'])) @else @endif @else check_circle @endif @if(($booking['status'] ?? '') == 'success') {{ $booking['passcode'] }} @endif @include('livewire.dashboard.partials.code-status-cell', ['booking' => $booking])
@if(!empty($booking['cardExists'])) check_circle @endif
@else
Loading...

Loading today's arrivals...

@endif
@if($bookingsReady)
@if(in_array($propertyApi, ['frimann','total','fritimi'])) @endif @if(Auth::check() && Auth::user()->role_id == 3) @endif @if(empty($bookings1)) @else @foreach($bookings1 as $booking) @if(in_array($propertyApi, ['frimann','total','fritimi'])) @endif @if(Auth::check() && Auth::user()->role_id == 3) @endif @endforeach @endif
Booking ID Name Unit NumberRoom NameStart Date End Date Info PasscodeSend Passcode Passcode Code Status Card Early CheckIn Late Checkout
No Bookings
{{ $booking['bookId'] ?? 'N/A' }} @if(!empty($booking['guestName'])) {{ $booking['guestName'] }} @else {{ $booking['guestFirstName'] ?? 'N/A' }} @endif {{ $booking['unitName'] ?? 'N/A' }}{{ $booking['roomName'] ?? 'N/A' }}{{ $booking['firstNight'] ?? 'N/A' }} {{ $brafaCheckoutDate($booking['lastNight'] ?? null) }} info

Name: {{ $booking['guestName'] ?? ($booking['guestFirstName'] ?? 'N/A') }}

Unit: {{ $booking['unitName'] ?? 'N/A' }}

@if(in_array($propertyApi, ['frimann','total','fritimi']))

Room: {{ $booking['roomName'] ?? 'N/A' }}

@endif

Start Date: {{ $booking['firstNight'] ?? 'N/A' }}

End Date: {{ $brafaCheckoutDate($booking['lastNight'] ?? null) }}

{{ substr($booking['bookId'], -4) }} @if(($booking['status'] ?? '') != 'success') @if(in_array($propertyApi, ['golf_simulator', 'golfbokanir'])) @else @endif @else check_circle @endif @if(($booking['status'] ?? '') == 'success') {{ $booking['passcode'] }} @endif @include('livewire.dashboard.partials.code-status-cell', ['booking' => $booking])
@if(!empty($booking['cardExists'])) check_circle @endif
@else
Loading...

Loading bookings...

@endif
@if($locksReady)
@if(!$scienerDetailsExists)

Enter Username and Password

@else @foreach($locks as $lock) @endforeach
Lock Alias Lock Type Electric Quantity Connection Action
role_id, [1, 2, 3])) wire:click="goToLockDetails({{ $lock['lockId'] }}, {{ $PropertyID }})" @endif> {{ $lock['lockAlias'] ?? 'N/A' }} @if(Str::startsWith($lock['lockName'], 'H31')) H31 Icon brafa Hotel FP @elseif(Str::startsWith($lock['lockName'], 'LL9246')) H31 Icon brafa Hotel @elseif(Str::startsWith($lock['lockName'], 'LL747')) H31 Icon brafa Hotel @elseif(Str::startsWith($lock['lockName'], 'M302') || Str::startsWith($lock['lockName'], 'LL9274')) M302 Icon brafa ASSA @elseif(Str::startsWith($lock['lockName'], 'LL476')) H31 Icon brafa Hotel @elseif(Str::startsWith($lock['lockName'], 'S31') || Str::startsWith($lock['lockName'], 'LL9206')) S31 Icon brafa Slim @elseif(Str::startsWith($lock['lockName'], 'K3')) K3 Icon brafa Keypad K3 @elseif(Str::startsWith($lock['lockName'], 'K2')) K3 Icon brafa Keypad K2 @elseif(Str::startsWith($lock['lockName'], 'N30')) N30 Icon brafa Cylinder @elseif(Str::startsWith($lock['lockName'], 'LL80')) LL80 Icon brafa FaceID @else {{ $lock['lockName'] ?? 'N/A' }} @endif @php $batteryLevel = $lock['electricQuantity'] ?? 0; $batteryColor = 'red'; // Default color if ($batteryLevel > 35 && $batteryLevel <= 69) { $batteryColor='orange' ; } elseif ($batteryLevel> 69) { $batteryColor = 'green'; } @endphp battery_std {{ $batteryLevel }}% @if($lock['hasGateway'] == 1) wifi Online @else signal_wifi_off Offline @endif
@endif
@else
Loading...

Loading locks...

@endif
@if($guestOpeningsReady)
@forelse($unlockRecords as $record) @empty @endforelse
Name Type Lock Time
{{ $record->username }} @switch($record->recordType) @case(-4) qr_code QR Code @break @case(1) Unlock with APP @break @case(4) dialpad PIN @break @case(7) Card @break @case(8) Fingerprint @break @case(12) Unlock via network @break @case(55) Remote Unlock @break @case(67) Facial ID Unlock @break @default Unknown @endswitch {{ \App\Models\AssignedLock::getLockName($record->lockId) }} {{ date('d/m/y H:i:s', $record->lockDate / 1000) }}
No Records
{{ $unlockRecords->links() }}
@else
Loading...

Loading guest openings...

@endif
@if($assignedLocksReady)
@foreach($assignedLockColumns as $column) @if(!in_array($column, ['created_at', 'updated_at'])) @endif @endforeach @forelse($assignedLocks as $lock) @foreach($assignedLockColumns as $column) @if(!in_array($column, ['created_at', 'updated_at'])) @endif @endforeach @empty @endforelse
Room ID Info {{ ucfirst($column) }} Action
{{ $lock['RoomID'] ?? 'N/A' }} info

Id: {{ $lock['Id'] ?? 'N/A' }}

PropertyID: {{ $lock['PropertyID'] ?? 'N/A' }}

RoomName: {{ $lock['RoomName'] ?? 'N/A' }}

RoomID: {{ $lock['RoomID'] ?? 'N/A' }}

PrimaryLockID: {{ $lock['PrimaryLockID'] ?? 'N/A' }}

PrimaryLockName: {{ $lock['PrimaryLockName'] ?? 'N/A' }}

HallwayLockID: {{ $lock['HallwayLockID'] ?? 'N/A' }}

HallwayLockName: {{ $lock['HallwayLockName'] ?? 'N/A' }}

AdditionalLockID: {{ $lock['AdditionalLockID'] ?? 'N/A' }}

AdditionalLockName: {{ $lock['AdditionalLockName'] ?? 'N/A' }}

{{ $lock[$column] ?? 'N/A' }}
No assigned locks
@else
Loading...

Loading assigned locks...

@endif
{{-- /tab-content --}}
{{-- /card.brafa-details-card --}}
@push('js') @endpush