{{-- ===================================================== Etebarit - by Gisoo Web Solutions ------------------------------------------------------ Gisoo.net ------------------------------------------------------ Copyright (c) 2026 Gisoo Web Solutions ===================================================== This code is protected by copyright ===================================================== File: index.blade.php ------------------------------------------------------ Use: The user's physical-card page: the delivery form (province/city, address, postal code, phone, an optional Leaflet map pin) that files a request and charges the fee, plus the history of past requests. ===================================================== --}} @extends('layouts.user') @section('title', __('front.physical_card.title')) @php use App\Support\Format; @endphp @section('breadcrumb') @endsection @section('page') @php $canAfford = $pending === null && $cashBalance >= $fee; $expiry = Format::persianDigits(\Morilog\Jalali\Jalalian::fromDateTime($card->expires_at)->format('Y/m')); @endphp
{{-- Header + tabs --}}

{{ __('front.physical_card.title') }}

{{ __('front.physical_card.subtitle') }}

{{ __('front.physical_card.info') }} {{-- ============ NEW REQUEST ============ --}}
{{-- Left: form or pending banner --}}
@if ($pending)
{{ __('front.physical_card.pending_title') }}

{{ __('front.physical_card.pending_body', ['code' => Format::persianDigits($pending->code)]) }}

@else
{{ __('front.physical_card.delivery_title') }}
@csrf {{-- Province / city (bound to this component so submit-gating works) --}}
{{-- Full address --}}
{{-- Postal code + phone --}}

{{ __('front.physical_card.postal_invalid') }}

{{-- Map pin (Leaflet / OpenStreetMap) --}}
{{-- Fixed centre marker: the user drags the map under it. --}}
{{ __('front.physical_card.map_drag_hint') }}
{{-- Submit --}} @unless ($canAfford)

{{ __('front.physical_card.insufficient_hint') }}

@endunless
@endif
{{-- Right: card preview, fee, info --}}
{{-- Card preview --}}
{{ __('front.physical_card.card_title') }}
{{ Format::persianDigits($card->formattedNumber()) }}
{{ __('front.physical_card.card_holder') }}
{{ auth()->user()->fullName() }}
{{ $expiry }}
{{-- Fee --}}
{{ __('front.physical_card.fee_label') }} @toman($fee) {{ __('front.dashboard.toman') }}
{{ __('front.physical_card.balance_label') }} @toman($cashBalance) {{ __('front.dashboard.toman') }}

{{ __('front.physical_card.fee_from_cash') }}

{{-- Info --}}
{{ __('front.physical_card.shipping_title') }}
{{ __('front.physical_card.shipping_body') }}
{{ __('front.physical_card.secure_title') }}
{{ __('front.physical_card.secure_body') }}
{{-- ============ HISTORY ============ --}}
{{ __('front.physical_card.history_title') }}
@if ($requests->isEmpty())
{{ __('front.physical_card.history_empty') }}
@else
@foreach ($requests as $req) @endforeach
{{ __('front.physical_card.col_code') }} {{ __('front.physical_card.col_destination') }} {{ __('front.physical_card.col_fee') }} {{ __('front.physical_card.col_date') }} {{ __('front.physical_card.col_status') }}
{{ $req->code }} {{ $req->destination() }} @toman($req->fee_amount) @jalali($req->created_at) $req->status === \App\Models\PhysicalCardRequest::STATUS_PENDING, 'bg-[#e7f7ee] text-green-600' => $req->status === \App\Models\PhysicalCardRequest::STATUS_ISSUED, 'bg-secondary-50 text-secondary-500' => $req->status === \App\Models\PhysicalCardRequest::STATUS_REJECTED, ])>{{ __('front.physical_card.statuses.'.$req->status) }}
@endif
@endsection