Frontend dashboard, shipment, invoice , customer

This commit is contained in:
divya abdar
2025-12-01 10:38:52 +05:30
parent 97db70c40e
commit aa616fcf61
15 changed files with 4280 additions and 2509 deletions

View File

@@ -5,6 +5,14 @@
@section('content')
<style>
/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
overflow-x: hidden; /* Prevent horizontal scroll on body */
}
.glass-card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
@@ -14,71 +22,171 @@
overflow: hidden;
}
.stats-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
/* New Stats Container */
.stats-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 12px;
margin: 20px 0;
}
.stat-card {
background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
padding: 16px;
border-radius: 12px;
padding: 15px;
color: white;
position: relative;
overflow: hidden;
border-left: 4px solid #4f46e5;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
transition: transform 0.3s ease;
min-height: 80px;
display: flex;
align-items: center;
gap: 12px;
min-height: 70px;
}
.stats-card:hover {
transform: translateY(-3px);
.stat-card:hover {
transform: translateY(-2px);
}
.stats-count {
font-size: 1.4rem;
.stat-card.warning {
border-left-color: #f59e0b;
background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.stat-card.success {
border-left-color: #10b981;
background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}
.stat-card.danger {
border-left-color: #ef4444;
background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.stat-card.info {
border-left-color: #3b82f6;
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.stat-card.secondary {
border-left-color: #8b5cf6;
background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}
.stat-icon {
width: 45px;
height: 45px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(79, 70, 229, 0.1);
flex-shrink: 0;
}
.stat-icon i {
font-size: 18px;
color: #4f46e5;
}
.stat-card.warning .stat-icon {
background: rgba(245, 158, 11, 0.1);
}
.stat-card.warning .stat-icon i {
color: #f59e0b;
}
.stat-card.success .stat-icon {
background: rgba(16, 185, 129, 0.1);
}
.stat-card.success .stat-icon i {
color: #10b981;
}
.stat-card.danger .stat-icon {
background: rgba(239, 68, 68, 0.1);
}
.stat-card.danger .stat-icon i {
color: #ef4444;
}
.stat-card.info .stat-icon {
background: rgba(59, 130, 246, 0.1);
}
.stat-card.info .stat-icon i {
color: #3b82f6;
}
.stat-card.secondary .stat-icon {
background: rgba(139, 92, 246, 0.1);
}
.stat-card.secondary .stat-icon i {
color: #8b5cf6;
}
.stat-content {
flex: 1;
}
.stat-value {
font-size: 22px;
font-weight: 700;
color: #1a202c;
line-height: 1.2;
margin-bottom: 2px;
}
.stats-label {
font-size: 0.75rem;
opacity: 0.9;
.stat-label {
font-size: 12px;
color: #718096;
font-weight: 500;
line-height: 1.3;
}
.stats-icon {
position: absolute;
top: 12px;
right: 12px;
font-size: 1.2rem;
opacity: 0.7;
}
/* Updated Search Container - Wider with icon on left */
.search-container {
background: rgba(255, 255, 255, 0.9);
border-radius: 10px;
padding: 8px 15px;
padding: 6px 12px;
border: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
width: 100%;
width: 350px; /* Increased width */
display: flex;
align-items: center;
}
.search-input {
border: none;
background: transparent;
padding: 5px 10px;
padding: 4px 8px;
width: 100%;
font-size: 14px;
font-size: 13px;
outline: none;
font-family: 'Inter', sans-serif;
}
.search-input::placeholder {
color: #9ca3af;
font-size: 13px;
}
.filter-btn {
background: rgba(102, 126, 234, 0.1);
border: 2px solid transparent;
color: #667eea;
padding: 6px 15px;
padding: 5px 12px;
border-radius: 8px;
font-weight: 600;
transition: all 0.3s ease;
margin: 0 5px;
margin: 0 3px;
text-decoration: none;
display: inline-block;
font-size: 0.8rem;
font-size: 0.75rem;
font-family: 'Inter', sans-serif;
}
.filter-btn.active {
@@ -91,45 +199,106 @@
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 8px;
padding: 8px 20px;
padding: 6px 16px;
color: white;
font-weight: 600;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
transition: all 0.3s ease;
text-decoration: none;
display: inline-block;
font-size: 0.8rem;
font-size: 0.75rem;
font-family: 'Inter', sans-serif;
}
/* Updated Table Styles - Fixed horizontal scroll */
.table-glass {
background: rgba(255, 255, 255, 0.9);
border-radius: 10px;
overflow: hidden;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
font-family: 'Inter', sans-serif;
}
.table-header {
/* Single gradient for entire header - Blue to Purple */
.table thead {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}
.table-header {
color: white !important;
font-weight: 600;
font-size: 0.9rem;
padding: 12px 15px !important;
position: relative;
font-size: 0.85rem;
padding: 14px 12px !important;
border: none;
font-family: 'Inter', sans-serif;
position: relative;
background: linear-gradient(135deg, #667eea 0%);;
}
/* Curved borders for table headers */
/* Remove individual curved borders */
.table-header:first-child {
border-top-left-radius: 10px;
border-top-left-radius: 0;
}
.table-header:last-child {
border-top-right-radius: 0;
}
/* Apply rounded corners to the entire header container */
.table-container thead tr:first-child th:first-child {
border-top-left-radius: 10px;
}
.table-container thead tr:first-child th:last-child {
border-top-right-radius: 10px;
}
/* Updated Table Column Alignment */
.table > :not(caption) > * > * {
padding: 12px 15px;
padding: 14px 12px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
font-size: 14px;
font-family: 'Inter', sans-serif;
vertical-align: middle;
}
/* Center align specific columns */
.table > :not(caption) > * > *:nth-child(2), /* Customer ID */
.table > :not(caption) > * > *:nth-child(3), /* Orders */
.table > :not(caption) > * > *:nth-child(4), /* Total */
.table > :not(caption) > * > *:nth-child(5) { /* Create Date */
text-align: center;
}
/* Customer Info column should remain left-aligned */
.table > :not(caption) > * > *:first-child {
text-align: left;
}
/* Status and Actions columns should remain as is */
.table > :not(caption) > * > *:nth-child(6), /* Status */
.table > :not(caption) > * > *:nth-child(7) { /* Actions */
text-align: center;
}
/* Updated header alignment to match */
.table-header:nth-child(2),
.table-header:nth-child(3),
.table-header:nth-child(4),
.table-header:nth-child(5) {
text-align: center;
}
/* Customer Info header stays left */
.table-header:first-child {
text-align: Center;
}
/* Status and Actions headers stay centered */
.table-header:nth-child(6),
.table-header:nth-child(7) {
text-align: center;
}
.customer-avatar {
@@ -165,7 +334,7 @@
}
.status-badge {
padding: 4px 10px;
padding: 5px 10px;
border-radius: 8px;
font-size: 0.75rem;
font-weight: 600;
@@ -203,15 +372,9 @@
transform: scale(1.05);
}
.stats-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 12px;
margin-bottom: 20px;
}
.customer-info-column {
min-width: 300px;
min-width: 220px;
max-width: 220px; /* Added max-width to prevent overflow */
}
.table tbody tr {
@@ -228,44 +391,28 @@
color: #6c757d;
}
.customer-stats {
font-size: 0.75rem;
color: #6c757d;
}
/* Remove customer-stats since we're adding columns */
/* Enhanced table styling */
/* Enhanced table styling - Fixed horizontal scroll */
.table-container {
border-radius: 10px;
overflow: hidden;
width: 100%; /* Ensure container takes full width */
}
.table-header-container {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 10px 10px 0 0;
overflow: hidden;
}
/* Remove horizontal scroll */
/* Fix table responsiveness */
.table-responsive {
overflow-x: visible !important;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
width: 100%;
}
.container-fluid {
overflow-x: hidden;
}
/* Adjust table layout to fit without scroll */
/* Ensure table doesn't exceed container */
.table {
width: 100%;
min-width: auto;
}
/* Ensure proper column sizing */
.table th,
.table td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
margin-bottom: 0;
table-layout: auto; /* Changed to auto for better column distribution */
}
/* Fix for search and filter section */
@@ -275,21 +422,43 @@
justify-content: space-between;
flex-wrap: nowrap;
gap: 15px;
width: 100%;
}
.search-section {
flex: 1;
min-width: 300px;
display: flex;
align-items: center;
flex-shrink: 0;
}
.filter-section {
display: flex;
align-items: center;
flex-wrap: nowrap;
gap: 8px;
gap: 6px;
flex-shrink: 0;
}
/* ---------- Pagination Styles (Same as Account Dashboard) ---------- */
/* New columns styling */
.orders-column, .total-column, .customer-id-column, .create-date-column {
text-align: center;
font-weight: 500;
min-width: 80px; /* Added minimum widths for consistency */
}
.orders-count {
font-size: 14px;
color: #1a202c;
font-weight: 600;
}
.total-amount {
font-size: 14px;
color: #10b981;
font-weight: 600;
}
/* ---------- Pagination Styles ---------- */
.pagination-container {
display: flex;
justify-content: space-between;
@@ -297,18 +466,23 @@
margin-top: 15px;
padding: 12px 0;
border-top: 1px solid #eef3fb;
font-family: 'Inter', sans-serif;
width: 100%;
}
.pagination-info {
font-size: 13px;
color: #9ba5bb;
font-weight: 600;
flex-shrink: 0;
}
.pagination-controls {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
justify-content: flex-end;
}
.pagination-btn {
@@ -354,6 +528,8 @@
transition: all 0.3s ease;
min-width: 36px;
text-align: center;
text-decoration: none;
display: inline-block;
}
.pagination-page-btn:hover {
@@ -372,6 +548,7 @@
display: flex;
gap: 4px;
align-items: center;
flex-wrap: wrap;
}
.pagination-ellipsis {
@@ -422,14 +599,46 @@
filter: brightness(0) saturate(100%) invert(84%) sepia(8%) saturate(165%) hue-rotate(179deg) brightness(89%) contrast(86%);
}
/* Mobile responsive fixes */
@media (max-width: 1200px) {
.table > :not(caption) > * > * {
padding: 12px 8px;
font-size: 13px;
}
.customer-info-column {
min-width: 180px;
max-width: 180px;
}
}
@media (max-width: 992px) {
.search-container {
width: 280px;
}
.stats-container {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.stats-container {
grid-template-columns: repeat(2, 1fr);
}
.search-filter-container {
flex-direction: column;
align-items: stretch;
gap: 10px;
}
.search-section {
min-width: auto;
justify-content: center;
}
.search-container {
width: 100%;
}
.filter-section {
@@ -446,63 +655,127 @@
.pagination-controls {
justify-content: center;
}
.table > :not(caption) > * > * {
padding: 10px 6px;
font-size: 12px;
}
.customer-info-column {
min-width: 150px;
max-width: 150px;
}
.customer-avatar {
width: 32px;
height: 32px;
font-size: 0.8rem;
}
.action-btn {
width: 26px;
height: 26px;
font-size: 0.7rem;
}
}
@media (max-width: 576px) {
.stats-container {
grid-template-columns: 1fr;
}
.table-responsive {
font-size: 12px;
}
.customer-info-column {
min-width: 120px;
max-width: 120px;
}
.premium-badge,
.regular-badge,
.status-badge {
font-size: 0.6rem;
padding: 2px 6px;
}
}
</style>
<div class="container-fluid">
<!-- Header -->
<!-- Header - Removed gradient -->
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 style="color: #2c3e50; font-weight: 700;">Customer List</h4>
<h4 style="color: #2c3e50; font-weight: 700; font-family: 'Inter', sans-serif;">Customer List</h4>
</div>
<!-- Stats Cards with REAL DATA -->
<div class="stats-row">
<div class="stats-card">
<div class="stats-count">{{ $allCustomers->count() }}</div>
<div class="stats-label">Total Customers</div>
<i class="bi bi-people-fill stats-icon"></i>
<!-- Stats Cards with NEW DESIGN -->
<div class="stats-container">
<!-- Total Customers -->
<div class="stat-card">
<div class="stat-icon">
<i class="bi bi-people-fill"></i>
</div>
<div class="stat-content">
<div class="stat-value">{{ $allCustomers->count() }}</div>
<div class="stat-label">Total Customers</div>
</div>
</div>
<div class="stats-card" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
<div class="stats-count">
@php
$newThisMonth = $allCustomers->filter(function($customer) {
return $customer->created_at->format('Y-m') === now()->format('Y-m');
})->count();
@endphp
{{ $newThisMonth }}
<!-- New This Month -->
<div class="stat-card warning">
<div class="stat-icon">
<i class="bi bi-person-plus"></i>
</div>
<div class="stat-content">
<div class="stat-value">
@php
$newThisMonth = $allCustomers->filter(function($customer) {
return $customer->created_at->format('Y-m') === now()->format('Y-m');
})->count();
@endphp
{{ $newThisMonth }}
</div>
<div class="stat-label">New This Month</div>
</div>
<div class="stats-label">New This Month</div>
<i class="bi bi-person-plus stats-icon"></i>
</div>
<div class="stats-card" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
<div class="stats-count">
@php
$activeCustomers = $allCustomers->where('status', 'active')->count();
@endphp
{{ $activeCustomers }}
<!-- Active Customers -->
<div class="stat-card success">
<div class="stat-icon">
<i class="bi bi-activity"></i>
</div>
<div class="stat-content">
<div class="stat-value">
@php
$activeCustomers = $allCustomers->where('status', 'active')->count();
@endphp
{{ $activeCustomers }}
</div>
<div class="stat-label">Active Customers</div>
</div>
<div class="stats-label">Active Customers</div>
<i class="bi bi-activity stats-icon"></i>
</div>
<div class="stats-card" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);">
<div class="stats-count">
@php
$premiumCount = $allCustomers->where('customer_type', 'premium')->count();
@endphp
{{ $premiumCount }}
<!-- Premium Customers -->
<div class="stat-card secondary">
<div class="stat-icon">
<i class="bi bi-award-fill"></i>
</div>
<div class="stat-content">
<div class="stat-value">
@php
$premiumCount = $allCustomers->where('customer_type', 'premium')->count();
@endphp
{{ $premiumCount }}
</div>
<div class="stat-label">Premium Customers</div>
</div>
<div class="stats-label">Premium Customers</div>
<i class="bi bi-award-fill stats-icon"></i>
</div>
</div>
<!-- Search and Filter Section - FIXED LAYOUT -->
<!-- Search and Filter Section -->
<div class="glass-card p-3 mb-3">
<div class="search-filter-container">
<!-- Search Section -->
<!-- Search Section - Wider with icon on left -->
<div class="search-section">
<form method="GET" action="{{ route('admin.customers.index') }}" class="d-flex align-items-center">
<div class="search-container">
@@ -511,7 +784,7 @@
name="search"
value="{{ $search ?? '' }}"
class="search-input"
placeholder="Search Customer Name, Email, or Phone...">
placeholder="Search customers by name, email, or phone...">
@if(!empty($status))
<input type="hidden" name="status" value="{{ $status }}">
@endif
@@ -547,13 +820,15 @@
<div class="table-container">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead>
<thead class="gradient-table-header">
<tr>
<th class="table-header">Customer Info</th>
<th class="table-header">Customer ID</th>
<th class="table-header">Orders</th>
<th class="table-header">Total</th>
<th class="table-header">Create Date</th>
<th class="table-header">Status</th>
<th class="table-header" width="120">Actions</th>
<th class="table-header" width="100">Actions</th>
</tr>
</thead>
<tbody id="customersTableBody">
@@ -576,20 +851,27 @@
{{ $c->email }}<br>
{{ $c->mobile_no }}
</div>
<div class="customer-stats mt-1">
{{ $c->orders->count() }} orders {{ number_format($c->orders->sum('ttl_amount'), 2) }} total
</div>
</div>
</div>
</td>
<!-- Customer ID -->
<td>
<td class="customer-id-column">
<span class="fw-bold text-primary">{{ $c->customer_id }}</span>
</td>
<!-- Orders Column -->
<td class="orders-column">
<span class="orders-count">{{ $c->orders->count() }}</span>
</td>
<!-- Total Column -->
<td class="total-column">
<span class="total-amount">{{ number_format($c->orders->sum('ttl_amount'), 2) }}</span>
</td>
<!-- Create Date -->
<td>
<td class="create-date-column">
<span class="text-muted">{{ $c->created_at ? $c->created_at->format('d-m-Y') : '-' }}</span>
</td>
@@ -604,7 +886,7 @@
<!-- Actions -->
<td>
<div class="d-flex">
<div class="d-flex justify-content-center">
<a href="{{ route('admin.customers.view', $c->id) }}"
class="action-btn" title="View">
<i class="bi bi-eye"></i>
@@ -622,7 +904,7 @@
</tr>
@empty
<tr>
<td colspan="5" class="text-center py-4">
<td colspan="7" class="text-center py-4">
<i class="bi bi-people display-4 text-muted d-block mb-2"></i>
<span class="text-muted">No customers found.</span>
</td>