@extends('layouts.app') @section('title', 'جداول الأطباء') @section('page_title', 'جداول الأطباء') @section('content') @php $fmt12 = function($t) { if (!$t) return ''; [$hh,$mm] = explode(':', $t); $ampm = ((int)$hh) < 12 ? 'صباحًا' : 'مساءً'; $h12 = ((int)$hh) % 12; if ($h12 === 0) { $h12 = 12; } return sprintf('%02d:%s %s', $h12, $mm, $ampm); }; // Build 15-min time options $timeOptions = []; for ($h = 0; $h < 24; $h++) { for ($m = 0; $m < 60; $m += 15) { $timeOptions[] = sprintf('%02d:%02d', $h, $m); } } // Database uses: 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday // Display order: Saturday(6), Sunday(0), Monday(1), Tuesday(2), Wednesday(3), Thursday(4), Friday(5) $days = ['الأحد','الإثنين','الثلاثاء','الأربعاء','الخميس','الجمعة','السبت']; // 0=Sun, 1=Mon, ..., 6=Sat $slotDefault = config('appointments.slot_minutes', 15); // Build role-aware bulk update URL template (replace __ID__ in JS). Use url() to avoid encoding the placeholder. $bulkUrlTemplate = (auth()->user()->role === 'receptionist') ? url('/receptionist/doctor-schedules/__ID__/bulk') : url('/admin/doctor-schedules/__ID__/bulk'); @endphp