@extends('layouts.owner') @section('title', __('Agendamentos — Lined')) @section('page-title', __('Agendamentos')) @section('page-subtitle', __('Gerencie os agendamentos')) @section('content') @php $statusLabels = [ 0 => __('Pendente'), 1 => __('Finalizado'), 2 => __('Cancelado'), ]; $statusClasses = [ 0 => 'bg-amber-400/10 border-amber-400/25 text-amber-400', 1 => 'bg-brand-green/10 border-brand-green/25 text-brand-green', 2 => 'bg-red-500/10 border-red-500/25 text-red-400', ]; $stats = (array) ($stats ?? []); $selCustomer = $idcustomer ?? ''; $selCustomerName = ''; foreach ($customers as $c) { $c = (object)(array) $c; if ((string)($c->idcustomer ?? '') === (string) $selCustomer) { $selCustomerName = $c->name ?? ''; break; } } $selProfessional = $idprofessional ?? ''; $selProfessionalName = ''; foreach ($professionals as $p) { $p = (object)(array) $p; if ((string)($p->idprofessional ?? '') === (string) $selProfessional) { $selProfessionalName = $p->name ?? ''; break; } } @endphp
{{ __('Total de agendamentos') }}
{{ $stats['total'] ?? 0 }}
{{ __('Hoje') }}
{{ $stats['today'] ?? 0 }}
{{ __('Pendentes') }}
{{ $stats['pending'] ?? 0 }}
{{ __('Cancelados') }}
{{ $stats['cancelled'] ?? 0 }}

{{ __('Lista de agendamentos') }}

{{ __('Novo agendamento') }}
{{-- Filtros --}}
{{-- Cliente (buscável) --}}
{{-- Data --}}
{{-- Buscar --}} @if ($selCustomer !== '' || $selProfessional !== '' || $date !== '') {{ __('Limpar') }} @endif
@if (count($appointments) > 0)
@foreach ($appointments as $appointment) @php $a = (object)(array) $appointment; $st = (int) ($a->status ?? 0); $dateFmt = !empty($a->appointment_date) ? \Carbon\Carbon::parse($a->appointment_date)->format('d/m/Y') : '—'; @endphp @endforeach
{{ __('Cliente') }} {{ __('Data & Hora') }} {{ __('Valor') }} {{ __('Status') }}
{{ $a->names ?? '—' }} {{ $a->phone ?? '' }} {{ $dateFmt }} {{ $a->appointment_interval ?? '' }} R$ {{ number_format((float) ($a->total_price ?? 0), 2, ',', '.') }} {{ $statusLabels[$st] ?? $st }} @if ($st === 0)
@elseif ($st === 2)
@endif
@if ($pagination['last_page'] > 1)

{{ __('Exibindo') }} {{ $pagination['from'] }} {{ __('a') }} {{ $pagination['to'] }} {{ __('de') }} {{ $pagination['total'] }}

@if ($pagination['current_page'] > 1) ← {{ __('Anterior') }} @else ← {{ __('Anterior') }} @endif @for ($i = max(1, $pagination['current_page'] - 2); $i <= min($pagination['last_page'], $pagination['current_page'] + 2); $i++) {{ $i }} @endfor @if ($pagination['current_page'] < $pagination['last_page']) {{ __('Próximo') }} → @else {{ __('Próximo') }} → @endif
@endif @else

{{ __('Nenhum agendamento encontrado') }}

{{ __('Os agendamentos dos seus clientes aparecerão aqui.') }}

@endif
@push('scripts') @endpush @endsection