conflict resolve

This commit is contained in:
divya abdar
2025-12-03 16:13:37 +05:30
23 changed files with 1634 additions and 629 deletions

View File

@@ -1723,4 +1723,16 @@ document.addEventListener('DOMContentLoaded', function() {
});
</script>
<script>
document.addEventListener("hidden.bs.modal", function () {
// Remove Bootstrap backdrops
document.querySelectorAll(".modal-backdrop").forEach(el => el.remove());
// Fix page scroll locking
document.body.classList.remove("modal-open");
document.body.style.overflow = "";
});
</script>
@endsection

View File

@@ -212,6 +212,13 @@
<i class="bi bi-bag"></i> Orders
</a>
<a href="{{ route('admin.requests') }}" class="{{ request()->routeIs('admin.requests') ? 'active' : '' }}"><i class="bi bi-envelope"></i> Requests</a>
<li>
<a href="{{ route('admin.profile.requests') }}">
<i class="bi bi-person-lines-fill"></i>
Profile Update Requests
</a>
</li>
<a href="{{ route('admin.staff') }}" class="{{ request()->routeIs('admin.staff') ? 'active' : '' }}"><i class="bi bi-person-badge"></i> Staff</a>
<a href="{{ route('admin.account') }}" class="{{ request()->routeIs('admin.account') ? 'active' : '' }}"><i class="bi bi-gear"></i> Account</a>
<a href="{{ route('admin.marklist.index') }}" class="{{ request()->routeIs('admin.marklist.index') ? 'active' : '' }}"><i class="bi bi-list-check"></i> Mark List</a>

View File

