@extends('frontend.layouts.app') @section('title') @endsection @section('seo') Book Now | Anisabel Suites @endsection @section('content')

Transaction History

Welcome {{ Auth::user()->email }}!

@if (!empty($transact)) {{--
@csrf --}}

Checkout

Particulars:
@php $totalAmount = 0; $x = 0; $quantities = json_decode($transact->quantities); $prices = json_decode($transact->prices); @endphp @foreach (json_decode($transact->particulars) as $particular) @php $totalAmount += (int)$prices[$x] * $quantities[$x]; @endphp
{{ $particular }} x {{ $quantities[$x] }}
{{ $transact->description }}
{{ $prices[$x] * $quantities[$x] }}
@php $x++; @endphp @endforeach
Total Amount: {{ number_format($totalAmount, 2) }}
{{--
--}} @else No Active Transaction
@endif

Transaction History

@if (!empty($history)) @foreach ($history as $items) @php $quantities = json_decode($items->quantities); $prices = json_decode($items->prices); $total_history = 0; $is = 0; @endphp @endforeach @else @endif
ID Transaction No. Particular Total Amount
{{ $items->id }} {{ $items->transaction_no }} @foreach (json_decode($items->particulars) as $particular) {{ $particular }} x {{ $quantities[$is]}}
@php $total_history += $quantities[$is] * $prices[$is]; $is++; @endphp @endforeach
{{number_format($total_history, 2)}}
No Transaction History
@endsection @section('js') @if (!empty($history)) @endif @endsection