2025-11-06 17:09:52 +05:30
|
|
|
@extends('admin.layouts.app')
|
|
|
|
|
|
2025-11-18 10:01:59 +05:30
|
|
|
@section('page-title', 'Customers')
|
2025-11-06 17:09:52 +05:30
|
|
|
|
|
|
|
|
@section('content')
|
2025-11-18 10:01:59 +05:30
|
|
|
|
|
|
|
|
<style>
|
2025-11-21 16:15:10 +05:30
|
|
|
.glass-card {
|
|
|
|
|
background: rgba(255, 255, 255, 0.95);
|
|
|
|
|
backdrop-filter: blur(20px);
|
|
|
|
|
border-radius: 15px;
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
|
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
|
|
|
|
overflow: hidden;
|
2025-11-18 10:01:59 +05:30
|
|
|
}
|
2025-11-21 16:15:10 +05:30
|
|
|
|
|
|
|
|
.stats-card {
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
padding: 15px;
|
|
|
|
|
color: white;
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
transition: transform 0.3s ease;
|
|
|
|
|
min-height: 80px;
|
2025-11-18 10:01:59 +05:30
|
|
|
}
|
2025-11-21 16:15:10 +05:30
|
|
|
|
|
|
|
|
.stats-card:hover {
|
|
|
|
|
transform: translateY(-3px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-count {
|
|
|
|
|
font-size: 1.4rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
margin-bottom: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-label {
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-icon {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 12px;
|
|
|
|
|
right: 12px;
|
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-container {
|
|
|
|
|
background: rgba(255, 255, 255, 0.9);
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
padding: 8px 15px;
|
|
|
|
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
2025-11-26 23:07:12 +05:30
|
|
|
width: 100%;
|
2025-11-21 16:15:10 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-input {
|
|
|
|
|
border: none;
|
|
|
|
|
background: transparent;
|
|
|
|
|
padding: 5px 10px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
outline: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn {
|
|
|
|
|
background: rgba(102, 126, 234, 0.1);
|
|
|
|
|
border: 2px solid transparent;
|
|
|
|
|
color: #667eea;
|
|
|
|
|
padding: 6px 15px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
margin: 0 5px;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn.active {
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
border-color: #667eea;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.add-customer-btn {
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 8px 20px;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-header {
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
2025-11-18 10:01:59 +05:30
|
|
|
color: white !important;
|
2025-11-21 16:15:10 +05:30
|
|
|
font-weight: 600;
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
padding: 12px 15px !important;
|
|
|
|
|
position: relative;
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Curved borders for table headers */
|
|
|
|
|
.table-header:first-child {
|
|
|
|
|
border-top-left-radius: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-header:last-child {
|
|
|
|
|
border-top-right-radius: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table > :not(caption) > * > * {
|
|
|
|
|
padding: 12px 15px;
|
|
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.customer-avatar {
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: white;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.premium-badge {
|
|
|
|
|
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
padding: 3px 8px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.regular-badge {
|
|
|
|
|
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
padding: 3px 8px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 0.7rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-badge {
|
|
|
|
|
padding: 4px 10px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.active-status {
|
|
|
|
|
background: linear-gradient(135deg, #4cd964 0%, #5ac8fa 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.inactive-status {
|
|
|
|
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-btn {
|
|
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
border: none;
|
|
|
|
|
background: rgba(102, 126, 234, 0.1);
|
|
|
|
|
color: #667eea;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
margin: 0 2px;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-btn:hover {
|
|
|
|
|
background: #667eea;
|
|
|
|
|
color: white;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table tbody tr {
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table tbody tr:hover {
|
|
|
|
|
background: rgba(102, 126, 234, 0.03);
|
|
|
|
|
transform: translateX(5px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.customer-details {
|
|
|
|
|
font-size: 0.8rem;
|
|
|
|
|
color: #6c757d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.customer-stats {
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
color: #6c757d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Enhanced table styling */
|
|
|
|
|
.table-container {
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.table-header-container {
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border-radius: 10px 10px 0 0;
|
|
|
|
|
overflow: hidden;
|
2025-11-18 10:01:59 +05:30
|
|
|
}
|
2025-11-26 23:07:12 +05:30
|
|
|
|
|
|
|
|
/* Remove horizontal scroll */
|
|
|
|
|
.table-responsive {
|
|
|
|
|
overflow-x: visible !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.container-fluid {
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Adjust table layout to fit without scroll */
|
|
|
|
|
.table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-width: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Ensure proper column sizing */
|
|
|
|
|
.table th,
|
|
|
|
|
.table td {
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fix for search and filter section */
|
|
|
|
|
.search-filter-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-section {
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-width: 300px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
2025-11-27 19:39:36 +05:30
|
|
|
|
|
|
|
|
/* ---------- Pagination Styles (Same as Account Dashboard) ---------- */
|
|
|
|
|
.pagination-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
padding: 12px 0;
|
|
|
|
|
border-top: 1px solid #eef3fb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pagination-info {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #9ba5bb;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 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%);
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.search-filter-container {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-section {
|
|
|
|
|
min-width: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-section {
|
|
|
|
|
justify-content: center;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
2025-11-27 19:39:36 +05:30
|
|
|
|
|
|
|
|
.pagination-container {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.pagination-controls {
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
2025-11-26 23:07:12 +05:30
|
|
|
}
|
2025-11-18 10:01:59 +05:30
|
|
|
</style>
|
|
|
|
|
|
2025-11-21 16:15:10 +05:30
|
|
|
<div class="container-fluid">
|
|
|
|
|
<!-- Header -->
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
|
|
|
<h4 style="color: #2c3e50; font-weight: 700;">Customer List</h4>
|
|
|
|
|
</div>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Stats Cards with REAL DATA -->
|
2025-11-21 16:15:10 +05:30
|
|
|
<div class="stats-row">
|
|
|
|
|
<div class="stats-card">
|
2025-11-27 19:39:36 +05:30
|
|
|
<div class="stats-count">{{ $allCustomers->count() }}</div>
|
2025-11-21 16:15:10 +05:30
|
|
|
<div class="stats-label">Total Customers</div>
|
|
|
|
|
<i class="bi bi-people-fill stats-icon"></i>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="stats-card" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="stats-count">
|
|
|
|
|
@php
|
2025-11-27 19:39:36 +05:30
|
|
|
$newThisMonth = $allCustomers->filter(function($customer) {
|
2025-11-26 23:07:12 +05:30
|
|
|
return $customer->created_at->format('Y-m') === now()->format('Y-m');
|
|
|
|
|
})->count();
|
|
|
|
|
@endphp
|
|
|
|
|
{{ $newThisMonth }}
|
|
|
|
|
</div>
|
2025-11-21 16:15:10 +05:30
|
|
|
<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%);">
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="stats-count">
|
|
|
|
|
@php
|
2025-11-27 19:39:36 +05:30
|
|
|
$activeCustomers = $allCustomers->where('status', 'active')->count();
|
2025-11-26 23:07:12 +05:30
|
|
|
@endphp
|
|
|
|
|
{{ $activeCustomers }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="stats-label">Active Customers</div>
|
2025-11-21 16:15:10 +05:30
|
|
|
<i class="bi bi-activity stats-icon"></i>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="stats-card" style="background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);">
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="stats-count">
|
|
|
|
|
@php
|
2025-11-27 19:39:36 +05:30
|
|
|
$premiumCount = $allCustomers->where('customer_type', 'premium')->count();
|
2025-11-26 23:07:12 +05:30
|
|
|
@endphp
|
|
|
|
|
{{ $premiumCount }}
|
|
|
|
|
</div>
|
2025-11-21 16:15:10 +05:30
|
|
|
<div class="stats-label">Premium Customers</div>
|
|
|
|
|
<i class="bi bi-award-fill stats-icon"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Search and Filter Section - FIXED LAYOUT -->
|
2025-11-21 16:15:10 +05:30
|
|
|
<div class="glass-card p-3 mb-3">
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="search-filter-container">
|
|
|
|
|
<!-- Search Section -->
|
|
|
|
|
<div class="search-section">
|
2025-11-21 16:15:10 +05:30
|
|
|
<form method="GET" action="{{ route('admin.customers.index') }}" class="d-flex align-items-center">
|
|
|
|
|
<div class="search-container">
|
|
|
|
|
<i class="bi bi-search text-muted me-2"></i>
|
|
|
|
|
<input type="text"
|
|
|
|
|
name="search"
|
|
|
|
|
value="{{ $search ?? '' }}"
|
|
|
|
|
class="search-input"
|
2025-11-26 23:07:12 +05:30
|
|
|
placeholder="Search Customer Name, Email, or Phone...">
|
2025-11-21 16:15:10 +05:30
|
|
|
@if(!empty($status))
|
|
|
|
|
<input type="hidden" name="status" value="{{ $status }}">
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2025-11-26 23:07:12 +05:30
|
|
|
|
|
|
|
|
<!-- Filter Section -->
|
|
|
|
|
<div class="filter-section">
|
2025-11-18 10:01:59 +05:30
|
|
|
<a href="{{ route('admin.customers.index', ['status'=>'active', 'search'=>$search ?? '']) }}"
|
2025-11-21 16:15:10 +05:30
|
|
|
class="filter-btn {{ ($status ?? '') == 'active' ? 'active' : '' }}">
|
2025-11-18 10:01:59 +05:30
|
|
|
Active
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<a href="{{ route('admin.customers.index', ['status'=>'inactive', 'search'=>$search ?? '']) }}"
|
2025-11-21 16:15:10 +05:30
|
|
|
class="filter-btn {{ ($status ?? '') == 'inactive' ? 'active' : '' }}">
|
2025-11-18 10:01:59 +05:30
|
|
|
Inactive
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<a href="{{ route('admin.customers.index') }}"
|
2025-11-21 16:15:10 +05:30
|
|
|
class="filter-btn {{ empty($status) ? 'active' : '' }}">
|
2025-11-18 10:01:59 +05:30
|
|
|
All
|
|
|
|
|
</a>
|
2025-11-21 16:15:10 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<a href="{{ route('admin.customers.add') }}" class="add-customer-btn">
|
2025-11-21 16:15:10 +05:30
|
|
|
<i class="bi bi-plus-circle me-1"></i>Add Customer
|
|
|
|
|
</a>
|
2025-11-18 10:01:59 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-21 16:15:10 +05:30
|
|
|
</div>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-21 16:15:10 +05:30
|
|
|
<!-- Customer List Table -->
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="table-container">
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<table class="table table-hover align-middle mb-0">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="table-header">Customer Info</th>
|
|
|
|
|
<th class="table-header">Customer ID</th>
|
|
|
|
|
<th class="table-header">Create Date</th>
|
|
|
|
|
<th class="table-header">Status</th>
|
|
|
|
|
<th class="table-header" width="120">Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
2025-11-27 19:39:36 +05:30
|
|
|
<tbody id="customersTableBody">
|
2025-11-26 23:07:12 +05:30
|
|
|
@forelse($customers as $c)
|
|
|
|
|
<tr>
|
|
|
|
|
<!-- Customer Info Column -->
|
|
|
|
|
<td class="customer-info-column">
|
|
|
|
|
<div class="d-flex align-items-start">
|
|
|
|
|
<div class="customer-avatar me-3">
|
|
|
|
|
{{ strtoupper(substr($c->customer_name,0,1)) }}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="fw-bold">{{ $c->customer_name }}</div>
|
|
|
|
|
@if($c->customer_type == 'premium')
|
|
|
|
|
<span class="premium-badge">Premium Customer</span>
|
|
|
|
|
@else
|
|
|
|
|
<span class="regular-badge">Regular Customer</span>
|
|
|
|
|
@endif
|
|
|
|
|
<div class="customer-details mt-1">
|
|
|
|
|
{{ $c->email }}<br>
|
|
|
|
|
{{ $c->mobile_no }}
|
2025-11-21 16:15:10 +05:30
|
|
|
</div>
|
2025-11-26 23:07:12 +05:30
|
|
|
<div class="customer-stats mt-1">
|
|
|
|
|
{{ $c->orders->count() }} orders • ₹{{ number_format($c->orders->sum('ttl_amount'), 2) }} total
|
2025-11-21 16:15:10 +05:30
|
|
|
</div>
|
2025-11-18 10:01:59 +05:30
|
|
|
</div>
|
2025-11-26 23:07:12 +05:30
|
|
|
</div>
|
|
|
|
|
</td>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Customer ID -->
|
|
|
|
|
<td>
|
|
|
|
|
<span class="fw-bold text-primary">{{ $c->customer_id }}</span>
|
|
|
|
|
</td>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Create Date -->
|
|
|
|
|
<td>
|
|
|
|
|
<span class="text-muted">{{ $c->created_at ? $c->created_at->format('d-m-Y') : '-' }}</span>
|
|
|
|
|
</td>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Status -->
|
|
|
|
|
<td>
|
|
|
|
|
@if($c->status === 'active')
|
|
|
|
|
<span class="status-badge active-status">Active</span>
|
|
|
|
|
@else
|
|
|
|
|
<span class="status-badge inactive-status">Inactive</span>
|
|
|
|
|
@endif
|
|
|
|
|
</td>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<!-- Actions -->
|
|
|
|
|
<td>
|
|
|
|
|
<div class="d-flex">
|
|
|
|
|
<a href="{{ route('admin.customers.view', $c->id) }}"
|
|
|
|
|
class="action-btn" title="View">
|
|
|
|
|
<i class="bi bi-eye"></i>
|
|
|
|
|
</a>
|
2025-11-21 16:15:10 +05:30
|
|
|
|
2025-11-26 23:07:12 +05:30
|
|
|
<form action="{{ route('admin.customers.status', $c->id) }}"
|
|
|
|
|
method="POST" style="display:inline-block;">
|
|
|
|
|
@csrf
|
|
|
|
|
<button class="action-btn" title="Toggle Status" type="submit">
|
|
|
|
|
<i class="bi bi-power"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@empty
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="5" 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>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforelse
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2025-11-18 10:01:59 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-11-27 19:39:36 +05:30
|
|
|
|
|
|
|
|
<!-- Pagination Controls -->
|
|
|
|
|
<div class="pagination-container">
|
|
|
|
|
<div class="pagination-info" id="pageInfo">
|
|
|
|
|
Showing {{ $customers->firstItem() ?? 0 }} to {{ $customers->lastItem() ?? 0 }} of {{ $customers->total() }} entries
|
|
|
|
|
</div>
|
|
|
|
|
<div class="pagination-controls">
|
|
|
|
|
<button class="pagination-img-btn" id="prevPageBtn" title="Previous page" {{ $customers->onFirstPage() ? '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">
|
|
|
|
|
@for ($i = 1; $i <= $customers->lastPage(); $i++)
|
|
|
|
|
<a href="{{ $customers->url($i) }}"
|
|
|
|
|
class="pagination-page-btn {{ $customers->currentPage() == $i ? 'active' : '' }}">
|
|
|
|
|
{{ $i }}
|
|
|
|
|
</a>
|
|
|
|
|
@endfor
|
|
|
|
|
</div>
|
|
|
|
|
<button class="pagination-img-btn" id="nextPageBtn" title="Next page" {{ $customers->hasMorePages() ? '' : '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>
|
2025-11-06 17:09:52 +05:30
|
|
|
</div>
|
2025-11-18 10:01:59 +05:30
|
|
|
|
2025-11-27 19:39:36 +05:30
|
|
|
<script>
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
// Add hover effects to table rows
|
|
|
|
|
const tableRows = document.querySelectorAll('.table tbody tr');
|
|
|
|
|
tableRows.forEach(row => {
|
|
|
|
|
row.addEventListener('mouseenter', function() {
|
|
|
|
|
this.style.transform = 'translateX(5px)';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
row.addEventListener('mouseleave', function() {
|
|
|
|
|
this.style.transform = 'translateX(0)';
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Pagination button handlers
|
|
|
|
|
document.getElementById('prevPageBtn').addEventListener('click', function() {
|
|
|
|
|
@if(!$customers->onFirstPage())
|
|
|
|
|
window.location.href = '{{ $customers->previousPageUrl() }}';
|
|
|
|
|
@endif
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById('nextPageBtn').addEventListener('click', function() {
|
|
|
|
|
@if($customers->hasMorePages())
|
|
|
|
|
window.location.href = '{{ $customers->nextPageUrl() }}';
|
|
|
|
|
@endif
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2025-11-21 16:15:10 +05:30
|
|
|
@endsection
|