@extends('layouts.master') @section('css') @endsection @section('title') دليل العملاء الشامل @stop @section('page-header')
| # ID | اسم العميل / المؤسسة | تاريخ الاشتراك | رقم الجوال | الرابط وبيانات الدخول | عدد الفروع | عدد المستخدمين | نوع السيرفر | المدينة / المنطقة | الرقم الضريبي | السجل التجاري | الرمز البريدي |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $customer->id }} | {{-- 2. اسم العميل --}}{{ $customer->name ?? '---' }} |
@if($customer->subscription_date)
{{-- 1. عرض تاريخ الاشتراك الأصلي --}}
{{ \Carbon\Carbon::parse($customer->subscription_date)->format('Y-m-d') }}
{{-- 2. حساب المده المنقضية من تاريخ الاشتراك حتي اليوم --}}
@php
$startDate = \Carbon\Carbon::parse($customer->subscription_date);
$now = \Carbon\Carbon::now();
// حساب الفارق الإجمالي بالأشهر
$totalMonths = $startDate->diffInMonths($now);
$years = round($totalMonths / 12);
// معالجة الفروق البسيطة للأشهر
if ($years == 0 && $totalMonths >= 6) {
$years = 1;
}
// صياغة النص العربي بشكل احترافي
$yearsText = match(true) {
$years <= 0 => 'أقل من سنة',
$years == 1 => 'منذ سنة',
$years == 2 => 'منذ سنتين',
$years >= 3 && $years <= 10 => 'منذ ' . $years . ' سنوات',
default => 'منذ ' . $years . ' سنة'
};
@endphp
{{-- عرض النص بخط صغير وخفيف أسفل البدج --}}
{{ $yearsText }}
@else
---
@endif
|
{{-- 3. رقم الجوال --}}
{{ $customer->phone ?? '---' }} | {{-- 4. الرابط وبيانات الدخول --}}
@if($customer->website_link)
زيارة الموقع
@else
---
@endif
@if($customer->admin_credentials)
{{ $customer->admin_credentials }}
@else
(لا توجد بيانات دخول)
@endif
|
{{-- 5. عدد الفروع --}}
{{ $customer->branches_count ?? 0 }} فرع | {{-- 6. عدد المستخدمين --}}{{ $customer->users_count ?? '1' }} مستخدم | {{-- 7. نوع السيرفر --}}@if($customer->server_type == 'new') جديد @elseif($customer->server_type == 'old') قديم {{-- 🌟 الخيار الثالث الجديد: سيرفر محلي --}} @elseif($customer->server_type == 'local') محلي @else -- @endif | {{-- 8. المدينة والمنطقة --}}@if($customer->address || $customer->sub_city) {{ $customer->address }} {{ $customer->sub_city ? '- ' . $customer->sub_city : '' }} @else --- @endif | {{-- 9. الرقم الضريبي --}}{{ $customer->tax_number ?? $customer->tax_no ?? '---' }} | {{-- 10. السجل التجاري --}}{{ $customer->commercial_registry ?? $customer->CRN ?? '---' }} | {{-- 11. الرمز البريدي --}}{{ $customer->postcode ?? '---' }} |
| لا يوجد أي عملاء مسجلين في النظام حالياً. | |||||||||||