backup: before cancel reservation feature on operator dashboard

This commit is contained in:
ghassan committed 2026-04-16 16:19:33 +03:00
1 parent 51bdf50292
commit c481135280
21 files changed
+793 -91

No files matched your search

+63 -2
View File
@@ -30,6 +30,9 @@
<div>
<h2 class="fw-800 mb-1" style="font-size:1.15rem;color:#0f172a;">{{ $user->name }}</h2>
<p class="mb-1 text-sm" style="color:#64748b;">{{ $user->email }}</p>
@if($user->phone)
<p class="mb-1 text-sm" style="color:#64748b;" dir="ltr">{{ $user->phone }}</p>
@endif
@php
$roleLabel = match($user->role) {
'admin' => 'مدير النظام',
@@ -52,15 +55,20 @@
</div>
</div>
{{-- ── Edit name ───────────────────────────────────────────────────────── --}}
{{-- ── Edit profile ──────────────────────────────────────────────────── --}}
<div class="col-md-6">
<div class="card h-100">
<div class="card-header">
<span class="fw-700" style="font-size:.9rem;">
<i class="bi bi-person me-2" style="color:#6366f1;"></i>تعديل الاسم
<i class="bi bi-person me-2" style="color:#6366f1;"></i>تعديل البيانات الشخصية
</span>
</div>
<div class="card-body p-4">
@if(session('success'))
<div class="alert border-0 rounded-3 py-2 mb-3 text-sm" style="background:rgba(16,185,129,.1);color:#065f46;">
<i class="bi bi-check-circle me-1"></i>{{ session('success') }}
</div>
@endif
@if($errors->updateName->any())
<div class="alert alert-danger border-0 rounded-3 py-2 mb-3 text-sm">
{{ $errors->updateName->first() }}
@@ -76,6 +84,59 @@
value="{{ old('name', $user->name) }}"
placeholder="أدخل اسمك الكامل">
</div>
<div class="mb-3">
<label class="form-label">رقم الهاتف</label>
@php
// Split stored phone back into country code + local number
$storedPhone = $user->phone ?? '';
$knownCodes = ['+380','+351','+234','+249','+218','+216','+213','+212',
'+974','+973','+971','+970','+968','+967','+966','+965',
'+964','+963','+962','+961','+92','+91','+90','+86',
'+81','+61','+55','+49','+39','+34','+33','+20',
'+98','+44','+7','+1'];
$savedCountry = old('phone_country', '+963');
$savedLocal = old('phone_local', $storedPhone);
foreach ($knownCodes as $kc) {
if (str_starts_with($storedPhone, $kc)) {
$savedCountry = $kc;
$savedLocal = substr($storedPhone, strlen($kc));
break;
}
}
$countries = [
['🇸🇾','سوريا','+963'],['🇸🇦','السعودية','+966'],['🇦🇪','الإمارات','+971'],
['🇯🇴','الأردن','+962'],['🇱🇧','لبنان','+961'],['🇮🇶','العراق','+964'],
['🇪🇬','مصر','+20'],['🇴🇲','عُمان','+968'],['🇶🇦','قطر','+974'],
['🇰🇼','الكويت','+965'],['🇧🇭','البحرين','+973'],['🇾🇪','اليمن','+967'],
['🇵🇸','فلسطين','+970'],['🇲🇦','المغرب','+212'],['🇩🇿','الجزائر','+213'],
['🇹🇳','تونس','+216'],['🇱🇾','ليبيا','+218'],['🇸🇩','السودان','+249'],
['🇹🇷','تركيا','+90'],['🇮🇷','إيران','+98'],['🇩🇪','ألمانيا','+49'],
['🇫🇷','فرنسا','+33'],['🇬🇧','بريطانيا','+44'],['🇺🇸','أمريكا','+1'],
['🇷🇺','روسيا','+7'],['🇨🇳','الصين','+86'],['🇮🇳','الهند','+91'],
['🇦🇺','أستراليا','+61'],['🇮🇹','إيطاليا','+39'],['🇪🇸','إسبانيا','+34'],
['🇧🇷','البرازيل','+55'],['🇵🇰','باكستان','+92'],['🇳🇬','نيجيريا','+234'],
];
@endphp
<div class="input-group @if($errors->updateName->has('phone_local')) is-invalid @endif">
<input type="tel" name="phone_local"
value="{{ $savedLocal }}"
class="form-control @if($errors->updateName->has('phone_local')) is-invalid @endif"
style="border-color:#e2e8f0;"
placeholder="912345678" dir="ltr">
<select name="phone_country" dir="ltr"
style="max-width:130px;background:#f8fafc;border-color:#e2e8f0;color:#374151;font-family:'Cairo',sans-serif;font-size:.875rem;cursor:pointer;"
class="form-select">
@foreach($countries as [$flag, $label, $code])
<option value="{{ $code }}" {{ $savedCountry === $code ? 'selected' : '' }}>
{{ $flag }} {{ $code }}
</option>
@endforeach
</select>
</div>
@if($errors->updateName->has('phone_local'))
<div class="invalid-feedback d-block">{{ $errors->updateName->first('phone_local') }}</div>
@endif
</div>
<div class="mb-3">
<label class="form-label">البريد الإلكتروني</label>
<input type="email"