diff --git a/app/Http/Controllers/Admin/AdminOrderController.php b/app/Http/Controllers/Admin/AdminOrderController.php index d467825..827bd9d 100644 --- a/app/Http/Controllers/Admin/AdminOrderController.php +++ b/app/Http/Controllers/Admin/AdminOrderController.php @@ -59,10 +59,20 @@ class AdminOrderController extends Controller return redirect()->back()->with('success', 'Order created successfully with ID: ' . $newOrderId); } - public function show($id) { - $order = Order::findOrFail($id); - return view('admin.orders_show', compact('order')); + $order = Order::with('markList')->findOrFail($id); + + // Get the mark list associated with this order + $markList = $order->markList; + + // Fetch the user using the customer_id from mark list + $user = null; + if ($markList && $markList->customer_id) { + $user = \App\Models\User::where('customer_id', $markList->customer_id)->first(); + } + + return view('admin.orders_show', compact('order', 'markList', 'user')); } + } diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 0359d50..4d1be8f 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -1,6 +1,6 @@ @extends('admin.layouts.app') -@section('page-title', 'Orders') +@section('page-title', 'Dashboard') @section('content')
| # | Order ID | @@ -93,7 +93,17 @@Description | Origin | Destination | -TTL Amount | +CTN | +QTY | +TTL/QTY | +Unit | +Price (₹) | +TTL Amount (₹) | +CBM | +TTL CBM | +KG | +TTL KG | +Shop No | Status | Date | Action | @@ -102,24 +112,39 @@|||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $index + 1 }} | -{{ $order->order_id }} | +{{ $order->id }} | +{{ $order->order_id }} | {{ $order->mark_no }} | {{ $order->description }} | {{ $order->origin }} | {{ $order->destination }} | +{{ $order->ctn }} | +{{ $order->qty }} | +{{ $order->ttl_qty }} | +{{ $order->unit }} | +₹{{ number_format($order->price, 2) }} | ₹{{ number_format($order->ttl_amount, 2) }} | +{{ $order->cbm }} | +{{ $order->ttl_cbm }} | +{{ $order->kg }} | +{{ $order->ttl_kg }} | +{{ $order->shop_no }} | {{ ucfirst($order->status) }} | {{ $order->created_at->format('d-m-Y') }} | -View | ++ + View + + |
| No orders found | ||||||||||||||||||||||
| No orders found | ||||||||||||||||||||||
{{ $user->company_name ?? 'N/A' }}
+{{ $user->email ?? '' }}
+{{ $user->mobile_no ?? '' }}
+{{ $user->address ?? '' }}
+ {{ $user->pincode ?? '' }} +Order ID
+Total Orders
+Status
+ {{ ucfirst($order->status) }} +| Item No | +Description | +CTN | +QTY | +TTL/QTY | +Unit | +Amount (₹) | +
|---|---|---|---|---|---|---|
| {{ $order->mark_no }} | +{{ $order->description }} | +{{ $order->ctn }} | +{{ $order->qty }} | +{{ $order->ttl_qty }} | +{{ $order->unit }} | +₹{{ number_format($order->ttl_amount, 2) }} | +