@extends("admin.layouts.app") @section("title", __("admin.products.title")) @section("content")
@foreach(["" => "All", "active" => "Active", "suspended" => "Suspended", "terminated" => "Terminated", "pending" => "Pending", "cancelled" => "Cancelled"] as $val => $label) @php $isActive = (request("status","") == $val); @endphp $val ?: null]) }}" style="display:inline-block;padding:8px 16px;font-size:13px;text-decoration:none;color:{{ $isActive ? "#1a4d80" : "#666" }};font-weight:{{ $isActive ? "700" : "400" }};border-bottom:{{ $isActive ? "3px solid #1a4d80" : "3px solid transparent" }};margin-bottom:-1px;"> {{ $label }} {{ $val === '' ? array_sum($statusCounts) : ($statusCounts[$val] ?? 0) }} @endforeach
@include('admin.partials.list-filters', ['filters' => $filters, 'action' => route('admin.services.index'), 'keep' => ['status' => request('status')]]) @php $canBulk = auth('admin')->user()?->hasPermission('manage_services'); $max = \App\Http\Controllers\Admin\ServiceController::BULK_LIMIT; @endphp @if($canBulk) @endif
@if($canBulk)@endif @forelse($services as $service) @php $badgeClass = match(strtolower($service->status ?? "")) { "active" => "badge-active", "pending" => "badge-pending", "suspended" => "badge-suspended", "terminated" => "badge-terminated", "cancelled" => "badge-cancelled", default => "badge-cancelled", }; @endphp @php $overdue = $service->next_due_date && $service->next_due_date->isPast() && strtolower((string) $service->status) === 'active'; @endphp @if($canBulk)@endif @empty @endforelse
{!! $filters->sortLink('id', __('common.table.id')) !!} {{ __('common.table.product') }} {{ __('common.table.client') }} {!! $filters->sortLink('domain', __('common.table.domain')) !!} {{ __('common.table.billing_cycle') }} {!! $filters->sortLink('amount', __('common.table.amount')) !!} {!! $filters->sortLink('next_due', __('admin.services.next_due')) !!} {{ __('common.table.status') }} {{ __('common.table.actions') }}
{{ $service->id }} {{ $service->product?->name ?? "N/A" }} @if($service->server)
{{ $service->server->name }}
@endif
@if($service->client) client_id) }}" style="color:#337ab7;text-decoration:none;">{{ $service->client->full_name }}
{{ $service->client->email }}
@else N/A @endif
{{ $service->domain ?? "-" }} {{ ucfirst($service->billing_cycle ?? "-") }} {{ money_fmt($service->amount) }} {{ $service->next_due_date?->format(date_fmt()) ?? "-" }} {{ ucfirst($service->status ?? "") }} {{ __('common.actions.view') }}
{{ __('admin.services.no_services') }}
{{ $services->withQueryString()->links() }}
@endsection