@version(2) @load('./css/booking.css') @load('./lang') @include('_manage') @php $hm_names = [ 'hold' => $lang->hb_status_hold, 'pending' => $lang->hb_status_pending, 'confirmed' => $lang->hb_status_confirmed, 'cancelled' => $lang->hb_status_cancelled, 'noshow' => $lang->hb_status_noshow, 'done' => $lang->hb_status_done, 'expired' => $lang->hb_status_expired, ]; $hm_staff_ok = class_exists('\Zittme\Modules\Reservation\Models\Staff'); $hm_branch_ok = class_exists('\Zittme\Modules\Reservation\Models\BranchLink'); $hm_sole_branch = $hm_branch_ok ? (int)\Zittme\Modules\Reservation\Models\BranchLink::getSoleBranchSrl() : 0; $hm_site_date = function ($value, $format) { return method_exists('\Zittme\Modules\Reservation\Controllers\Base', 'siteDate') ? \Zittme\Modules\Reservation\Controllers\Base::siteDate((string)$value, $format) : zdate($value, $format); }; $hm_staff_cache = []; $hm_branch_cache = []; $hm_meta = []; foreach ((array)($bookings ?? []) as $hm_b) { $hm_staff_srl = (int)($hm_b->staff_srl ?? 0); $hm_staff = null; if ($hm_staff_srl > 0 && $hm_staff_ok) { if (!array_key_exists($hm_staff_srl, $hm_staff_cache)) { $hm_staff_cache[$hm_staff_srl] = \Zittme\Modules\Reservation\Models\Staff::get($hm_staff_srl); } $hm_staff = $hm_staff_cache[$hm_staff_srl]; } $hm_branch_srl = (int)($hm_b->branch_srl ?? 0); if ($hm_branch_srl <= 0 && $hm_staff) { $hm_branch_srl = (int)($hm_staff->branch_srl ?? 0); } if ($hm_branch_srl <= 0) { $hm_branch_srl = $hm_sole_branch; } $hm_branch_name = ''; if ($hm_branch_srl > 0 && $hm_branch_ok) { if (!array_key_exists($hm_branch_srl, $hm_branch_cache)) { $hm_br = \Zittme\Modules\Reservation\Models\BranchLink::get($hm_branch_srl); $hm_branch_cache[$hm_branch_srl] = $hm_br ? (string)($hm_br->name ?? '') : ''; } $hm_branch_name = $hm_branch_cache[$hm_branch_srl]; } $hm_meta[(int)$hm_b->booking_srl] = [ 'branch' => $hm_branch_name, 'staff' => $hm_staff ? (string)($hm_staff->name ?? '') : '', ]; } @endphp
{{ $lang->reservation_no_bookings }}
@else{{ $lang->hb_guest_lookup_note }}