From 8b64515689641903b3fcf6b54244764c3bbcc5c92774d7dfa602c9b0456abb3f Mon Sep 17 00:00:00 2001 From: Abhishek Mali Date: Sat, 15 Nov 2025 10:08:43 +0530 Subject: [PATCH] order popup --- .../Admin/AdminOrderController.php | 17 ++ resources/views/admin/dashboard.blade.php | 53 +++++- resources/views/admin/popup.blade.php | 179 ++++++++++++++++++ routes/web.php | 5 + 4 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 resources/views/admin/popup.blade.php diff --git a/app/Http/Controllers/Admin/AdminOrderController.php b/app/Http/Controllers/Admin/AdminOrderController.php index 051da6f..05a2446 100644 --- a/app/Http/Controllers/Admin/AdminOrderController.php +++ b/app/Http/Controllers/Admin/AdminOrderController.php @@ -191,6 +191,23 @@ class AdminOrderController extends Controller return view('admin.orders_show', compact('order', 'user')); } + public function popup($id) + { + // Load order with items + markList + $order = Order::with(['items', 'markList'])->findOrFail($id); + + // Fetch user based on markList customer_id (same as show method) + $user = null; + if ($order->markList && $order->markList->customer_id) { + $user = \App\Models\User::where('customer_id', $order->markList->customer_id)->first(); + } + + return view('admin.popup', compact('order', 'user')); + } + + + + public function resetTemp() { session()->forget(['temp_order_items', 'mark_no', 'origin', 'destination']); diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index d6f3d01..dc18e83 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -428,10 +428,13 @@ body, .container-fluid { background: #f4f7fc; } {{ $order->id }} - + {{ $order->order_id }} + {{ $order->mark_no }} {{ $order->origin }} {{ $order->destination }} @@ -725,4 +728,52 @@ document.addEventListener('DOMContentLoaded', function() { }); + + + + + + @endsection \ No newline at end of file diff --git a/resources/views/admin/popup.blade.php b/resources/views/admin/popup.blade.php new file mode 100644 index 0000000..f896a7d --- /dev/null +++ b/resources/views/admin/popup.blade.php @@ -0,0 +1,179 @@ + + +
+ + {{-- Header --}} +

Order Details

+

Detailed View of all Orders in this shipment consolidation.

+ + {{-- USER SECTION --}} +
+ +
+
+ {{ strtoupper(substr($user->customer_name ?? 'U', 0, 1)) }} +
+ +
+
{{ $user->customer_name ?? 'Unknown Customer' }}
+

{{ $user->company_name ?? 'N/A Company' }}

+

{{ $user->email ?? '' }}

+

{{ $user->mobile_no ?? '' }}

+
+
+ +
+

{{ $user->address ?? 'No Address' }}

+ {{ $user->pincode ?? '' }} +
+ +
+ + {{-- ORDER SUMMARY --}} +
+
+ +
+

Order ID

+

{{ $order->order_id }}

+
+ +
+

Total Orders

+

{{ $order->items->count() }}

+
+ +
+

Status

+ {{ ucfirst($order->status) }} +
+ +
+
+ + {{-- ITEMS TABLE --}} +
+ + + + + + + + + + + + + + + + + + + + + @foreach($order->items as $index => $item) + + + + + + + + + + + + + + + + @endforeach + +
#DescriptionCTNQTYTTL/QTYUnitPrice (₹)TTL Amount (₹)CBMTTL CBMKGTTL KGShop No
{{ $index + 1 }}{{ $item->description }}{{ $item->ctn }}{{ $item->qty }}{{ $item->ttl_qty }}{{ strtoupper($item->unit) }}₹{{ number_format($item->price, 2) }}₹{{ number_format($item->ttl_amount, 2) }}{{ $item->cbm }}{{ $item->ttl_cbm }}{{ $item->kg }}{{ $item->ttl_kg }}{{ $item->shop_no }}
+
+ + + {{-- TOTALS --}} +
+
+ +
+

{{ $order->ttl_qty }}

+

Total TTL/QTY

+
+ +
+

{{ $order->ttl_kg }}

+

Total TTL KG

+
+ +
+

₹{{ number_format($order->ttl_amount, 2) }}

+

Total Amount

+
+ +
+
+ +
diff --git a/routes/web.php b/routes/web.php index e994ed4..d134454 100644 --- a/routes/web.php +++ b/routes/web.php @@ -78,6 +78,11 @@ Route::prefix('admin')->middleware('auth:admin')->group(function () { Route::post('/orders/temp/reset', [AdminOrderController::class, 'resetTemp']) ->name('admin.orders.temp.reset'); + Route::get('/orders/view/{id}', [AdminOrderController::class, 'popup']) + ->name('admin.orders.popup'); + + + Route::get('/shipments', [ShipmentController::class, 'index']) ->name('admin.shipments');