2038 lines
66 KiB
PHP
2038 lines
66 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('page-title', 'Shipment Management')
|
|
|
|
@section('content')
|
|
<style>
|
|
/*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;
|
|
}
|
|
|
|
.table th:nth-child(10),
|
|
.table td:nth-child(10) {
|
|
max-width: 110px !important;
|
|
width: 110px !important;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.table {
|
|
table-layout: fixed !important;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
|
|
.table, .custom-table-modal, .shipment-details-table {
|
|
min-width: unset !important;
|
|
width: 100% !important;
|
|
table-layout: auto !important;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.table thead th,
|
|
.table tbody td,
|
|
.custom-table-modal th,
|
|
.custom-table-modal td,
|
|
.shipment-details-table th,
|
|
.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 {
|
|
overflow-x: auto !important;
|
|
}
|
|
|
|
:root {
|
|
--primary: #4361ee;
|
|
--primary-dark: #3a56d4;
|
|
--secondary: #f72585;
|
|
--success: #4cc9f0;
|
|
--warning: #f8961e;
|
|
--danger: #e63946;
|
|
--light: #f8f9fa;
|
|
--dark: #212529;
|
|
--gray: #6c757d;
|
|
--border: #e2e8f0;
|
|
--card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
--hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
/* UPDATED: Search Bar Styles - White Background */
|
|
.search-shipment-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 15px;
|
|
padding: 20px;
|
|
background: white;
|
|
border-radius: 16px;
|
|
box-shadow: var(--card-shadow);
|
|
flex-wrap: wrap;
|
|
margin-bottom: 30px;
|
|
color: #333;
|
|
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-input-container:focus-within {
|
|
border-color: #4361ee;
|
|
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
|
|
}
|
|
|
|
.search-shipment-bar input {
|
|
padding: 12px 16px;
|
|
border: none;
|
|
flex: 1;
|
|
background: transparent;
|
|
font-weight: 500;
|
|
transition: all 0.3s ease;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
outline: none;
|
|
color: #333;
|
|
}
|
|
|
|
.search-shipment-bar input::placeholder {
|
|
color: #6b7280;
|
|
}
|
|
|
|
/* UPDATED: Search Button - White with Blue Icon by default, Gradient on hover */
|
|
.search-button {
|
|
background: white;
|
|
color: #4361ee;
|
|
border: none;
|
|
padding: 12px 20px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
font-weight: 600;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
border-radius: 0 10px 10px 0;
|
|
min-width: 100px;
|
|
justify-content: center;
|
|
border-left: 1px solid #d1d5db;
|
|
}
|
|
|
|
.search-input-group {
|
|
border: 1px solid #d1d5db !important;
|
|
border-radius: 8px !important;
|
|
padding: 4px !important;
|
|
background: #ffffff !important;
|
|
}
|
|
.search-button:hover {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
.search-icon {
|
|
font-size: 16px;
|
|
color: #4361ee;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.search-button:hover .search-icon {
|
|
color: white;
|
|
}
|
|
|
|
.search-shipment-bar select {
|
|
padding: 20px 16px;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 10px;
|
|
min-width: 150px;
|
|
background: white;
|
|
font-weight: 500;
|
|
transition: all 0.3s ease;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
color: #333;
|
|
}
|
|
|
|
.search-shipment-bar select:focus {
|
|
background: white;
|
|
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
|
|
outline: none;
|
|
border-color: #4361ee;
|
|
}
|
|
|
|
.btn-add-shipment {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
padding: 17px 24px;
|
|
border-radius: 10px;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: all 0.3s ease;
|
|
white-space: nowrap;
|
|
font-weight: 600;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.btn-add-shipment:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
|
|
}
|
|
|
|
.truck-icon {
|
|
font-size: 18px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.search-shipment-bar {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
}
|
|
.search-input-container,
|
|
.search-shipment-bar select {
|
|
width: 100%;
|
|
}
|
|
}
|
|
/* VIEW BUTTON STYLING */
|
|
.btn-view {
|
|
background: linear-gradient(135deg, #4cc9f0, #4361ee) !important;
|
|
border: none !important;
|
|
border-radius: 10px !important;
|
|
padding: 8px 14px !important;
|
|
color: white !important;
|
|
box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35) !important;
|
|
transition: all 0.3s ease !important;
|
|
}
|
|
|
|
.btn-view:hover {
|
|
transform: translateY(-2px) scale(1.05) !important;
|
|
background: linear-gradient(135deg, #3a56d4, #4cc9f0) !important;
|
|
box-shadow: 0 8px 20px rgba(67, 97, 238, 0.5) !important;
|
|
}
|
|
|
|
.btn-view i {
|
|
font-size: 16px !important;
|
|
}
|
|
|
|
/* Card Styles */
|
|
.card {
|
|
border: none;
|
|
border-radius: 16px;
|
|
box-shadow: var(--card-shadow);
|
|
transition: all 0.3s ease;
|
|
overflow: hidden;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: var(--hover-shadow);
|
|
}
|
|
|
|
.card-header {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
padding: 20px 25px;
|
|
border-radius: 16px 16px 0 0 !important;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.card-header h5 {
|
|
margin: 0;
|
|
font-weight: 700;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 18px;
|
|
}
|
|
|
|
/* Table Styles */
|
|
.table-responsive {
|
|
border-radius: 0 0 16px 16px;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.table {
|
|
margin: 0;
|
|
border-collapse: separate;
|
|
border-spacing: 0;
|
|
width: 100%;
|
|
min-width: 1200px;
|
|
padding: 0;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.table thead th {
|
|
background: #f8f9fa;
|
|
border: none;
|
|
padding: 16px 12px;
|
|
font-weight: 700;
|
|
color: var(--dark);
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
border-bottom: 2px solid var(--border);
|
|
position: relative;
|
|
white-space: nowrap;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.table thead th:first-child {
|
|
border-radius: 0;
|
|
}
|
|
|
|
.table thead th:last-child {
|
|
border-radius: 0;
|
|
}
|
|
|
|
.table tbody tr {
|
|
transition: all 0.3s ease;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.table tbody tr:hover {
|
|
background-color: #f8f9ff;
|
|
transform: scale(1.01);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.table tbody td {
|
|
padding: 14px 12px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
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 {
|
|
border-bottom: none;
|
|
}
|
|
|
|
/* UPDATED: Status Badge Styles - ALL SAME SIZE WITH ICONS */
|
|
.badge {
|
|
padding: 7px 17px !important;
|
|
border-radius: 20px !important;
|
|
font-weight: 600 !important;
|
|
font-size: 13px !important;
|
|
border: 2px solid transparent !important;
|
|
min-width: 40px !important;
|
|
text-align: center !important;
|
|
display: inline-flex !important;
|
|
align-items: center;
|
|
justify-content: center;
|
|
line-height: 1.2 !important;
|
|
font-family: 'Inter', sans-serif;
|
|
gap: 6px;
|
|
width: 110px;
|
|
}
|
|
|
|
/* Status icons */
|
|
.status-icon {
|
|
font-size: 13px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Pending Status - SAME SIZE WITH CLOCK ICON */
|
|
.badge-pending {
|
|
background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
|
|
color: #d97706 !important;
|
|
border-color: #f59e0b !important;
|
|
}
|
|
|
|
/* In Transit Status - SAME SIZE WITH TRUCK ICON */
|
|
.badge-in_transit {
|
|
background: linear-gradient(135deg, #dbeafe, #93c5fd) !important;
|
|
color: #1e40af !important;
|
|
border-color: #3b82f6 !important;
|
|
}
|
|
|
|
/* Dispatched Status - SAME SIZE WITH BOX ICON */
|
|
.badge-dispatched {
|
|
background: linear-gradient(135deg, #e9d5ff, #c4b5fd) !important;
|
|
color: #6b21a8 !important;
|
|
border-color: #8b5cf6 !important;
|
|
}
|
|
|
|
/* Delivered Status - SAME SIZE WITH CHECK ICON */
|
|
.badge-delivered {
|
|
background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
|
|
color: #065f46 !important;
|
|
border-color: #10b981 !important;
|
|
}
|
|
|
|
/* Default badge styles - SAME SIZE */
|
|
.badge.bg-info {
|
|
background: linear-gradient(135deg, #4cc9f0, #4361ee) !important;
|
|
color: white !important;
|
|
}
|
|
|
|
.badge.bg-success {
|
|
background: linear-gradient(135deg, #4ade80, #22c55e) !important;
|
|
color: white !important;
|
|
}
|
|
|
|
.badge.bg-warning {
|
|
background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
|
|
color: white !important;
|
|
}
|
|
|
|
.badge.bg-danger {
|
|
background: linear-gradient(135deg, #f87171, #ef4444) !important;
|
|
color: white !important;
|
|
}
|
|
|
|
/* Light badges for quantity, kg, cbm */
|
|
.badge.bg-light {
|
|
background: #f8f9fa !important;
|
|
color: #212529 !important;
|
|
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 */
|
|
.action-container {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
.btn-edit-status {
|
|
background: linear-gradient(135deg, #667eea, #764ba2);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 8px 10px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.btn-edit-status:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
|
|
background: linear-gradient(135deg, #5a6fd8, #6a42a0);
|
|
}
|
|
|
|
.status-dropdown {
|
|
position: absolute;
|
|
top: 100%;
|
|
right: 50px;
|
|
background: white;
|
|
border-radius: 10px;
|
|
box-shadow: 0 10px 25px rgba(0,0,0,0.2);
|
|
padding: 8px;
|
|
min-width: 150px;
|
|
display: none;
|
|
flex-direction: column;
|
|
gap: 5px;
|
|
margin-top: -50px;
|
|
border: 1px solid var(--border);
|
|
z-index: 1050;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.status-dropdown.show {
|
|
display: flex;
|
|
}
|
|
|
|
.status-option {
|
|
padding: 10px 12px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
transition: all 0.2s ease;
|
|
text-align: left;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
background: transparent;
|
|
width: 100%;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.status-option:hover {
|
|
transform: translateX(5px);
|
|
}
|
|
|
|
.status-option.pending {
|
|
background: rgba(248, 150, 30, 0.1);
|
|
color: #f8961e;
|
|
}
|
|
|
|
.status-option.pending:hover {
|
|
background: rgba(248, 150, 30, 0.2);
|
|
}
|
|
|
|
.status-option.in_transit {
|
|
background: rgba(67, 97, 238, 0.1);
|
|
color: #4361ee;
|
|
}
|
|
|
|
.status-option.in_transit:hover {
|
|
background: rgba(67, 97, 238, 0.2);
|
|
}
|
|
|
|
.status-option.dispatched {
|
|
background: rgba(139, 92, 246, 0.1);
|
|
color: #8b5cf6;
|
|
}
|
|
|
|
.status-option.dispatched:hover {
|
|
background: rgba(139, 92, 246, 0.2);
|
|
}
|
|
|
|
.status-option.delivered {
|
|
background: rgba(16, 185, 129, 0.1);
|
|
color: #10b981;
|
|
}
|
|
|
|
.status-option.delivered:hover {
|
|
background: rgba(16, 185, 129, 0.2);
|
|
}
|
|
|
|
.status-indicator {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
display: inline-block;
|
|
}
|
|
|
|
.status-indicator.pending {
|
|
background: #f8961e;
|
|
}
|
|
|
|
.status-indicator.in_transit {
|
|
background: #4361ee;
|
|
}
|
|
|
|
.status-indicator.dispatched {
|
|
background: #8b5cf6;
|
|
}
|
|
|
|
.status-indicator.delivered {
|
|
background: #10b981;
|
|
}
|
|
|
|
/* NEW: View Button Styles - Icon Only */
|
|
.btn-view {
|
|
background: #4361ee;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
padding: 8px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
font-weight: 600;
|
|
font-size: 16px;
|
|
font-family: 'Inter', sans-serif;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.btn-view::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: -100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
transition: all 0.3s ease;
|
|
z-index: 1;
|
|
}
|
|
|
|
.btn-view:hover::before {
|
|
left: 0;
|
|
}
|
|
|
|
.btn-view i {
|
|
position: relative;
|
|
z-index: 2;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-view:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.btn-view:hover i {
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
/* Action buttons container */
|
|
.action-buttons {
|
|
display: flex;
|
|
gap: 8px;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* Modal Styles */
|
|
.modal-content {
|
|
border-radius: 20px;
|
|
border: none;
|
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
overflow: hidden;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.modal-header {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
border: none;
|
|
padding: 25px 30px 15px;
|
|
border-radius: 20px 20px 0 0;
|
|
position: relative;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.modal-header::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 5%;
|
|
width: 90%;
|
|
height: 1px;
|
|
background: rgba(255,255,255,0.2);
|
|
}
|
|
|
|
.modal-title {
|
|
font-weight: 700;
|
|
font-size: 1.5rem;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.btn-close {
|
|
filter: invert(1);
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.btn-close:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 25px 30px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
/* Form Styles */
|
|
.form-label {
|
|
font-weight: 600;
|
|
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;
|
|
transition: all 0.3s ease;
|
|
background: #fafbfc;
|
|
color: #4a5568;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.form-control:focus {
|
|
border-color: #a3bffa;
|
|
box-shadow: 0 0 0 3px rgba(163, 191, 250, 0.2);
|
|
background: white;
|
|
}
|
|
|
|
.form-control::placeholder {
|
|
color: #a0aec0;
|
|
}
|
|
|
|
/* Date Input Styling */
|
|
input[type="date"] {
|
|
position: relative;
|
|
}
|
|
|
|
input[type="date"]::-webkit-calendar-picker-indicator {
|
|
background: transparent;
|
|
bottom: 0;
|
|
color: transparent;
|
|
cursor: pointer;
|
|
height: auto;
|
|
left: 0;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
width: auto;
|
|
}
|
|
|
|
input[type="date"] {
|
|
position: relative;
|
|
padding-right: 40px;
|
|
}
|
|
|
|
input[type="date"]:after {
|
|
content: "📅";
|
|
position: absolute;
|
|
right: 12px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
pointer-events: none;
|
|
font-size: 16px;
|
|
}
|
|
|
|
/* Button Styles */
|
|
.btn-cancel {
|
|
background: #f7fafc;
|
|
color: #718096;
|
|
border: 1px solid #cbd5e0;
|
|
border-radius: 10px;
|
|
font-weight: 600;
|
|
padding: 12px 30px;
|
|
transition: all 0.3s ease;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.btn-cancel:hover {
|
|
background: #edf2f7;
|
|
color: #4a5568;
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.btn-create {
|
|
background: linear-gradient(135deg, #48bb78, #38a169);
|
|
color: white;
|
|
font-weight: 600;
|
|
font-size: 14px;
|
|
border-radius: 10px;
|
|
padding: 12px 35px;
|
|
border: none;
|
|
transition: all 0.3s ease;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.btn-create:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
|
|
background: linear-gradient(135deg, #38a169, #2f855a);
|
|
}
|
|
|
|
/* Custom Table in Modal */
|
|
.custom-table-modal {
|
|
width: 100%;
|
|
border-collapse: separate;
|
|
border-spacing: 0 8px;
|
|
margin: 0;
|
|
min-width: 1300px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.custom-table-modal thead th {
|
|
background: linear-gradient(135deg, #ebf8ff, #f0fff4);
|
|
color: #2b6cb0;
|
|
font-weight: 600;
|
|
padding: 16px 10px;
|
|
border: 1px solid #e2e8f0;
|
|
text-align: center;
|
|
position: relative;
|
|
font-size: 14px;
|
|
letter-spacing: 0.3px;
|
|
white-space: nowrap;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.custom-table-modal thead th:first-child {
|
|
border-top-left-radius: 12px;
|
|
border-bottom-left-radius: 12px;
|
|
}
|
|
|
|
.custom-table-modal thead th:last-child {
|
|
border-top-right-radius: 12px;
|
|
border-bottom-right-radius: 12px;
|
|
}
|
|
|
|
.custom-table-modal tbody tr {
|
|
background: #fdfdfe;
|
|
border-radius: 10px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
|
|
transition: all 0.3s ease;
|
|
border: 1px solid #f1f5f9;
|
|
}
|
|
|
|
.custom-table-modal tbody tr:hover {
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
|
border-color: #e2e8f0;
|
|
background: white;
|
|
}
|
|
|
|
.custom-table-modal tbody td {
|
|
padding: 14px 10px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
border: none;
|
|
font-weight: 500;
|
|
position: relative;
|
|
color: #4a5568;
|
|
white-space: nowrap;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.custom-table-modal tbody tr td:first-child {
|
|
border-top-left-radius: 10px;
|
|
border-bottom-left-radius: 10px;
|
|
}
|
|
|
|
.custom-table-modal tbody tr td:last-child {
|
|
border-top-right-radius: 10px;
|
|
border-bottom-right-radius: 10px;
|
|
}
|
|
|
|
/* Checkbox Styling */
|
|
input[type="checkbox"] {
|
|
width: 20px;
|
|
height: 20px;
|
|
border-radius: 6px;
|
|
border: 2px solid #cbd5e0;
|
|
cursor: pointer;
|
|
position: relative;
|
|
transition: all 0.2s ease;
|
|
background: #f7fafc;
|
|
}
|
|
|
|
input[type="checkbox"]:checked {
|
|
background: var(--primary);
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
/* Link Styling */
|
|
a.text-primary {
|
|
color: var(--primary) !important;
|
|
text-decoration: none;
|
|
font-weight: 600;
|
|
transition: all 0.3s ease;
|
|
position: relative;
|
|
color: #4361ee !important;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
a.text-primary:hover {
|
|
color: var(--primary-dark) !important;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* Shipment Details Modal - UPDATED TO MATCH SECOND CODE */
|
|
.shipment-details-header {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
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 {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-bottom: 25px;
|
|
padding: 20px;
|
|
background: #f8fafc;
|
|
border-radius: 12px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.shipment-info-item {
|
|
flex: 1;
|
|
text-align: center;
|
|
padding: 0 15px;
|
|
}
|
|
|
|
.shipment-info-label {
|
|
font-weight: 600;
|
|
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 {
|
|
width: 100%;
|
|
border-collapse: separate;
|
|
border-spacing: 0 8px;
|
|
margin-top: 20px;
|
|
min-width: 1400px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.shipment-details-table th {
|
|
background: #f1f5f9;
|
|
padding: 16px 12px;
|
|
text-align: center;
|
|
font-weight: 700;
|
|
color: var(--dark);
|
|
border: none;
|
|
position: relative;
|
|
white-space: nowrap;
|
|
font-family: 'Inter', sans-serif;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.shipment-details-table th:first-child {
|
|
border-top-left-radius: 10px;
|
|
border-bottom-left-radius: 10px;
|
|
}
|
|
|
|
.shipment-details-table th:last-child {
|
|
border-top-right-radius: 10px;
|
|
border-bottom-right-radius: 10px;
|
|
}
|
|
|
|
.shipment-details-table td {
|
|
padding: 14px 12px;
|
|
text-align: center;
|
|
border: none;
|
|
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 {
|
|
border-top-left-radius: 10px;
|
|
border-bottom-left-radius: 10px;
|
|
}
|
|
|
|
.shipment-details-table tr td:last-child {
|
|
border-top-right-radius: 10px;
|
|
border-bottom-right-radius: 10px;
|
|
}
|
|
|
|
/* Shipment Totals Section - UPDATED */
|
|
.shipment-totals {
|
|
margin-top: 25px;
|
|
padding: 25px;
|
|
background: linear-gradient(135deg, #f8fafc, #e2e8f0);
|
|
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 {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 20px;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.shipment-total-item {
|
|
flex: 1;
|
|
min-width: 150px;
|
|
text-align: center;
|
|
padding: 15px;
|
|
background: white;
|
|
border-radius: 10px;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
}
|
|
|
|
.shipment-total-label {
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
font-size: 12px;
|
|
margin-bottom: 8px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.shipment-total-value {
|
|
font-weight: 800;
|
|
font-size: 20px;
|
|
color: #1e293b;
|
|
line-height: 1.2;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.total-amount {
|
|
color: #059669 !important;
|
|
background: linear-gradient(135deg, #d1fae5, #a7f3d0);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #10b981;
|
|
}
|
|
|
|
.total-quantity {
|
|
color: #0369a1 !important;
|
|
background: linear-gradient(135deg, #e0f2fe, #bae6fd);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #0ea5e9;
|
|
}
|
|
|
|
.total-weight {
|
|
color: #7c3aed !important;
|
|
background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #8b5cf6;
|
|
}
|
|
|
|
.total-cbm {
|
|
color: #dc2626 !important;
|
|
background: linear-gradient(135deg, #fecaca, #fca5a5);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #ef4444;
|
|
}
|
|
|
|
.total-ctn {
|
|
color: #d97706 !important;
|
|
background: linear-gradient(135deg, #fef3c7, #fde68a);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #f59e0b;
|
|
}
|
|
|
|
.total-ttl-cbm {
|
|
color: #7c3aed !important;
|
|
background: linear-gradient(135deg, #e9d5ff, #c4b5fd);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #8b5cf6;
|
|
}
|
|
|
|
.total-ttl-kg {
|
|
color: #0d9488 !important;
|
|
background: linear-gradient(135deg, #ccfbf1, #99f6e4);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 2px solid #14b8a6;
|
|
}
|
|
|
|
/* Animation for loading */
|
|
@keyframes pulse {
|
|
0% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
100% { opacity: 1; }
|
|
}
|
|
|
|
.loading {
|
|
animation: pulse 1.5s infinite;
|
|
}
|
|
|
|
/* Status Filter Styles */
|
|
.status-filter-container {
|
|
position: relative;
|
|
margin-left:350px;
|
|
}
|
|
|
|
.status-filter-select {
|
|
cursor: pointer;
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
|
|
background-repeat: no-repeat;
|
|
background-position: right 12px center;
|
|
background-size: 16px;
|
|
padding-right: 40px !important;
|
|
}
|
|
|
|
/* Shipment row styling for filtering */
|
|
.shipment-row {
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.shipment-row.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
.shipment-row.visible {
|
|
display: table-row;
|
|
}
|
|
|
|
/* ---------- Pagination Styles (Same as Account Dashboard) ---------- */
|
|
.pagination-container {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
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 {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.pagination-btn {
|
|
background: #fff;
|
|
border: 1px solid #e3eaf6;
|
|
color: #1a2951;
|
|
padding: 8px 12px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 40px;
|
|
height: 32px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.pagination-btn:hover:not(:disabled) {
|
|
background: #1a2951;
|
|
color: white;
|
|
border-color: #1a2951;
|
|
}
|
|
|
|
.pagination-btn:disabled {
|
|
background: #f8fafc;
|
|
color: #cbd5e0;
|
|
border-color: #e2e8f0;
|
|
cursor: not-allowed;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.pagination-page-btn {
|
|
background: #fff;
|
|
border: 1px solid #e3eaf6;
|
|
color: #1a2951;
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
min-width: 36px;
|
|
text-align: center;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.pagination-page-btn:hover {
|
|
background: #1a2951;
|
|
color: white;
|
|
border-color: #1a2951;
|
|
}
|
|
|
|
.pagination-page-btn.active {
|
|
background: #1a2951;
|
|
color: white;
|
|
border-color: #1a2951;
|
|
}
|
|
|
|
.pagination-pages {
|
|
display: flex;
|
|
gap: 4px;
|
|
align-items: center;
|
|
}
|
|
|
|
.pagination-ellipsis {
|
|
color: #9ba5bb;
|
|
font-size: 13px;
|
|
padding: 0 4px;
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
/* Image-based pagination buttons */
|
|
.pagination-img-btn {
|
|
background: #fff;
|
|
border: 1px solid #e3eaf6;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-width: 40px;
|
|
height: 32px;
|
|
padding: 0;
|
|
}
|
|
|
|
.pagination-img-btn:hover:not(:disabled) {
|
|
background: #1a2951;
|
|
border-color: #1a2951;
|
|
}
|
|
|
|
.pagination-img-btn:disabled {
|
|
background: #f8fafc;
|
|
border-color: #e2e8f0;
|
|
cursor: not-allowed;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.pagination-img-btn img {
|
|
width: 16px;
|
|
height: 16px;
|
|
filter: brightness(0) saturate(100%) invert(26%) sepia(89%) saturate(748%) hue-rotate(201deg) brightness(93%) contrast(89%);
|
|
transition: filter 0.3s ease;
|
|
}
|
|
|
|
.pagination-img-btn:hover:not(:disabled) img {
|
|
filter: brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(106%) contrast(101%);
|
|
}
|
|
|
|
.pagination-img-btn:disabled img {
|
|
filter: brightness(0) saturate(100%) invert(84%) sepia(8%) saturate(165%) hue-rotate(179deg) brightness(89%) contrast(86%);
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.pagination-container {
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.pagination-controls {
|
|
justify-content: center;
|
|
}
|
|
}
|
|
|
|
/* Edit Form Styles */
|
|
.edit-shipment-form {
|
|
background: #f8fafc;
|
|
padding: 25px;
|
|
border-radius: 12px;
|
|
margin-bottom: 20px;
|
|
border-left: 4px solid #4361ee;
|
|
}
|
|
|
|
.btn-save {
|
|
background: linear-gradient(135deg, #48bb78, #38a169);
|
|
color: white;
|
|
font-weight: 600;
|
|
border-radius: 8px;
|
|
padding: 10px 20px;
|
|
border: none;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-save:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
|
|
}
|
|
|
|
.btn-cancel-edit {
|
|
background: #f7fafc;
|
|
color: #718096;
|
|
border: 1px solid #cbd5e0;
|
|
border-radius: 8px;
|
|
font-weight: 600;
|
|
padding: 10px 20px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-cancel-edit:hover {
|
|
background: #edf2f7;
|
|
color: #4a5568;
|
|
}
|
|
</style>
|
|
|
|
|
|
<div class="container-fluid py-4">
|
|
|
|
{{-- SUCCESS / ERROR MESSAGES --}}
|
|
@if(session('success'))
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
<i class="bi bi-check-circle-fill me-2"></i>
|
|
{{ session('success') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('error'))
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
<i class="bi bi-exclamation-triangle-fill me-2"></i>
|
|
{{ session('error') }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- ============================= -->
|
|
<!-- SEARCH BAR AND ADD BUTTON -->
|
|
<!-- ============================= -->
|
|
<div class="search-shipment-bar">
|
|
<span class="search-icon">🔍</span>
|
|
<input type="text" id="searchInput" placeholder="Search Shipments...">
|
|
<div class="status-filter-container">
|
|
<select id="statusFilter" class="status-filter-select">
|
|
<option value="all">All Status</option>
|
|
<option value="pending">Pending</option>
|
|
<option value="in_transit">In Transit</option>
|
|
<option value="dispatched">Dispatched</option>
|
|
<option value="delivered">Delivered</option>
|
|
</select>
|
|
</div>
|
|
<select id="carrierFilter">
|
|
<option value="all">All Carriers</option>
|
|
<option value="fedex">FedEx</option>
|
|
<option value="ups">UPS</option>
|
|
<option value="dhl">DHL</option>
|
|
</select>
|
|
<button type="button" class="btn-add-shipment" data-bs-toggle="modal" data-bs-target="#createShipmentModal">
|
|
<span class="truck-icon">🚚</span>
|
|
Add Shipments
|
|
</button>
|
|
</div>
|
|
|
|
<!-- ============================= -->
|
|
<!-- CREATE SHIPMENT MODAL -->
|
|
<!-- ============================= -->
|
|
<div class="modal fade" id="createShipmentModal" tabindex="-1" aria-labelledby="createShipmentModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="createShipmentModalLabel">
|
|
<i class="bi bi-plus-circle me-2"></i>Create New Shipment
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form action="{{ route('admin.shipments.store') }}" method="POST">
|
|
@csrf
|
|
|
|
<div class="row g-3 pb-2">
|
|
<div class="col-md-4">
|
|
<label class="form-label">Origin *</label>
|
|
<input type="text" class="form-control" name="origin" placeholder="Enter origin city" required>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label class="form-label">Destination *</label>
|
|
<input type="text" class="form-control" name="destination" placeholder="Enter destination city" required>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label class="form-label">Shipment Date *</label>
|
|
<input type="date"
|
|
name="shipment_date"
|
|
class="form-control"
|
|
value="{{ date('Y-m-d') }}"
|
|
min="{{ date('Y-m-d') }}"
|
|
required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive mt-4" style="max-height:400px; border-radius:12px;">
|
|
<table class="custom-table-modal">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Order ID</th>
|
|
<th>Origin</th>
|
|
<th>Destination</th>
|
|
<th>CTN</th>
|
|
<th>QTY</th>
|
|
<th>TTL/QTY</th>
|
|
<th>CBM</th>
|
|
<th>TTL CBM</th>
|
|
<th>KG</th>
|
|
<th>TTL KG</th>
|
|
<th>Amount (₹)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($availableOrders as $order)
|
|
<tr>
|
|
<td>
|
|
<input type="checkbox" name="order_ids[]" value="{{ $order->id }}">
|
|
</td>
|
|
<td>
|
|
<a href="#" class="text-primary fw-bold">{{ $order->order_id }}</a>
|
|
</td>
|
|
<td>{{ $order->origin }}</td>
|
|
<td>{{ $order->destination }}</td>
|
|
<td>{{ $order->ctn }}</td>
|
|
<td>{{ $order->qty }}</td>
|
|
<td>{{ $order->ttl_qty }}</td>
|
|
<td>{{ $order->cbm }}</td>
|
|
<td>{{ $order->ttl_cbm }}</td>
|
|
<td>{{ $order->kg }}</td>
|
|
<td>{{ $order->ttl_kg }}</td>
|
|
<td class="fw-bold text-success">₹{{ number_format($order->ttl_amount, 2) }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="12" class="text-muted text-center py-4">No available orders to add to shipment</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="d-flex justify-content-end mt-4 mb-2">
|
|
<button type="button" class="btn-cancel me-3" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn-create">
|
|
<i class="bi bi-check-lg me-2"></i>Create Shipment
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ============================= -->
|
|
<!-- SHIPMENT LIST TABLE -->
|
|
<!-- ============================= -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0"><i class="bi bi-truck me-2"></i> Shipments List</h5>
|
|
</div>
|
|
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Shipment ID</th>
|
|
<th>Origin</th>
|
|
<th>Destination</th>
|
|
<th>Total QTY</th>
|
|
<th>Total KG</th>
|
|
<th>Total CBM</th>
|
|
<th>Total Amount</th>
|
|
<th>Status</th>
|
|
<th>Date</th>
|
|
<th>Action</th>
|
|
<th>View</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody id="shipmentsTableBody">
|
|
@php
|
|
$totalShipments = count($shipments);
|
|
@endphp
|
|
@forelse($shipments as $ship)
|
|
<tr class="shipment-row" data-status="{{ $ship->status }}" data-shipment-id="{{ $ship->shipment_id }}">
|
|
{{-- REVERSE INDEX: सर्वात वरच्या shipment ला सर्वात मोठा क्रमांक --}}
|
|
<td class="fw-bold">{{ $totalShipments - $loop->index }}</td>
|
|
<td>
|
|
<a href="#" class="text-primary fw-bold" onclick="openShipmentDetails({{ $ship->id }})">
|
|
{{ $ship->shipment_id }}
|
|
</a>
|
|
</td>
|
|
<td>{{ $ship->origin }}</td>
|
|
<td>{{ $ship->destination }}</td>
|
|
<td>{{ $ship->total_qty }}</td>
|
|
<td>{{ $ship->total_kg }} kg</td>
|
|
<td>{{ $ship->total_cbm }} CBM</td>
|
|
<td class="fw-bold text-success">₹{{ number_format($ship->total_amount, 2) }}</td>
|
|
<td>
|
|
<span class="badge badge-{{ $ship->status }}">
|
|
{{ ucfirst(str_replace('_', ' ', $ship->status)) }}
|
|
</span>
|
|
</td>
|
|
<td>{{ \Carbon\Carbon::parse($ship->shipment_date)->format('d M Y') }}</td>
|
|
<td>
|
|
<div class="action-container">
|
|
<button type="button" class="btn-edit-status" onclick="toggleStatusDropdown(this, {{ $ship->id }})" title="Edit Status">
|
|
<i class="bi bi-pencil"></i>
|
|
</button>
|
|
<div class="status-dropdown" id="statusDropdown-{{ $ship->id }}">
|
|
<form action="{{ route('admin.shipments.updateStatus') }}" method="POST" class="status-form">
|
|
@csrf
|
|
<input type="hidden" name="shipment_id" value="{{ $ship->id }}">
|
|
<button type="submit" name="status" value="pending" class="status-option pending">
|
|
<span class="status-indicator pending"></span>
|
|
Pending
|
|
</button>
|
|
<button type="submit" name="status" value="in_transit" class="status-option in_transit">
|
|
<span class="status-indicator in_transit"></span>
|
|
In Transit
|
|
</button>
|
|
<button type="submit" name="status" value="dispatched" class="status-option dispatched">
|
|
<span class="status-indicator dispatched"></span>
|
|
Dispatched
|
|
</button>
|
|
<button type="submit" name="status" value="delivered" class="status-option delivered">
|
|
<span class="status-indicator delivered"></span>
|
|
Delivered
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a href="{{ route('admin.shipments.view', ['id' => $ship->id, 'mode' => 'edit']) }}"
|
|
class="btn btn-view">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="12" class="text-center py-5 text-muted">
|
|
<i class="bi bi-inbox display-4 d-block mb-3"></i>
|
|
No shipments found
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination Controls -->
|
|
<div class="pagination-container">
|
|
<div class="pagination-info" id="pageInfo">Showing 1 to {{ $shipments->count() }} of {{ $shipments->count() }} entries</div>
|
|
<div class="pagination-controls">
|
|
<button class="pagination-img-btn" id="prevPageBtn" title="Previous page" disabled>
|
|
<!-- Left arrow SVG -->
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M10 12L6 8L10 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
</button>
|
|
<div class="pagination-pages" id="paginationPages">
|
|
<!-- Page numbers will be inserted here -->
|
|
</div>
|
|
<button class="pagination-img-btn" id="nextPageBtn" title="Next page" disabled>
|
|
<!-- Right arrow SVG -->
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M6 4L10 8L6 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ============================= -->
|
|
<!-- SHIPMENT DETAILS MODAL -->
|
|
<!-- ============================= -->
|
|
<div class="modal fade" id="shipmentDetailsModal" tabindex="-1">
|
|
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
|
<div class="modal-content">
|
|
<div class="modal-header shipment-details-header">
|
|
<h5 class="modal-title fw-bold"><i class="bi bi-box-seam me-2"></i>Consolidated Shipment Details</h5>
|
|
<button class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
|
|
<div class="modal-body shipment-details-body" id="shipmentDetailsContent">
|
|
<div class="text-center py-4 loading">
|
|
<div class="spinner-border text-primary" role="status">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
<p class="mt-2 text-muted">Loading shipment details...</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ========================= -->
|
|
<!-- MODAL LOAD SCRIPT (AJAX) -->
|
|
<!-- ========================= -->
|
|
<script>
|
|
// Pagination state
|
|
let currentPage = 1;
|
|
const itemsPerPage = 10;
|
|
let allShipments = @json($shipments);
|
|
let filteredShipments = [...allShipments];
|
|
|
|
// Initialize pagination on page load
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
renderTable();
|
|
updatePaginationControls();
|
|
|
|
// Bind pagination events
|
|
document.getElementById('prevPageBtn').addEventListener('click', goToPreviousPage);
|
|
document.getElementById('nextPageBtn').addEventListener('click', goToNextPage);
|
|
|
|
// Status Filter Functionality
|
|
const statusFilter = document.getElementById('statusFilter');
|
|
const searchInput = document.getElementById('searchInput');
|
|
const carrierFilter = document.getElementById('carrierFilter');
|
|
|
|
// Function to filter shipments
|
|
function filterShipments() {
|
|
const selectedStatus = statusFilter.value;
|
|
const searchTerm = searchInput.value.toLowerCase();
|
|
const selectedCarrier = carrierFilter.value;
|
|
|
|
filteredShipments = allShipments.filter(shipment => {
|
|
let include = true;
|
|
|
|
// Status filter
|
|
if (selectedStatus !== 'all' && shipment.status !== selectedStatus) {
|
|
include = false;
|
|
}
|
|
|
|
// Search filter
|
|
if (searchTerm) {
|
|
const matchesSearch =
|
|
shipment.shipment_id.toLowerCase().includes(searchTerm) ||
|
|
shipment.origin.toLowerCase().includes(searchTerm) ||
|
|
shipment.destination.toLowerCase().includes(searchTerm);
|
|
if (!matchesSearch) include = false;
|
|
}
|
|
|
|
// Carrier filter (you can add carrier data attribute if needed)
|
|
if (selectedCarrier !== 'all') {
|
|
// Add carrier filtering logic here if you have carrier data
|
|
}
|
|
|
|
return include;
|
|
});
|
|
|
|
currentPage = 1;
|
|
renderTable();
|
|
updatePaginationControls();
|
|
}
|
|
|
|
// Event listeners for filters
|
|
statusFilter.addEventListener('change', filterShipments);
|
|
searchInput.addEventListener('input', filterShipments);
|
|
carrierFilter.addEventListener('change', filterShipments);
|
|
|
|
// Initialize filter on page load
|
|
filterShipments();
|
|
});
|
|
|
|
// Pagination Functions
|
|
function goToPreviousPage() {
|
|
if (currentPage > 1) {
|
|
currentPage--;
|
|
renderTable();
|
|
updatePaginationControls();
|
|
}
|
|
}
|
|
|
|
function goToNextPage() {
|
|
const totalPages = Math.ceil(filteredShipments.length / itemsPerPage);
|
|
if (currentPage < totalPages) {
|
|
currentPage++;
|
|
renderTable();
|
|
updatePaginationControls();
|
|
}
|
|
}
|
|
|
|
function updatePaginationControls() {
|
|
const totalPages = Math.ceil(filteredShipments.length / itemsPerPage);
|
|
const prevBtn = document.getElementById('prevPageBtn');
|
|
const nextBtn = document.getElementById('nextPageBtn');
|
|
const pageInfo = document.getElementById('pageInfo');
|
|
const paginationPages = document.getElementById('paginationPages');
|
|
|
|
prevBtn.disabled = currentPage === 1;
|
|
nextBtn.disabled = currentPage === totalPages || totalPages === 0;
|
|
|
|
// Update page info text
|
|
const startIndex = (currentPage - 1) * itemsPerPage + 1;
|
|
const endIndex = Math.min(currentPage * itemsPerPage, filteredShipments.length);
|
|
pageInfo.textContent = `Showing ${startIndex} to ${endIndex} of ${filteredShipments.length} entries`;
|
|
|
|
// Generate page numbers
|
|
paginationPages.innerHTML = '';
|
|
|
|
if (totalPages <= 7) {
|
|
// Show all pages
|
|
for (let i = 1; i <= totalPages; i++) {
|
|
addPageButton(i, paginationPages);
|
|
}
|
|
} else {
|
|
// Show first page, current page range, and last page
|
|
addPageButton(1, paginationPages);
|
|
|
|
if (currentPage > 3) {
|
|
paginationPages.innerHTML += '<span class="pagination-ellipsis">...</span>';
|
|
}
|
|
|
|
const start = Math.max(2, currentPage - 1);
|
|
const end = Math.min(totalPages - 1, currentPage + 1);
|
|
|
|
for (let i = start; i <= end; i++) {
|
|
addPageButton(i, paginationPages);
|
|
}
|
|
|
|
if (currentPage < totalPages - 2) {
|
|
paginationPages.innerHTML += '<span class="pagination-ellipsis">...</span>';
|
|
}
|
|
|
|
addPageButton(totalPages, paginationPages);
|
|
}
|
|
}
|
|
|
|
function addPageButton(pageNumber, container) {
|
|
const button = document.createElement('button');
|
|
button.className = 'pagination-page-btn';
|
|
if (pageNumber === currentPage) {
|
|
button.classList.add('active');
|
|
}
|
|
button.textContent = pageNumber;
|
|
button.addEventListener('click', () => {
|
|
currentPage = pageNumber;
|
|
renderTable();
|
|
updatePaginationControls();
|
|
});
|
|
container.appendChild(button);
|
|
}
|
|
|
|
// Render Table Function
|
|
function renderTable() {
|
|
const tbody = document.getElementById('shipmentsTableBody');
|
|
|
|
if (filteredShipments.length === 0) {
|
|
tbody.innerHTML = `
|
|
<tr>
|
|
<td colspan="12" 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>
|
|
</tr>
|
|
`;
|
|
return;
|
|
}
|
|
|
|
// Calculate pagination
|
|
const startIndex = (currentPage - 1) * itemsPerPage;
|
|
const endIndex = startIndex + itemsPerPage;
|
|
const paginatedItems = filteredShipments.slice(startIndex, endIndex);
|
|
|
|
// Sort by creation date (newest first)
|
|
const sortedItems = [...paginatedItems].sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
|
|
|
// Render table rows
|
|
tbody.innerHTML = '';
|
|
sortedItems.forEach((shipment, index) => {
|
|
const displayIndex = filteredShipments.length - (startIndex + index);
|
|
const row = document.createElement('tr');
|
|
row.className = 'shipment-row';
|
|
row.setAttribute('data-status', shipment.status);
|
|
row.setAttribute('data-shipment-id', shipment.shipment_id);
|
|
|
|
row.innerHTML = `
|
|
<td class="fw-bold">${displayIndex}</td>
|
|
<td>
|
|
<a href="#" class="text-primary fw-bold" onclick="openShipmentDetails(${shipment.id})">
|
|
${shipment.shipment_id}
|
|
</a>
|
|
</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 class="fw-bold text-success">₹${parseFloat(shipment.total_amount).toLocaleString('en-IN', {minimumFractionDigits: 2, maximumFractionDigits: 2})}</td>
|
|
<td>
|
|
<span class="badge badge-${shipment.status}">
|
|
${shipment.status.charAt(0).toUpperCase() + shipment.status.slice(1).replace('_', ' ')}
|
|
</span>
|
|
</td>
|
|
<td>${new Date(shipment.shipment_date).toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: 'numeric' })}</td>
|
|
<td>
|
|
<div class="action-container">
|
|
<button type="button" class="btn-edit-status" onclick="toggleStatusDropdown(this, ${shipment.id})" title="Edit Status">
|
|
<i class="bi bi-pencil"></i>
|
|
</button>
|
|
<div class="status-dropdown" id="statusDropdown-${shipment.id}">
|
|
<form action="/admin/shipments/update-status" method="POST" class="status-form">
|
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
|
<input type="hidden" name="shipment_id" value="${shipment.id}">
|
|
<button type="submit" name="status" value="pending" class="status-option pending">
|
|
<span class="status-indicator pending"></span>
|
|
Pending
|
|
</button>
|
|
<button type="submit" name="status" value="in_transit" class="status-option in_transit">
|
|
<span class="status-indicator in_transit"></span>
|
|
In Transit
|
|
</button>
|
|
<button type="submit" name="status" value="dispatched" class="status-option dispatched">
|
|
<span class="status-indicator dispatched"></span>
|
|
Dispatched
|
|
</button>
|
|
<button type="submit" name="status" value="delivered" class="status-option delivered">
|
|
<span class="status-indicator delivered"></span>
|
|
Delivered
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a href="/admin/shipments/view/${shipment.id}?mode=edit"
|
|
class="btn btn-view"
|
|
title="Edit Shipment">
|
|
<i class="bi bi-eye"></i>
|
|
</a>
|
|
</td>
|
|
`;
|
|
tbody.appendChild(row);
|
|
});
|
|
}
|
|
|
|
// Function to open shipment details modal
|
|
function openShipmentDetails(id) {
|
|
let modal = new bootstrap.Modal(document.getElementById('shipmentDetailsModal'));
|
|
let content = document.getElementById('shipmentDetailsContent');
|
|
|
|
content.innerHTML = `
|
|
<div class="text-center py-4 loading">
|
|
<div class="spinner-border text-primary" role="status">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
<p class="mt-2 text-muted">Loading shipment details...</p>
|
|
</div>
|
|
`;
|
|
|
|
fetch(`/admin/shipments/${id}`)
|
|
.then(res => {
|
|
if (!res.ok) throw new Error('Network response was not ok');
|
|
return res.json();
|
|
})
|
|
.then(data => {
|
|
// Format date properly
|
|
const shipmentDate = new Date(data.shipment.shipment_date);
|
|
const formattedDate = shipmentDate.toLocaleDateString('en-GB', {
|
|
day: '2-digit',
|
|
month: 'short',
|
|
year: 'numeric'
|
|
});
|
|
|
|
let html = `
|
|
<!-- Shipment Basic Info -->
|
|
<div class="shipment-info-row">
|
|
<div class="shipment-info-item">
|
|
<div class="shipment-info-label">Shipment ID</div>
|
|
<div class="shipment-info-value">${data.shipment.shipment_id}</div>
|
|
</div>
|
|
<div class="shipment-info-item">
|
|
<div class="shipment-info-label">Total Orders</div>
|
|
<div class="shipment-info-value">${data.orders.length}</div>
|
|
</div>
|
|
<div class="shipment-info-item">
|
|
<div class="shipment-info-label">Status</div>
|
|
<div class="shipment-info-value">${data.shipment.status}</div>
|
|
</div>
|
|
<div class="shipment-info-item">
|
|
<div class="shipment-info-label">Date</div>
|
|
<div class="shipment-info-value">${formattedDate}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h6 class="fw-bold mt-4 mb-3">Detailed view of all orders in this shipment consolidation</h6>
|
|
|
|
<div class="table-responsive">
|
|
<table class="shipment-details-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Order ID</th>
|
|
<th>Origin</th>
|
|
<th>Destination</th>
|
|
<th>Item No</th>
|
|
<th>Description</th>
|
|
<th>CTN</th>
|
|
<th>QTY</th>
|
|
<th>TTL/QTY</th>
|
|
<th>CBM</th>
|
|
<th>TTL CBM</th>
|
|
<th>KG</th>
|
|
<th>TTL KG</th>
|
|
<th>Amount (₹)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
`;
|
|
|
|
data.orders.forEach(order => {
|
|
html += `
|
|
<tr>
|
|
<td class="fw-bold text-primary">${order.order_id}</td>
|
|
<td>${order.origin || 'N/A'}</td>
|
|
<td>${order.destination || 'N/A'}</td>
|
|
<td>${order.mark_no || 'ITEM001'}</td>
|
|
<td>${order.description || 'Manufacturing Equipment'}</td>
|
|
<td>${order.ctn}</td>
|
|
<td>${order.qty}</td>
|
|
<td>${order.ttl_qty}</td>
|
|
<td>${order.cbm || '0.00'}</td>
|
|
<td>${order.ttl_cbm || '0.00'}</td>
|
|
<td>${order.kg || '0.00'}</td>
|
|
<td>${order.ttl_kg || '0.00'}</td>
|
|
<td class="fw-bold text-success">₹${parseFloat(order.ttl_amount).toLocaleString('en-IN', {minimumFractionDigits: 2, maximumFractionDigits: 2})}</td>
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
html += `
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Totals Section -->
|
|
<div class="shipment-totals">
|
|
<div class="shipment-totals-row">
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total CTN</div>
|
|
<div class="shipment-total-value total-ctn">${data.shipment.total_ctn}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total QTY</div>
|
|
<div class="shipment-total-value total-quantity">${data.shipment.total_qty}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total CBM</div>
|
|
<div class="shipment-total-value total-cbm">${data.shipment.total_cbm}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total KG</div>
|
|
<div class="shipment-total-value total-weight">${data.shipment.total_kg}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total TTL/QTY</div>
|
|
<div class="shipment-total-value total-quantity">${data.shipment.total_ttl_qty}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total TTL/CBM</div>
|
|
<div class="shipment-total-value total-ttl-cbm">${data.shipment.total_ttl_cbm}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total TTL/KG</div>
|
|
<div class="shipment-total-value total-ttl-kg">${data.shipment.total_ttl_kg}</div>
|
|
</div>
|
|
<div class="shipment-total-item">
|
|
<div class="shipment-total-label">Total Amount</div>
|
|
<div class="shipment-total-value total-amount">₹${parseFloat(data.shipment.total_amount).toLocaleString('en-IN', {minimumFractionDigits: 2, maximumFractionDigits: 2})}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`;
|
|
|
|
content.innerHTML = html;
|
|
})
|
|
.catch(error => {
|
|
console.error('Error loading shipment details:', error);
|
|
content.innerHTML = `
|
|
<div class="text-center py-5">
|
|
<i class="bi bi-exclamation-triangle display-1 text-danger"></i>
|
|
<h4 class="mt-3 text-danger">Error Loading Shipment Details</h4>
|
|
<p class="text-muted">Please try again later</p>
|
|
<button class="btn btn-primary mt-2" onclick="openShipmentDetails(${id})">Retry</button>
|
|
</div>
|
|
`;
|
|
});
|
|
|
|
modal.show();
|
|
}
|
|
|
|
// Toggle status dropdown
|
|
function toggleStatusDropdown(button, shipmentId) {
|
|
const dropdown = document.getElementById(`statusDropdown-${shipmentId}`);
|
|
const isShowing = dropdown.classList.contains('show');
|
|
|
|
// Close all other dropdowns
|
|
document.querySelectorAll('.status-dropdown.show').forEach(dropdown => {
|
|
dropdown.classList.remove('show');
|
|
});
|
|
|
|
// Toggle current dropdown
|
|
if (!isShowing) {
|
|
dropdown.classList.add('show');
|
|
}
|
|
|
|
// Close dropdown when clicking outside
|
|
document.addEventListener('click', function closeDropdown(e) {
|
|
// allow clicking links normally
|
|
if (e.target.closest('a')) return;
|
|
|
|
if (!button.contains(e.target) && !dropdown.contains(e.target)) {
|
|
dropdown.classList.remove('show');
|
|
document.removeEventListener('click', closeDropdown);
|
|
}
|
|
}, { once: true });
|
|
|
|
}
|
|
|
|
// Auto-close dropdown after form submission
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
document.querySelectorAll('.status-form').forEach(form => {
|
|
form.addEventListener('submit', function() {
|
|
const dropdown = this.closest('.status-dropdown');
|
|
if (dropdown) {
|
|
dropdown.classList.remove('show');
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
@endsection |