@extends('layouts.admin-layout') @section('title', 'All Orders ') @section('content')
  • Order TO:
  • {{$order_detail->user->first_name ? : ''}}

    + {{$order_detail->user->phone_number ? : ''}}
  • ORDER No:{{$order_detail->order_number ? : ''}}
  • {{--
  • Account:0000 12345 678900
  • --}} @php use Carbon\Carbon; @endphp
  • Date:{{$formattedDate = Carbon::parse($order_detail->created_at)->format('d/m/Y')}}
@php $sub_total = 0; @endphp @foreach($order_detail->orderItems as $order) @php $sub_total += $order->price * $order->quantity; @endphp @endforeach
SL Product Name PRICE QTY TOTAL
{{$order->id ? : ''}} {{$order->product->product_name ?? ''}} $ {{$order->price ? : ''}} {{$order->quantity ? : ''}} $ {{$order->price * $order->quantity }}
  • Payment Info:
  • Account: 1234567890
    A/C Name:
    Bank Details: Add your details
  • SUB TOTAL:$ {{ number_format($sub_total ?: 0, 2) }}
  • {{--
  • TAX:$5.00
  • --}}
  • TOTAL: $ {{ number_format($sub_total ?: 0, 2) }}
@forelse($order_answers as $order_answer)
Question: {{ $order_answer->question->question ?? '' }}
{{-- Agar answer_id exists, show predefined answer --}} @if($order_answer->answer_id)

Answer: {{ $order_answer->answer->answer ?? '' }}

Type: @php // JSON decode karke string nikaal lo $type = json_decode($order_answer->selected_answer_type, true); @endphp {{ trim($type) }}
@else {{-- User input type --}} @php $type = json_decode($order_answer->selected_answer_type, true); $value = json_decode($order_answer->selected_answer_value, true); @endphp
Type: {{ is_array($type) ? ($type['selected_button'] ?? '') : $type }}
Answer:
@if(is_array($value) && isset($value['inputs']))
    @foreach($value['inputs'] as $label => $val)
  • {{ $label }}: {{ $val }}
  • @endforeach
@else

{{ is_array($value) ? print_r($value, true) : $value }}

@endif @endif
@empty

No answers found.

@endforelse
@endsection