This commit is contained in:
Utkarsh Khedkar
2025-11-13 10:12:31 +05:30
5 changed files with 197 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
@extends('admin.layouts.app')
@section('page-title', 'Orders')
@section('page-title', 'Dashboard')
@section('content')
<style>
@@ -168,8 +168,8 @@ body, .container-fluid { background: #f4f7fc; }
<div class="order-mgmt-main">
<!-- Create Order Form -->
<div id="createOrderForm" class="collapse mb-3">
<div class="card shadow-sm mb-4" style="margin-bottom:0!important;">
<div class="card-header bg-light" style="border-radius:10px 10px 0 0;"><strong>New Order Form</strong></div>
<div class="card">
<div class="card-header bg-light"><strong>New Order Form</strong></div>
<div class="card-body">
<form action="{{ route('admin.orders.store') }}" method="POST">
@csrf
@@ -208,48 +208,74 @@ body, .container-fluid { background: #f4f7fc; }
</div>
</div>
</div>
<!-- Orders Table -->
<div class="card shadow-sm mb-2" style="box-shadow:none!important;border:none!important;">
<div class="card-header bg-light"><strong>Recent Orders</strong></div>
<div class="card-body table-responsive" style="padding-bottom:0;">
<table class="table table-striped align-middle">
<thead>
<tr>
<th>#</th>
<th>Order ID</th>
<th>Mark No</th>
<th>Description</th>
<th>Origin</th>
<th>Destination</th>
<th>TTL Amount</th>
<th>Status</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse($orders as $index => $order)
<tr>
<td>{{ $index + 1 }}</td>
<td><a href="{{ route('admin.orders.show', $order->id) }}">{{ $order->order_id }}</a></td>
<td>{{ $order->mark_no }}</td>
<td>{{ $order->description }}</td>
<td>{{ $order->origin }}</td>
<td>{{ $order->destination }}</td>
<td>{{ number_format($order->ttl_amount, 2) }}</td>
<td><span class="badge bg-info text-dark">{{ ucfirst($order->status) }}</span></td>
<td>{{ $order->created_at->format('d-m-Y') }}</td>
<td><a href="{{ route('admin.orders.show', $order->id) }}" class="btn btn-sm btn-outline-primary">View</a></td>
</tr>
@empty
<tr><td colspan="10" class="text-center">No orders found</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
{{-- Recent Orders Table --}}
<div class="card shadow-sm">
<div class="card-header bg-light">
<strong>Recent Orders</strong>
</div>
<div class="card-body table-responsive">
<table class="table table-striped table-bordered align-middle text-center">
<thead class="table-light">
<tr>
<th>#</th>
<th>Order ID</th>
<th>Mark No</th>
<th>Description</th>
<th>Origin</th>
<th>Destination</th>
<th>CTN</th>
<th>QTY</th>
<th>TTL/QTY</th>
<th>Unit</th>
<th>Price ()</th>
<th>TTL Amount ()</th>
<th>CBM</th>
<th>TTL CBM</th>
<th>KG</th>
<th>TTL KG</th>
<th>Shop No</th>
<th>Status</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse($orders as $index => $order)
<tr>
<td>{{ $order->id }}</td>
<td><a href="{{ route('admin.orders.show', $order->id) }}" class="fw-semibold text-primary">{{ $order->order_id }}</a></td>
<td>{{ $order->mark_no }}</td>
<td>{{ $order->description }}</td>
<td>{{ $order->origin }}</td>
<td>{{ $order->destination }}</td>
<td>{{ $order->ctn }}</td>
<td>{{ $order->qty }}</td>
<td>{{ $order->ttl_qty }}</td>
<td>{{ $order->unit }}</td>
<td>{{ number_format($order->price, 2) }}</td>
<td>{{ number_format($order->ttl_amount, 2) }}</td>
<td>{{ $order->cbm }}</td>
<td>{{ $order->ttl_cbm }}</td>
<td>{{ $order->kg }}</td>
<td>{{ $order->ttl_kg }}</td>
<td>{{ $order->shop_no }}</td>
<td><span class="badge bg-info text-dark">{{ ucfirst($order->status) }}</span></td>
<td>{{ $order->created_at->format('d-m-Y') }}</td>
<td>
<a href="{{ route('admin.orders.show', $order->id) }}" class="btn btn-sm btn-outline-primary">
<i class="bi bi-eye"></i> View
</a>
</td>
</tr>
@empty
<tr><td colspan="20" class="text-center text-muted">No orders found</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
<script>
document.getElementById('markNoSelect').addEventListener('change', function() {