@@ -0,0 +1,70 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Orders Report</title>
<style>
body { font-family: DejaVu Sans, sans-serif; font-size:12px; }
table { width:100%; border-collapse: collapse; }
th, td { border: 1px solid #ddd; padding: 6px; text-align: left; }
th { background: #f2f2f2; }
</style>
</head>
<body>
<h3>Orders Report</h3>
@if(!empty($filters))
<p>
@if($filters['search']) Search: <strong>{{ $filters['search'] }}</strong> @endif
@if($filters['status']) &nbsp; | Status: <strong>{{ ucfirst($filters['status']) }}</strong> @endif
@if($filters['shipment']) &nbsp; | Shipment: <strong>{{ ucfirst($filters['shipment']) }}</strong> @endif
</p>
@endif
<table>
<thead>
<tr>
<th>Order ID</th>
<th>Shipment ID</th>
<th>Customer ID</th>
<th>Company</th>
<th>Origin</th>
<th>Destination</th>
<th>Order Date</th>
<th>Invoice No</th>
<th>Invoice Date</th>
<th>Amount</th>
<th>Amount + GST</th>
<th>Invoice Status</th>
<th>Shipment Status</th>
</tr>
</thead>
<tbody>
@forelse($orders as $order)
@php
$mark = $order->markList ?? null;
$invoice = $order->invoice ?? null;
$shipment = $order->shipments->first() ?? null;
@endphp
<tr>
<td>{{ $order->order_id }}</td>
<td>{{ $shipment->shipment_id ?? '-' }}</td>
<td>{{ $mark->customer_id ?? '-' }}</td>
<td>{{ $mark->company_name ?? '-' }}</td>
<td>{{ $mark->origin ?? $order->origin ?? '-' }}</td>
<td>{{ $mark->destination ?? $order->destination ?? '-' }}</td>
<td>{{ $order->created_at ? $order->created_at->format('d-m-Y') : '-' }}</td>
<td>{{ $invoice->invoice_number ?? '-' }}</td>
<td>{{ $invoice?->invoice_date ? \Carbon\Carbon::parse($invoice->invoice_date)->format('d-m-Y') : '-' }}</td>
<td>{{ $invoice?->final_amount ? number_format($invoice->final_amount, 2) : '-' }}</td>
<td>{{ $invoice?->final_amount_with_gst ? number_format($invoice->final_amount_with_gst, 2) : '-' }}</td>
<td>{{ $invoice->status ? ucfirst($invoice->status) : 'Pending' }}</td>
<td>{{ $shipment?->status ? ucfirst(str_replace('_',' ',$shipment->status)) : 'Pending' }}</td>
</tr>
@empty
<tr><td colspan="13" style="text-align:center">No orders found</td></tr>
@endforelse
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,111 @@
@extends('admin.layouts.app')
@section('page-title', 'Profile Update Requests')
@section('content')
<div class="container-fluid px-0">
@php
$perPage = 5;
$currentPage = request()->get('page', 1);
$currentPage = max(1, (int)$currentPage);
$total = $requests->count();
$totalPages = ceil($total / $perPage);
$currentItems = $requests->slice(($currentPage - 1) * $perPage, $perPage);
@endphp
<style>
.old-value { color: #6b7280; font-weight: 600; }
.new-value { color: #111827; font-weight: 700; }
.changed { background: #fef3c7; padding: 6px; border-radius: 6px; }
.box { padding: 10px 14px; border-radius: 8px; background: #f8fafc; margin-bottom: 10px; }
.diff-label { font-size: 13px; font-weight: 700; }
.actions { display: flex; gap: 10px; }
</style>
<h4 class="fw-bold my-3">Profile Update Requests ({{ $total }})</h4>
<div class="card mb-4 shadow-sm">
<div class="card-body pb-1">
<div class="table-responsive custom-table-wrapper">
<table class="table align-middle mb-0 custom-table">
<thead>
<tr>
<th>#</th>
<th>User</th>
<th>Requested Changes</th>
<th>Status</th>
<th>Requested At</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach($currentItems as $index => $req)
@php
$user = $req->user;
// FIX: Convert string to array
$newData = is_array($req->data) ? $req->data : json_decode($req->data, true);
@endphp
<tr>
<td><strong>{{ ($currentPage - 1) * $perPage + $index + 1 }}</strong></td>
<td>
<strong>{{ $user->customer_name }}</strong><br>
<small>{{ $user->email }}</small><br>
<small>ID: {{ $user->customer_id }}</small>
</td>
<td>
@foreach($newData as $key => $newValue)
@php
$oldValue = $user->$key ?? '—';
$changed = $oldValue != $newValue;
@endphp
<div class="box {{ $changed ? 'changed' : '' }}">
<span class="diff-label">{{ ucfirst(str_replace('_',' ', $key)) }}:</span><br>
<span class="old-value">Old: {{ $oldValue }}</span><br>
<span class="new-value">New: {{ $newValue ?? '—' }}</span>
</div>
@endforeach
</td>
<td>
@if($req->status == 'pending')
<span class="badge badge-pending">Pending</span>
@elseif($req->status == 'approved')
<span class="badge badge-approved">Approved</span>
@else
<span class="badge badge-rejected">Rejected</span>
@endif
</td>
<td>{{ $req->created_at->format('d M Y, h:i A') }}</td>
<td class="actions">
@if($req->status == 'pending')
<a href="{{ route('admin.profile.approve', $req->id) }}" class="btn btn-success btn-sm">
<i class="bi bi-check-circle"></i> Approve
</a>
<a href="{{ route('admin.profile.reject', $req->id) }}" class="btn btn-danger btn-sm">
<i class="bi bi-x-circle"></i> Reject
</a>
@else
<span class="text-muted">Completed</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -7,18 +7,15 @@
/*Remove horizontal scroll bar*/
html, body {
overflow-x: hidden !important;
font-family: 'Inter', sans-serif;
}
.table thead th,
.table tbody td {
white-space: nowrap !important;
padding: 14px 8px !important;
font-size: 14px;
font-family: 'Inter', sans-serif;
padding: 8px 4px !important;
}
.table th:nth-child(10),
.table th:nth-child(10), /* if Date is column 10 */
.table td:nth-child(10) {
max-width: 110px !important;
width: 110px !important;
@@ -28,7 +25,6 @@
.table {
table-layout: fixed !important;
font-family: 'Inter', sans-serif;
}
@@ -36,7 +32,6 @@
min-width: unset !important;
width: 100% !important;
table-layout: auto !important;
font-family: 'Inter', sans-serif;
}
.table thead th,
@@ -47,8 +42,6 @@
.shipment-details-table td {
white-space: normal !important;
word-break: break-word;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.table-responsive, .modal .table-responsive {
@@ -76,27 +69,25 @@
align-items: center;
gap: 15px;
padding: 20px;
background: white;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 16px;
box-shadow: var(--card-shadow);
flex-wrap: wrap;
margin-bottom: 30px;
color: #333;
color: white;
position: relative;
overflow: hidden;
font-family: 'Inter', sans-serif;
border: 1px solid #e2e8f0;
}
.search-input-container {
display: flex;
flex: 1;
min-width: 300px;
background: white;
border-radius: 10px;
overflow: hidden;
border: 1px solid #d1d5db;
transition: all 0.3s ease;
.search-shipment-bar::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255,255,255,0.1);
z-index: 0;
}
.search-input-container:focus-within {
@@ -164,31 +155,31 @@
color: white;
}
.search-shipment-bar input,
.search-shipment-bar select {
padding: 20px 16px;
border: 1px solid #d1d5db;
padding: 12px 16px;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 10px;
flex: 1;
min-width: 150px;
background: white;
background: rgba(255,255,255,0.9);
font-weight: 500;
transition: all 0.3s ease;
font-family: 'Inter', sans-serif;
font-size: 14px;
color: #333;
}
.search-shipment-bar input:focus,
.search-shipment-bar select:focus {
background: white;
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
outline: none;
border-color: #4361ee;
}
.btn-add-shipment {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
background: rgba(255,255,255,0.2);
backdrop-filter: blur(10px);
color: white;
border: none;
padding: 17px 24px;
border: 1px solid rgba(255,255,255,0.3);
padding: 12px 24px;
border-radius: 10px;
cursor: pointer;
display: flex;
@@ -197,13 +188,17 @@
transition: all 0.3s ease;
white-space: nowrap;
font-weight: 600;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.btn-add-shipment:hover {
background: rgba(255,255,255,0.3);
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.search-icon {
font-size: 20px;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.truck-icon {
@@ -215,7 +210,7 @@
flex-direction: column;
align-items: stretch;
}
.search-input-container,
.search-shipment-bar input,
.search-shipment-bar select {
width: 100%;
}
@@ -248,7 +243,6 @@
box-shadow: var(--card-shadow);
transition: all 0.3s ease;
overflow: hidden;
font-family: 'Inter', sans-serif;
}
.card:hover {
@@ -262,7 +256,6 @@
border: none;
padding: 20px 25px;
border-radius: 16px 16px 0 0 !important;
font-family: 'Inter', sans-serif;
}
.card-header h5 {
@@ -271,8 +264,6 @@
display: flex;
align-items: center;
gap: 10px;
font-family: 'Inter', sans-serif;
font-size: 18px;
}
/* Table Styles */
@@ -288,7 +279,6 @@
width: 100%;
min-width: 1200px;
padding: 0;
font-family: 'Inter', sans-serif;
}
.table thead th {
@@ -302,8 +292,6 @@
border-bottom: 2px solid var(--border);
position: relative;
white-space: nowrap;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.table thead th:first-child {
@@ -332,8 +320,6 @@
border-bottom: 1px solid var(--border);
font-weight: 500;
white-space: nowrap;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.table tbody tr:last-child td {
@@ -349,13 +335,8 @@
border: 2px solid transparent !important;
min-width: 40px !important;
text-align: center !important;
display: inline-flex !important;
align-items: center;
justify-content: center;
display: inline-block !important;
line-height: 1.2 !important;
font-family: 'Inter', sans-serif;
gap: 6px;
width: 110px;
}
/* Status icons */
@@ -371,6 +352,7 @@
background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
color: #d97706 !important;
border-color: #f59e0b !important;
width: 110px;
}
/* In Transit Status - SAME SIZE WITH TRUCK ICON */
@@ -378,6 +360,7 @@
background: linear-gradient(135deg, #dbeafe, #93c5fd) !important;
color: #1e40af !important;
border-color: #3b82f6 !important;
width: 110px;
}
/* Dispatched Status - SAME SIZE WITH BOX ICON */
@@ -385,6 +368,7 @@
background: linear-gradient(135deg, #e9d5ff, #c4b5fd) !important;
color: #6b21a8 !important;
border-color: #8b5cf6 !important;
width: 110px;
}
/* Delivered Status - SAME SIZE WITH CHECK ICON */
@@ -392,6 +376,7 @@
background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
color: #065f46 !important;
border-color: #10b981 !important;
width: 110px;
}
/* Default badge styles - SAME SIZE */
@@ -422,9 +407,6 @@
border: 1px solid #dee2e6 !important;
min-width: 80px !important;
padding: 6px 12px !important;
font-family: 'Inter', sans-serif;
font-size: 13px;
width: auto;
}
/* NEW: Action Button Styles */
@@ -446,7 +428,6 @@
justify-content: center;
width: 36px;
height: 36px;
font-family: 'Inter', sans-serif;
}
.btn-edit-status:hover {
@@ -470,7 +451,6 @@
margin-top: -50px;
border: 1px solid var(--border);
z-index: 1050;
font-family: 'Inter', sans-serif;
}
.status-dropdown.show {
@@ -491,7 +471,6 @@
gap: 8px;
background: transparent;
width: 100%;
font-family: 'Inter', sans-serif;
}
.status-option:hover {
@@ -623,7 +602,6 @@
border: none;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
overflow: hidden;
font-family: 'Inter', sans-serif;
}
.modal-header {
@@ -633,7 +611,6 @@
padding: 25px 30px 15px;
border-radius: 20px 20px 0 0;
position: relative;
font-family: 'Inter', sans-serif;
}
.modal-header::after {
@@ -649,7 +626,6 @@
.modal-title {
font-weight: 700;
font-size: 1.5rem;
font-family: 'Inter', sans-serif;
}
.btn-close {
@@ -663,7 +639,6 @@
.modal-body {
padding: 25px 30px;
font-family: 'Inter', sans-serif;
}
/* Form Styles */
@@ -672,18 +647,16 @@
color: #5a6c7d;
margin-bottom: 8px;
font-size: 0.9rem;
font-family: 'Inter', sans-serif;
}
.form-control {
border-radius: 10px;
border: 1px solid #e2e8f0;
padding: 12px 16px;
font-size: 14px;
font-size: 15px;
transition: all 0.3s ease;
background: #fafbfc;
color: #4a5568;
font-family: 'Inter', sans-serif;
}
.form-control:focus {
@@ -738,8 +711,6 @@
font-weight: 600;
padding: 12px 30px;
transition: all 0.3s ease;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.btn-cancel:hover {
@@ -753,12 +724,11 @@
background: linear-gradient(135deg, #48bb78, #38a169);
color: white;
font-weight: 600;
font-size: 14px;
font-size: 16px;
border-radius: 10px;
padding: 12px 35px;
border: none;
transition: all 0.3s ease;
font-family: 'Inter', sans-serif;
}
.btn-create:hover {
@@ -774,7 +744,6 @@
border-spacing: 0 8px;
margin: 0;
min-width: 1300px;
font-family: 'Inter', sans-serif;
}
.custom-table-modal thead th {
@@ -785,10 +754,9 @@
border: 1px solid #e2e8f0;
text-align: center;
position: relative;
font-size: 14px;
font-size: 0.9rem;
letter-spacing: 0.3px;
white-space: nowrap;
font-family: 'Inter', sans-serif;
}
.custom-table-modal thead th:first-child {
@@ -825,8 +793,6 @@
position: relative;
color: #4a5568;
white-space: nowrap;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.custom-table-modal tbody tr td:first-child {
@@ -881,12 +847,10 @@
border: none;
padding: 25px 30px 15px;
border-radius: 20px 20px 0 0;
font-family: 'Inter', sans-serif;
}
.shipment-details-body {
padding: 40px 45px;
font-family: 'Inter', sans-serif;
}
.shipment-info-row {
@@ -897,7 +861,6 @@
background: #f8fafc;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
font-family: 'Inter', sans-serif;
}
.shipment-info-item {
@@ -911,14 +874,12 @@
color: #64748b;
font-size: 14px;
margin-bottom: 5px;
font-family: 'Inter', sans-serif;
}
.shipment-info-value {
font-weight: 700;
font-size: 18px;
color: var(--dark);
font-family: 'Inter', sans-serif;
}
.shipment-details-table {
@@ -927,7 +888,6 @@
border-spacing: 0 8px;
margin-top: 20px;
min-width: 1400px;
font-family: 'Inter', sans-serif;
}
.shipment-details-table th {
@@ -939,8 +899,6 @@
border: none;
position: relative;
white-space: nowrap;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.shipment-details-table th:first-child {
@@ -960,8 +918,6 @@
background: white;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
white-space: nowrap;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
.shipment-details-table tr td:first-child {
@@ -982,7 +938,6 @@
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
border-left: 4px solid #4361ee;
font-family: 'Inter', sans-serif;
}
.shipment-totals-row {
@@ -1009,7 +964,6 @@
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
font-family: 'Inter', sans-serif;
}
.shipment-total-value {
@@ -1017,7 +971,6 @@
font-size: 20px;
color: #1e293b;
line-height: 1.2;
font-family: 'Inter', sans-serif;
}
.total-amount {
@@ -1090,7 +1043,6 @@
/* Status Filter Styles */
.status-filter-container {
position: relative;
margin-left:350px;
}
.status-filter-select {
@@ -1126,14 +1078,12 @@
margin-top: 15px;
padding: 12px 25px;
border-top: 1px solid #eef3fb;
font-family: 'Inter', sans-serif;
}
.pagination-info {
font-size: 13px;
color: #9ba5bb;
font-weight: 600;
font-family: 'Inter', sans-serif;
}
.pagination-controls {
@@ -1157,7 +1107,6 @@
justify-content: center;
min-width: 40px;
height: 32px;
font-family: 'Inter', sans-serif;
}
.pagination-btn:hover:not(:disabled) {
@@ -1186,7 +1135,6 @@
transition: all 0.3s ease;
min-width: 36px;
text-align: center;
font-family: 'Inter', sans-serif;
}
.pagination-page-btn:hover {
@@ -1211,7 +1159,6 @@
color: #9ba5bb;
font-size: 13px;
padding: 0 4px;
font-family: 'Inter', sans-serif;
}
/* Image-based pagination buttons */
@@ -1540,7 +1487,7 @@
</tr>
@empty
<tr>
<td colspan="12" class="text-center py-5 text-muted">
<td colspan="11" class="text-center py-5 text-muted">
<i class="bi bi-inbox display-4 d-block mb-3"></i>
No shipments found
</td>
@@ -1754,7 +1701,7 @@ function renderTable() {
if (filteredShipments.length === 0) {
tbody.innerHTML = `
<tr>
<td colspan="12" class="text-center py-5 text-muted">
<td colspan="11" class="text-center py-5 text-muted">
<i class="bi bi-search display-4 d-block mb-3"></i>
No shipments found matching your criteria
</td>
@@ -1789,9 +1736,9 @@ function renderTable() {
</td>
<td>${shipment.origin}</td>
<td>${shipment.destination}</td>
<td>${shipment.total_qty}</td>
<td>${shipment.total_kg} kg</td>
<td>${shipment.total_cbm} CBM</td>
<td><span class="badge bg-light text-dark">${shipment.total_qty}</span></td>
<td><span class="badge bg-light text-dark">${shipment.total_kg} kg</span></td>
<td><span class="badge bg-light text-dark">${shipment.total_cbm} CBM</span></td>
<td class="fw-bold text-success">${parseFloat(shipment.total_amount).toLocaleString('en-IN', {minimumFractionDigits: 2, maximumFractionDigits: 2})}</td>
<td>
<span class="badge badge-${shipment.status}">