@extends('layouts.app') @section('immersive', '1') @push('styles') @endpush @section('content') @php $ok = in_array($order->status, ['success','received','completed']); $can = in_array($order->status, ['cancel','cancelled']); $pen = in_array($order->status, ['pending','waiting']); $exp = $order->status === 'expired'; $sc = $ok ? 'var(--success)' : ($can ? 'var(--danger)' : ($exp ? 'var(--muted)' : 'var(--warning)')); $sl = $ok ? 'Sukses' : ($can ? 'Dibatalkan' : ($exp ? 'Kadaluarsa' : ($order->status === 'waiting' ? 'Menunggu SMS' : 'Pending'))); $si = $ok ? 'fa-circle-check' : ($can ? 'fa-circle-xmark' : ($exp ? 'fa-clock' : 'fa-hourglass-half')); $bg = $ok ? 'linear-gradient(140deg,#166534,#16a34a)' : ($can ? 'linear-gradient(140deg,#7f1d1d,#dc2626)' : ($exp ? 'linear-gradient(140deg,#1c1c1c,#3f3f46)' : 'linear-gradient(140deg,#78350f,#d97706)')); $ht = $ok ? 'OTP Berhasil Diterima' : ($can ? 'Transaksi Dibatalkan' : ($exp ? 'Transaksi Kadaluarsa' : ($order->status === 'waiting' ? 'Menunggu SMS OTP' : 'Menunggu Pembayaran'))); $hs = $ok ? 'Kode OTP sudah siap digunakan.' : ($can ? 'Transaksi ini telah dibatalkan.' : ($exp ? 'Waktu transaksi telah habis.' : 'Segera selesaikan transaksi kamu.')); $code = $order->order_code ?? ('OTP-'.$order->id); $svc = $order->service_name ?? ($order->service->name ?? '-'); $img = $order->service->operator ?? null; @endphp @include('partials.app-bar', ['back' => route('orders.index')]) Kembali {{-- Status Hero --}}
{{ $ht }}
{{ $hs }}
Total
Rp {{ number_format($order->amount ?? $order->price ?? 0, 0, ',', '.') }}
{{ $order->created_at->format('d M Y, H:i') }} WIB
{{-- OTP Code --}} @if($order->otp_code || $order->sms_code) @php $otpVal = $order->otp_code ?? $order->sms_code; @endphp
Kode OTP Diterima
{{ $otpVal }}
@endif {{-- Detail --}}
Layanan
@if($img) {{ $svc }} @endif {{ $svc }}
Nomor
{{ $order->phone_number ?? '-' }} @if($order->phone_number) @endif
@if($order->country)
Negara {{ strtoupper($order->country) }}
@endif
Status {{ $sl }}
Order ID {{ $code }}
Waktu {{ $order->created_at->format('d M Y, H:i') }}
{{-- Pending actions --}} @if($pen && !($order->otp_code || $order->sms_code))
@endif {{-- Countdown --}} @if($pen && $order->expires_at)
Batas Waktu
{{ $order->expires_at->format('d M Y, H:i') }} WIB
@endif @endsection @push('scripts') @endpush