@extends('frontend::layouts.master') @section('styles') @endsection @section('content')

{{ __('frontend::lang.charge_summary.title') }}

@php $summaryItems = [ // 'charger' => [ // 'icon' => '', // 'label' => __('frontend::lang.charge_summary.model'), // 'value' => 'Tentacle 200W', // 'gradient' => 'to-r', // ], 'balance' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.remaining_balance'), 'value' => '฿' . number_format($order['member']['balance'] ?? 0, 2), 'gradient' => 'to-r', ], 'amount' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.amount_spent'), 'value' => '฿' . number_format($order['amount'] ?? 0, 2), 'gradient' => 'to-r', ], 'energy' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.energy'), 'value' => (!empty($order['energy']) ? number_format($order['energy'] / 1000, 4) : '0.0000') . ' kWh', 'gradient' => 'to-r', ], 'duration' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.duration'), 'value' => $order['period'] ?? '00:00:00', 'gradient' => 'to-r', ], ]; if ($order['type'] != 'topup') { unset($summaryItems['balance']); } @endphp @foreach ($summaryItems as $item)
{!! $item['icon'] !!} {{ $item['label'] }}
{{ $item['value'] }}
@endforeach
@php $timeItems = [ 'start' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.start_time'), 'value' => date('H:i', strtotime($order['start_at'])), 'color' => 'primary', ], 'end' => [ 'icon' => '', 'label' => __('frontend::lang.charge_summary.end_time'), 'value' => date('H:i', strtotime($order['end_at'])), 'color' => 'secondary', ], ]; @endphp @foreach ($timeItems as $item)
{!! $item['icon'] !!}

{{ $item['label'] }}

{{ $item['value'] }}

@endforeach
@if (!empty($chart['labels']))
@endif
@endsection @section('scripts') @if (!empty($chart['labels'])) {{-- Chart.js --}} @endif @endsection