laravel-project/templates/dashboard.html

2252 lines
110 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multi-Page Layout Simulation (Charts Removed)</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
/* Define a custom color palette based on the image */
:root {
--primary-color: #6c63ff; /* Purple/Blue accent */
--secondary-bg: #f5f5f9; /* Light page background */
--white: #ffffff;
--text-dark: #333333;
--text-medium: #555555;
--text-light: #999999;
--border-color: #eeeeee;
--light-gray-bg: #f7f7f7; /* Background used in the modal */
--activity-accent: #00bcd4; /* Teal/Cyan for Activities */
}
/* --- CARD SPECIFIC STYLES (INJECTED FOR PACKAGES) --- */
.bs-card-hover {
transition: all 0.2s ease-in-out;
cursor: pointer;
}
.bs-card-hover:hover {
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
/* Accent Background for Activity Rows */
.bg-accent-mimic {
background-color: #f8f9fa;
}
/* Font Awesome Icon Size */
.icon-sm {
font-size: 1rem;
line-height: 1;
}
/* Card Image Fixed Height - PACKAGES */
.card-display-img {
height: 100px;
object-fit: cover;
}
/* Card Image Fixed Height - ACTIVITIES (NEW) */
.activity-display-img {
height: 70px; /* Smaller than package card image (100px) */
object-fit: cover;
}
/* Coach thumbnail inside Activity Card (NEW) */
.coach-thumbnail {
width: 30px;
height: 30px;
border-radius: 50%;
object-fit: cover;
margin-right: 8px;
/* Using a light primary color border for neatness */
border: 2px solid var(--primary-color);
flex-shrink: 0; /* Prevents thumbnail from shrinking */
}
/* Ensure dropdown links take full width */
.btn-dropup-full-width {
width: 100%;
text-align: left;
}
/* NEW: Styles for the compact, icon-driven summary section (PACKAGES) */
.package-summary i {
font-size: 1.5rem;
display: block;
line-height: 1;
}
.package-summary > div {
flex-basis: 33%;
padding: 5px;
border-right: 1px solid var(--border-color);
}
.package-summary > div:last-child {
border-right: none;
}
/* NEW: Styles for the Activities card icon grid (MODIFIED FOR 2 COLUMNS) */
.activity-icon-grid {
display: grid;
grid-template-columns: 1fr 1fr; /* Two equal columns */
gap: 8px 5px; /* Vertical gap, horizontal gap */
font-size: 12px;
padding-left: 5px;
padding-right: 5px;
}
/* Remove default borders */
.activity-icon-grid > div {
border-bottom: none; /* Remove dashed border from every item */
padding-bottom: 0;
}
/* Re-introduce separator on the first row's items to visually separate row 1 and 2 */
.activity-icon-grid > div:nth-child(1),
.activity-icon-grid > div:nth-child(2) {
border-bottom: 1px dashed var(--border-color);
padding-bottom: 5px;
}
/* Re-adjust the icon size for the new layout */
.activity-icon-grid .text-info {
color: var(--activity-accent) !important;
font-size: 13px; /* Slightly smaller icon to fit 2-up */
line-height: 1;
}
/* --- END CARD SPECIFIC STYLES --- */
/* Base Styles */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: var(--secondary-bg);
display: flex;
color: var(--text-dark);
font-size: 14px;
min-height: 100vh; /* Ensures body takes full height and grows with content */
}
/* --- Sidebar Navigation --- */
.sidebar {
width: 250px;
background-color: var(--white);
padding: 20px 0;
box-shadow: 2px 0 10px rgba(0,0,0,0.05);
z-index: 10;
flex-shrink: 0; /* Prevents sidebar from shrinking */
}
/* --- Logo Styles (Size reduced) --- */
.logo {
padding: 10px 0; /* Added vertical padding for spacing */
margin-bottom: 20px;
text-align: center; /* Center the image */
display: block;
}
.logo-image {
/* Reduced from 80% to 70% */
max-width: 70%;
height: auto;
display: inline-block;
border-radius: 4px; /* Maintain design aesthetic */
}
/* --- End Logo Styles --- */
.sidebar h4 {
color: var(--text-light);
padding: 0 20px;
margin-top: 25px;
margin-bottom: 5px;
font-size: 11px;
text-transform: uppercase;
font-weight: 600;
}
.sidebar a {
display: flex;
align-items: center;
padding: 10px 20px;
text-decoration: none;
color: var(--text-medium);
transition: all 0.2s;
font-size: 14px;
cursor: pointer;
}
.sidebar .active-link {
background-color: #f1f1f5;
color: var(--primary-color);
font-weight: 600;
}
.icon-placeholder-sidebar {
font-family: 'Arial', sans-serif;
margin-right: 10px;
font-size: 16px;
}
/* --- Main Content and Header --- */
.main-content {
flex-grow: 1;
padding: 20px 30px;
}
.top-header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--white);
padding: 10px 30px;
margin: -20px -30px 20px -30px;
box-shadow: 0 2px 4px rgba(0,0,0,0.03);
position: sticky;
top: 0;
z-index: 5;
}
.breadcrumbs strong {
color: var(--primary-color);
font-weight: 600;
}
/* --- Header Action Buttons --- */
.header-actions {
display: flex;
align-items: center;
gap: 12px; /* Space between the button groups */
}
.icon-group {
display: flex;
align-items: center;
gap: 8px;
}
.action-group {
display: flex;
align-items: center;
gap: 15px; /* Space between Quick Sale and User Dropdown */
}
.header-icon-btn {
background: none;
border: none;
font-size: 18px;
color: var(--text-medium);
padding: 8px;
cursor: pointer;
border-radius: 6px;
transition: background-color 0.2s;
line-height: 1;
}
.header-icon-btn:hover {
background-color: #f1f1f5;
}
/* New User Dropdown Button Styling */
.user-dropdown-btn {
display: flex;
align-items: center;
background-color: var(--secondary-bg);
border: 1px solid var(--border-color);
padding: 4px 15px 4px 4px;
border-radius: 50px; /* Highly rounded pill shape */
cursor: pointer;
transition: background-color 0.2s, box-shadow 0.2s;
font-weight: 600;
color: var(--text-dark);
}
.user-dropdown-btn:hover {
background-color: #ebebf2;
box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.user-profile {
width: 35px;
height: 35px;
border-radius: 50%;
margin-right: 8px;
background-color: #ddd;
object-fit: cover;
}
/* --- DROPDOWN STYLES --- */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none; /* Initially hidden */
position: absolute;
right: 0; /* Align to the right side of the button */
background-color: var(--white);
min-width: 280px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
z-index: 200; /* High z-index to appear above other elements */
border-radius: 8px;
padding: 10px 0;
margin-top: 10px;
border: 1px solid var(--border-color);
transform-origin: top right;
animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.dropdown-content.show {
display: block;
}
/* Specific Dropdown styles */
.dropdown-content h5 {
color: var(--primary-color);
font-size: 14px;
padding: 5px 15px;
margin: 0 0 5px 0;
border-bottom: 1px solid var(--border-color);
}
.dropdown-item {
padding: 10px 15px;
display: block;
text-decoration: none;
color: var(--text-dark);
line-height: 1.4;
cursor: pointer;
}
.dropdown-item:hover {
background-color: var(--light-gray-bg);
}
.dropdown-item small {
display: block;
color: var(--text-medium);
font-size: 11px;
}
.dropdown-footer {
text-align: center;
padding: 10px 15px 5px;
border-top: 1px solid var(--border-color);
color: var(--primary-color);
font-weight: 600;
font-size: 13px;
cursor: pointer;
}
/* Adjustments for the User Menu content */
.user-menu-content {
min-width: 250px;
}
/* --- END DROPDOWN STYLES --- */
/* --- General Page Content Styles --- */
.page-container {
/* All pages start hidden, except the default active one */
display: none;
}
.page-container.active-page {
display: block;
}
.placeholder-card {
background-color: var(--white);
padding: 40px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
text-align: center;
border-left: 5px solid var(--primary-color);
}
.placeholder-card h2 {
font-size: 30px;
color: var(--primary-color);
}
/* --- Dashboard KPI Styles --- */
.kpi-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.kpi-card {
background-color: var(--white);
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
transition: transform 0.2s;
border-left: 4px solid var(--primary-color); /* Subtle accent */
height: 100%; /* Ensure all cards in a grid have equal height */
box-sizing: border-box;
}
.kpi-card:hover {
transform: translateY(-3px);
box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.kpi-card .kpi-value {
font-size: 32px;
font-weight: 700;
margin-bottom: 5px;
color: var(--text-dark);
display: flex;
align-items: center;
}
.kpi-card .kpi-value span {
font-size: 18px;
margin-right: 10px;
color: var(--primary-color);
}
.kpi-card .kpi-label {
font-size: 14px;
color: var(--text-medium);
margin: 0;
}
.kpi-card .kpi-change {
font-size: 12px;
margin-top: 10px;
font-weight: 600;
}
.kpi-card .positive {
color: #4caf50; /* Green */
}
.kpi-card .negative {
color: #f44336; /* Red */
}
/* --- CARD LAYOUT STYLES (UPDATED) --- */
/* Used for large content containers, like chart backgrounds or sections */
.dashboard-section {
background-color: var(--white);
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
margin-bottom: 20px;
}
.dashboard-section h4 {
color: var(--primary-color);
font-size: 20px;
margin-top: 0;
margin-bottom: 15px;
}
/* Two-column layout for Bar Chart and Hot Sale Card */
.half-width-grid {
display: grid;
grid-template-columns: 1fr 1fr; /* Two equal columns */
gap: 20px;
margin-bottom: 30px;
}
/* Ensure responsiveness on smaller screens */
@media (max-width: 768px) {
.half-width-grid {
grid-template-columns: 1fr; /* Stack vertically on small screens */
}
}
/* Hot Sale Card/Membership Trend Card Specific Styling */
.hot-sale-card {
border-left-color: #6c63ff;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 30px; /* Increased padding for better look */
box-sizing: border-box;
}
.hot-sale-card .product-name {
font-size: 24px;
font-weight: 700;
color: var(--primary-color);
margin: 5px 0 10px;
}
.hot-sale-card .sales-count {
font-size: 48px;
font-weight: 900;
color: #f44336;
line-height: 1;
}
.hot-sale-card .sales-label {
font-size: 16px;
color: var(--text-medium);
margin-top: 5px;
}
/* Style for the new Full-Width Profit Summary Card */
#profit-summary-card {
border-left: 5px solid #4caf50; /* Green accent */
}
.profit-data-grid {
display: flex;
justify-content: space-around;
gap: 20px;
text-align: center;
}
.profit-item .value {
font-size: 36px;
font-weight: 800;
margin-bottom: 5px;
}
.profit-item .label {
font-size: 14px;
color: var(--text-medium);
}
/* --- END CARD LAYOUT STYLES --- */
/* --- NEW TOP 5 PRODUCTS LIST STYLES --- */
#top-products-card {
/* Inherits dashboard-section styles, adjust padding for list view */
padding: 20px 30px;
border-left: 4px solid #f44336;
}
.product-list {
display: flex;
flex-direction: column;
gap: 15px;
}
.product-item {
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
}
.product-item:last-child {
border-bottom: none;
}
.product-rank {
font-size: 18px;
font-weight: 700;
color: var(--primary-color);
width: 30px;
text-align: center;
flex-shrink: 0;
}
.product-details {
display: flex;
flex-grow: 1;
align-items: center;
}
.product-image {
font-size: 24px;
margin: 0 15px;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
background-color: #f1f1f5;
border-radius: 6px;
flex-shrink: 0;
}
.product-info {
flex-grow: 1;
min-width: 0;
}
.product-info strong {
display: block;
font-size: 14px;
color: var(--text-dark);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.product-info small {
display: block;
font-size: 12px;
color: var(--text-medium);
}
.product-stats {
display: flex;
gap: 15px;
margin-left: 20px;
text-align: right;
flex-shrink: 0;
font-size: 13px;
font-weight: 500;
}
.stat-value {
font-size: 14px;
font-weight: 700;
display: block;
color: var(--text-dark);
}
/* Responsive adjustments for the product list on small screens */
@media (max-width: 500px) {
.product-stats {
flex-direction: column; /* Stack sales and burn vertically */
gap: 5px;
}
.product-item {
align-items: flex-start;
}
}
/* --- END NEW TOP 5 PRODUCTS LIST STYLES --- */
/* --- Activity List Group Styles (REMOVED/REPLACED by Activity Cards) --- */
/* Old styles removed to prevent conflicts */
/* --- Member Profile Specific Styles (Remains the same) --- */
.profile-card {
background-color: var(--white);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
margin-bottom: 20px;
}
.profile-header-content { display: flex; align-items: flex-start;
}
.profile-pic { width: 90px; height: 90px; border-radius: 50%; margin-right: 25px; object-fit: cover;
background-color: #ddd; }
.profile-main-info { flex-grow: 1;
}
.profile-main-info h3 { margin: 0; font-size: 30px; font-weight: 700;
}
.stats-badges { display: flex; align-items: flex-end; margin-bottom: 20px; font-size: 14px;
}
.stat-item { display: flex; flex-direction: column; align-items: center; margin-right: 25px;
}
.stat-item .value { font-size: 24px; font-weight: 700; color: var(--primary-color); margin-bottom: 2px;
}
.stat-item .icon-badge { font-size: 14px; color: var(--text-medium);
}
.tag { padding: 4px 10px; border-radius: 4px; margin-right: 8px; font-size: 12px;
font-weight: 600; }
.tag.age { background-color: #e0f7fa; color: #00bcd4;
}
.tag.places { background-color: #f3e5f5; color: #9c27b0;
}
.tag.active { background-color: #e8f5e9; color: #4caf50;
}
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px;
color: var(--text-medium); font-size: 14px; }
.profile-tabs { display: flex; border-bottom: 1px solid var(--border-color);
margin-bottom: 20px; overflow-x: auto; }
.profile-tabs button { background: none; border: none;
padding: 15px 20px; cursor: pointer; font-size: 15px; color: var(--text-medium); font-weight: 500; white-space: nowrap;
}
.profile-tabs button.active { color: var(--primary-color); border-bottom: 3px solid var(--primary-color); font-weight: 600;
}
.tab-content-section { display: none; padding-top: 10px;
}
.tab-content-section.active { display: block;
}
.stats-card { background-color: var(--white); padding: 30px; border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.stats-grid { display: flex; justify-content: space-between;
gap: 20px; }
.stat-box { flex-basis: 32%; padding: 15px; text-align: left;
}
.stat-box .count { font-size: 32px; font-weight: 700;
}
.sessions .count { color: var(--primary-color);
}
.revenue .count { color: #4caf50;
}
.attendance .count { color: #ff9800;
}
.progress-bar-container { height: 8px; background-color: var(--border-color); border-radius: 4px; margin-top: 10px; overflow: hidden;
}
.sessions .progress-bar { background-color: var(--primary-color); width: 70%;
}
.revenue .progress-bar { background-color: #4caf50; width: 85%;
}
.attendance .progress-bar { background-color: #ff9800; width: 85%;
}
.stat-box small { display: block; margin-top: 10px; color: var(--text-light); font-size: 12px;
}
/* --- MODAL STYLES (UPDATED FOR QUICK SALE SCROLLING) --- */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: none; /* Initially hidden */
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.modal-overlay.open {
display: flex;
opacity: 1;
}
.modal-content {
background-color: var(--white);
padding: 30px;
border-radius: 12px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
width: 90%;
max-width: 600px; /* Default max width */
max-height: 90vh;
overflow-y: auto; /* Allows the default modal to scroll */
transform: scale(0.95);
transition: transform 0.3s ease-in-out;
}
/* Quick Sale Modal Specific Sizing and Structure */
#quickSaleModal .modal-content {
max-width: 900px; /* Wider for POS view */
padding: 20px;
/* CRITICAL: Enforce a fixed height and use flex to manage internal space */
height: 85vh;
display: flex;
flex-direction: column;
overflow-y: hidden; /* Prevent the main modal from scrolling, we manage inner components */
}
.modal-overlay.open .modal-content {
transform: scale(1);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-color);
padding-bottom: 10px;
margin-bottom: 20px;
flex-shrink: 0; /* Ensures header does not shrink */
}
#quickSaleModal .modal-header {
border-bottom: none;
padding-bottom: 0;
margin-bottom: 10px;
}
.modal-header h4 {
margin: 0;
font-size: 20px;
color: var(--primary-color);
}
#quickSaleModal .modal-header h4 {
font-size: 22px;
}
#quickSaleModal .modal-header p {
font-size: 14px;
color: var(--text-medium);
margin-top: 5px;
}
.modal-close-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: var(--text-medium);
padding: 5px;
line-height: 1;
}
/* --- General Form & Button Styles (FIXED) --- */
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
font-size: 13px;
font-weight: 600;
color: var(--text-dark);
margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border-color);
border-radius: 6px;
box-sizing: border-box; /* Important for full width */
font-size: 14px;
color: var(--text-dark);
transition: border-color 0.2s, box-shadow 0.2s;
background-color: var(--light-gray-bg);
}
.form-group input:focus,
.form-group select:focus {
border-color: var(--primary-color);
outline: none;
box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
background-color: var(--white);
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 20px;
}
.btn-primary, .btn-secondary {
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
font-weight: 600;
font-size: 14px;
transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
border: none;
}
.btn-primary {
background-color: var(--primary-color);
color: var(--white);
}
.btn-primary:hover {
background-color: #5d56d1; /* Slightly darker */
box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
transform: translateY(-1px);
}
/* Custom Button for Activity (to match accent color) */
.btn-info {
background-color: var(--activity-accent);
border-color: var(--activity-accent);
}
.btn-info:hover {
background-color: #00a4b7;
border-color: #00a4b7;
box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
transform: translateY(-1px);
}
.btn-secondary {
background-color: var(--light-gray-bg);
color: var(--text-medium);
border: 1px solid var(--border-color);
}
.btn-secondary:hover {
background-color: #e6e6ee;
color: var(--text-dark);
transform: translateY(-1px);
}
/* --- END GENERAL FORM & BUTTON STYLES --- */
/* --- NEW QUICK SALE POS STYLES (Updated for scrolling and spacing) --- */
.pos-container {
display: grid;
grid-template-columns: 2fr 1fr; /* Catalog (2/3) | Cart (1/3) */
gap: 20px;
/* CRITICAL: Take up all available height in the flex parent modal-content */
flex-grow: 1;
min-height: 0;
}
/* Catalog Section (Left) */
.catalog-section {
display: flex;
flex-direction: column;
border-radius: 8px;
overflow: hidden;
background-color: var(--light-gray-bg);
padding: 15px;
height: 100%; /* Fill the grid cell height */
min-height: 0; /* Important for inner scrolling */
}
/* Category Tabs */
.category-tabs {
display: flex;
flex-wrap: wrap;
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
margin-bottom: 10px;
flex-shrink: 0; /* Prevents tabs from shrinking */
}
.category-tab-btn {
background: none;
border: none;
padding: 8px 15px;
margin-right: 5px;
border-radius: 5px;
cursor: pointer;
font-weight: 500;
color: var(--text-medium);
transition: background-color 0.2s, color 0.2s;
font-size: 13px;
}
.category-tab-btn.active {
background-color: var(--white);
color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
font-weight: 600;
}
/* Product Grid */
.product-grid {
display: grid;
/* FIX: Use fixed size columns (130px) and auto-fit to prevent stretching when there are few items */
grid-template-columns: repeat(auto-fit, 130px);
gap: 15px;
overflow-y: auto; /* Scrollable catalog */
padding: 10px 0;
flex-grow: 1; /* Take up remaining space in catalog-section */
justify-content: start; /* Aligns tiles to the left, leaving space on the right */
}
.product-tile {
background-color: var(--white);
border-radius: 8px;
padding: 10px;
text-align: center;
cursor: pointer;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
transition: transform 0.1s, box-shadow 0.1s;
/* The tile now correctly adopts the 130px width from the grid column */
}
.product-tile:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.product-tile img {
width: 80px;
height: 80px;
border-radius: 6px;
object-fit: cover;
margin-bottom: 5px;
}
.product-tile strong {
display: block;
font-size: 13px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--text-dark);
}
.product-tile small {
display: block;
color: #f44336; /* Price color */
font-weight: 600;
font-size: 12px;
}
/* Cart Section (Right) */
.cart-section {
background-color: var(--white);
border-radius: 8px;
padding: 20px; /* Reduced padding-bottom slightly to bring the pay button up */
display: flex;
flex-direction: column;
border: 1px solid var(--border-color);
height: 100%; /* Fill the grid cell height */
min-height: 0; /* Important for inner scrolling */
}
.cart-section h5 {
margin-top: 0;
font-size: 16px;
color: var(--primary-color);
padding-bottom: 10px;
border-bottom: 1px solid var(--border-color);
flex-shrink: 0; /* Prevents header from shrinking */
}
.cart-list {
/* FIX: Re-added flex-grow: 1 to push the cart-totals to the bottom */
flex-grow: 1;
overflow-y: auto; /* Enables scrolling for the list when content overflows */
margin-bottom: 15px;
min-height: 0;
}
.cart-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px dashed var(--border-color);
font-size: 13px;
}
.cart-item-info {
flex-grow: 1;
padding-right: 10px;
}
.cart-item-name {
font-weight: 600;
}
.cart-item-price {
color: var(--text-medium);
font-size: 11px;
}
.quantity-control {
display: flex;
align-items: center;
border: 1px solid var(--border-color);
border-radius: 5px;
overflow: hidden;
}
.qty-btn {
background-color: var(--light-gray-bg);
border: none;
width: 25px;
height: 25px;
line-height: 1;
cursor: pointer;
font-size: 16px;
transition: background-color 0.1s;
}
.qty-btn:hover {
background-color: #e0e0e0;
}
.qty-display {
padding: 0 8px;
font-weight: 600;
font-size: 13px;
}
/* Totals Area */
.cart-totals {
padding-top: 10px;
border-top: 1px solid var(--border-color);
margin-top: 10px;
flex-shrink: 0; /* Prevents totals from shrinking */
}
.total-row {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 13px;
}
.total-row.grand-total {
font-size: 18px;
font-weight: 700;
color: var(--text-dark);
margin-top: 10px;
}
.total-row.grand-total span {
color: #f44336;
}
.pay-button-container {
margin-top: 15px;
margin-bottom: 5px; /* Adds a small gap above the bottom padding of the cart section */
}
.pay-button {
width: 100%;
padding: 15px;
border-radius: 8px;
font-size: 16px;
}
/* Responsive adjustments for POS modal */
@media (max-width: 768px) {
#quickSaleModal .modal-content {
padding: 10px;
height: 90vh; /* Use 90% height on mobile */
}
.pos-container {
grid-template-columns: 1fr; /* Stack catalog and cart */
gap: 10px;
}
.cart-section {
/* On mobile, limit the cart section height so both sections fit and scroll */
max-height: 45vh;
}
}
</style>
</head>
<body>
<div class="sidebar">
<div class="logo">
<img src="https://bio.innovator.bh/assets/img/2_1757425606.png" alt="Take One Sports Logo" class="logo-image" onerror="this.onerror=null; this.src='https://placehold.co/150x50/6c63ff/ffffff?text=Logo+Error'">
</div>
<h4>Core Business</h4>
<a id="link_dashboard_page" class="active-link" onclick="showPage('dashboard_page', this)"><span class="icon-placeholder-sidebar">🏠</span> Dashboard</a>
<a id="link_main_dashboard_page" onclick="showPage('main_dashboard_page', this)"><span class="icon-placeholder-sidebar">📊</span> Main Dashboard</a>
<a id="link_packages_page" onclick="showPage('packages_page', this)"><span class="icon-placeholder-sidebar">📦</span> Packages & Activities</a>
<a id="link_user_overview_page" onclick="showPage('user_overview_page', this)"><span class="icon-placeholder-sidebar">👤</span> User Overview</a>
<a id="link_invoicing_payments_page" onclick="showPage('invoicing_payments_page', this)"><span class="icon-placeholder-sidebar">💰</span> Invoicing & Payments</a>
<a id="link_revenue_expenses_page" onclick="showPage('revenue_expenses_page', this)"><span class="icon-placeholder-sidebar">📈</span> Revenue & Expenses</a>
<a id="link_budgeting_forecasting_page" onclick="showPage('budgeting_forecasting_page', this)"><span class="icon-placeholder-sidebar">🗓️</span> Budgeting & Forecasting</a>
<a id="link_payroll_management_page" onclick="showPage('payroll_management_page', this)"><span class="icon-placeholder-sidebar">💵</span> Payroll Management</a>
<h4 style="margin-top: 40px;">People Management</h4>
<div class="members-group">
<a id="link_members_page" onclick="showPage('members_page', this)"><span class="icon-placeholder-sidebar">👥</span> Members</a>
<a id="link_member_directory_page" onclick="showPage('member_directory_page', this)"><span class="icon-placeholder-sidebar">📘</span> Member Directory</a>
<a id="link_enrollments_page" onclick="showPage('enrollments_page', this)"><span class="icon-placeholder-sidebar">✍️</span> Enrollments</a>
<a id="link_attendance_page" onclick="showPage('attendance_page', this)"><span class="icon-placeholder-sidebar"></span> Attendance</a>
<a id="link_workouts_page" onclick="showPage('workouts_page', this)"><span class="icon-placeholder-sidebar">💪</span> Workouts</a>
<a id="link_health_progress_page" onclick="showPage('health_progress_page', this)"><span class="icon-placeholder-sidebar">🩺</span> Health & Progress</a>
<a id="link_member_groups_page" onclick="showPage('member_groups_page', this)"><span class="icon-placeholder-sidebar">📁</span> Member Groups</a>
</div>
<a id="link_staff_management_page" onclick="showPage('staff_management_page', this)"><span class="icon-placeholder-sidebar">💼</span> Staff Management</a>
</div>
<div class="main-content">
<div class="top-header">
<div class="breadcrumbs" id="breadcrumbs">
Core Business <span>></span> <strong>Dashboard</strong>
</div>
<div class="header-actions">
<div class="icon-group">
<div class="dropdown">
<button class="header-icon-btn" title="Notifications" onclick="toggleDropdown('notificationDropdown')">
🔔
</button>
<div id="notificationDropdown" class="dropdown-content">
<h5>Notifications (3 New)</h5>
<a class="dropdown-item">
<strong>Membership Renewal Alert</strong>
<small>John Doe's membership renews tomorrow.</small>
</a>
<a class="dropdown-item">
<strong>New Enrollment</strong>
<small>Jane Smith signed up for Premium Fitness.</small>
</a>
<a class="dropdown-item">
<strong>Support Ticket #45 Resolved</strong>
<small>Ticket resolved by Staff Member A.</small>
</a>
<div class="dropdown-footer" onclick="console.log('Viewing All Notifications...')">View All</div>
</div>
</div>
<div class="dropdown">
<button class="header-icon-btn" title="Messages" onclick="toggleDropdown('messagesDropdown')">
💬
</button>
<div id="messagesDropdown" class="dropdown-content">
<h5>Messages (1 New)</h5>
<a class="dropdown-item">
<strong>Coach Tim</strong>
<small>Regarding John Doe's new workout plan. 3h ago</small>
</a>
<a class="dropdown-item">
<strong>Member Feedback</strong>
<small>Issue with the treadmill in the weight room. Yesterday</small>
</a>
<div class="dropdown-footer" onclick="console.log('Viewing All Messages...')">View All</div>
</div>
</div>
<button class="header-icon-btn" title="Add New Member" onclick="showModal('addMemberModal')">
👤+
</button>
<button class="header-icon-btn" title="Quick Sale / Point of Sale" onclick="showQuickSaleModal()">
👜+
</button>
</div> <div class="action-group">
<div class="dropdown">
<button class="user-dropdown-btn" title="User Menu" onclick="toggleDropdown('userDropdown')">
<img src="https://bio.innovator.bh/assets/img/2_1757425606.png" alt="User Avatar" class="user-profile" onerror="this.onerror=null; this.src='https://placehold.co/35x35/6c63ff/ffffff?text=U'">
<span>Ghazan Yussuf</span>
</button>
<div id="userDropdown" class="dropdown-content user-menu-content">
<h5>Account</h5>
<a class="dropdown-item">
<strong>View Profile</strong>
<small>Update personal details</small>
</a>
<a class="dropdown-item">
<strong>Change Password</strong>
<small>Security settings</small>
</a>
<a class="dropdown-item">
<strong>Support & Help</strong>
<small>Get assistance (Simulated support link)</small>
</a>
<div class="dropdown-footer" onclick="console.log('Logging out...')">Sign Out</div>
</div>
</div>
</div>
</div>
</div>
<div id="dashboard_page" class="page-container active-page">
<h2 style="margin-top: 0;">Main Club Dashboard</h2>
<p style="color: var(--text-medium); margin-bottom: 30px;">A snapshot of real-time club performance and key metrics for decision-making.</p>
<div class="kpi-grid">
<div class="kpi-card">
<div class="kpi-value">
<span style="color: #6c63ff;">👥</span> 1,245
</div>
<p class="kpi-label">Active Members</p>
<div class="kpi-change positive">+3.2% since last month</div>
</div>
<div class="kpi-card" style="border-left-color: #4caf50;">
<div class="kpi-value" style="color: #4caf50;">
<span style="color: #4caf50;">💰</span> BHD 85,400
</div>
<p class="kpi-label">Monthly Revenue</p>
<div class="kpi-change positive">+8.5% goal reached</div>
</div>
<div class="kpi-card" style="border-left-color: #ff9800;">
<div class="kpi-value" style="color: #ff9800;">
<span style="color: #ff9800;">🚀</span> 155
</div>
<p class="kpi-label">New Leads This Month</p>
<div class="kpi-change negative">-1.5% from last month</div>
</div>
<div class="kpi-card" style="border-left-color: #00bcd4;">
<div class="kpi-value" style="color: #00bcd4;">
<span style="color: #00bcd4;">🏋️</span> 75%
</div>
<p class="kpi-label">Peak Facility Utilization</p>
<div class="kpi-change positive">+2.0% since last week</div>
</div>
</div>
<div class="dashboard-section mt-5" id="profit-summary-card">
<h4>Monthly Profit & Revenue Summary</h4>
<div class="profit-data-grid">
<div class="profit-item">
<div class="value" style="color: #4caf50;">BHD 102,500</div>
<div class="label">Total Revenue YTD</div>
</div>
<div class="profit-item">
<div class="value" style="color: #6c63ff;">BHD 45,800</div>
<div class="label">Total Expenses YTD</div>
</div>
<div class="profit-item">
<div class="value" style="color: #00bcd4;">BHD 56,700</div>
<div class="label">Net Profit YTD</div>
</div>
</div>
</div>
<div class="half-width-grid">
<div class="dashboard-section" id="top-products-card">
<h4>Top Selling Packages</h4>
<div class="product-list">
<div class="product-item">
<span class="product-rank">1</span>
<div class="product-details">
<div class="product-image">🥋</div>
<div class="product-info">
<strong>MMA Complete</strong>
<small>30 BHD / Mo</small>
</div>
</div>
<div class="product-stats">
<div class="stat-sales">
<span class="stat-value">120</span> Sales
</div>
</div>
</div>
<div class="product-item">
<span class="product-rank">2</span>
<div class="product-details">
<div class="product-image">🥊</div>
<div class="product-info">
<strong>Adult Striking</strong>
<small>35 BHD / Mo</small>
</div>
</div>
<div class="product-stats">
<div class="stat-sales">
<span class="stat-value">85</span> Sales
</div>
</div>
</div>
<div class="product-item">
<span class="product-rank">3</span>
<div class="product-details">
<div class="product-image">👧</div>
<div class="product-info">
<strong>Junior Grapplers</strong>
<small>25 BHD / Mo</small>
</div>
</div>
<div class="product-stats">
<div class="stat-sales">
<span class="stat-value">72</span> Sales
</div>
</div>
</div>
<div class="product-item">
<span class="product-rank">4</span>
<div class="product-details">
<div class="product-image">💪</div>
<div class="product-info">
<strong>Strength & Conditioning</strong>
<small>15 BHD / Mo</small>
</div>
</div>
<div class="product-stats">
<div class="stat-sales">
<span class="stat-value">40</span> Sales
</div>
</div>
</div>
<div class="product-item">
<span class="product-rank">5</span>
<div class="product-details">
<div class="product-image">🧘</div>
<div class="product-info">
<strong>Yoga & Mobility</strong>
<small>12 BHD / Mo</small>
</div>
</div>
<div class="product-stats">
<div class="stat-sales">
<span class="stat-value">31</span> Sales
</div>
</div>
</div>
</div>
</div>
<div class="dashboard-section kpi-card hot-sale-card" style="border-left: 5px solid #ff9800; text-align: center;">
<h4>Hot Sale This Week</h4>
<div class="sales-count">12</div>
<div class="sales-label">sales of</div>
<div class="product-name">MMA Complete</div>
<p style="font-size: 13px; color: var(--text-medium); margin-bottom: 0;">An increase of 3 sales (33%) from last week.</p>
</div>
</div>
</div>
<div id="packages_page" class="page-container">
<h2 style="margin-top: 0;">Packages & Activities Management</h2>
<p style="color: var(--text-medium); margin-bottom: 30px;">Manage packages, their underlying activities, coaches, and scheduling.</p>
<div class="row g-4">
<div class="col-md-6">
<div class="dashboard-section p-3 h-100" style="border-left: 4px solid var(--primary-color); padding-bottom: 10px !important;">
<div class="d-flex justify-content-between align-items-center mb-3">
<h3 class="h5 fw-bold mb-0 text-primary">Available Packages (3)</h3>
<button class="btn btn-primary btn-sm"><i class="fa-solid fa-plus me-2"></i> Create New Package</button>
</div>
<p class="text-muted small mb-3">Total packages: 3. Next billing run: Jan 30th.</p>
<div class="row row-cols-1 row-cols-sm-2 g-3">
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://atlfightshop.com/cdn/shop/articles/muay_thai_vs_bjj_1200x1200.jpg?v=1694817548" class="card-img-top rounded-top card-display-img" alt="Mixed Martial Arts Training">
<div class="card-header border-0 bg-white p-2 pb-0">
<div class="d-flex align-items-center justify-content-between">
<h3 class="card-title h6 fw-semibold mb-0 d-flex align-items-center gap-1">
MMA Complete
</h3>
<div class="text-end">
<p class="h5 fw-bold text-primary mb-0">30 BHD</p>
<p class="text-muted small mb-0">/ Mo</p>
</div>
</div>
</div>
<div class="card-body p-2 pt-0">
<div class="d-flex align-items-center gap-1 mb-2">
<span class="badge text-bg-dark fw-semibold rounded-pill small">Popular</span>
<span class="badge text-bg-secondary fw-semibold rounded-pill small">Multi Activity</span>
</div>
<div class="d-flex justify-content-between package-summary mb-3 bg-light rounded-3 border p-1">
<div class="text-center">
<i class="fa-solid fa-dumbbell text-primary mb-1"></i>
<div class="small fw-bold text-dark">2 Activities</div>
<div class="text-muted small">Muay Thai, BJJ</div>
</div>
<div class="text-center">
<i class="fa-solid fa-users text-primary mb-1"></i>
<div class="small fw-bold text-dark">Age: 3-7</div>
<div class="text-muted small">Junior/Kids</div>
</div>
<div class="text-center">
<i class="fa-solid fa-calendar-alt text-primary mb-1"></i>
<div class="small fw-bold text-dark">3x / Week</div>
<div class="text-muted small">Schedule Fixed</div>
</div>
</div>
<div class="dropup w-100 position-static">
<button class="btn btn-primary dropdown-toggle w-100 btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-user-plus icon-sm me-2"></i> Enroll Member</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-file-invoice icon-sm me-2"></i> View Details</a></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Package</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Package</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://i.ytimg.com/vi/jbh8jD9K81s/maxresdefault.jpg" class="card-img-top rounded-top card-display-img" alt="Kids Brazilian Jiu-Jitsu Training">
<div class="card-header border-0 bg-white p-2 pb-0">
<div class="d-flex align-items-center justify-content-between">
<h3 class="card-title h6 fw-semibold mb-0 d-flex align-items-center gap-1">
Junior Grapplers
</h3>
<div class="text-end">
<p class="h5 fw-bold text-primary mb-0">25 BHD</p>
<p class="text-muted small mb-0">/ Mo</p>
</div>
</div>
</div>
<div class="card-body p-2 pt-0">
<div class="d-flex align-items-center gap-1 mb-2">
<span class="badge text-bg-dark fw-semibold rounded-pill small">New</span>
<span class="badge text-bg-secondary fw-semibold rounded-pill small">Grappling Only</span>
</div>
<div class="d-flex justify-content-between package-summary mb-3 bg-light rounded-3 border p-1">
<div class="text-center">
<i class="fa-solid fa-dumbbell text-primary mb-1"></i>
<div class="small fw-bold text-dark">2 Activities</div>
<div class="text-muted small">BJJ, Wrestling</div>
</div>
<div class="text-center">
<i class="fa-solid fa-users text-primary mb-1"></i>
<div class="small fw-bold text-dark">Age: 8-14</div>
<div class="text-muted small">Youth Focus</div>
</div>
<div class="text-center">
<i class="fa-solid fa-calendar-alt text-primary mb-1"></i>
<div class="small fw-bold text-dark">3x / Week</div>
<div class="text-muted small">Schedule Fixed</div>
</div>
</div>
<div class="dropup w-100 position-static">
<button class="btn btn-primary dropdown-toggle w-100 btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-user-plus icon-sm me-2"></i> Enroll Member</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-file-invoice icon-sm me-2"></i> View Details</a></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Package</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Package</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://www.bkkkids.com/wp-content/uploads/2023/09/IMG-7318.jpg" class="card-img-top rounded-top card-display-img" alt="Adult Striking Training">
<div class="card-header border-0 bg-white p-2 pb-0">
<div class="d-flex align-items-center justify-content-between">
<h3 class="card-title h6 fw-semibold mb-0 d-flex align-items-center gap-1">
Adult Striking
</h3>
<div class="text-end">
<p class="h5 fw-bold text-primary mb-0">35 BHD</p>
<p class="text-muted small mb-0">/ Mo</p>
</div>
</div>
</div>
<div class="card-body p-2 pt-0">
<div class="d-flex align-items-center gap-1 mb-2">
<span class="badge text-bg-dark fw-semibold rounded-pill small">Pro Level</span>
<span class="badge text-bg-secondary fw-semibold rounded-pill small">Striking Only</span>
</div>
<div class="d-flex justify-content-between package-summary mb-3 bg-light rounded-3 border p-1">
<div class="text-center">
<i class="fa-solid fa-dumbbell text-primary mb-1"></i>
<div class="small fw-bold text-dark">2 Activities</div>
<div class="text-muted small">Muay Thai, Boxing</div>
</div>
<div class="text-center">
<i class="fa-solid fa-users text-primary mb-1"></i>
<div class="small fw-bold text-dark">Age: 15+</div>
<div class="text-muted small">Adults Only</div>
</div>
<div class="text-center">
<i class="fa-solid fa-calendar-alt text-primary mb-1"></i>
<div class="small fw-bold text-dark">3x / Week</div>
<div class="text-muted small">Advanced</div>
</div>
</div>
<div class="dropup w-100 position-static">
<button class="btn btn-primary dropdown-toggle w-100 btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-user-plus icon-sm me-2"></i> Enroll Member</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-file-invoice icon-sm me-2"></i> View Details</a></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Package</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Package</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dashboard-section p-3 h-100" style="border-left: 4px solid var(--activity-accent); padding-bottom: 10px !important;">
<div class="d-flex justify-content-between align-items-center mb-3">
<h3 class="h5 fw-bold mb-0" style="color: var(--activity-accent);">Available Activities (6)</h3>
<button class="btn btn-info btn-sm text-white"><i class="fa-solid fa-plus me-2"></i> Create New Activity</button>
</div>
<p class="text-muted small mb-3">Activities are the individual classes that are bundled into packages.</p>
<div class="row row-cols-1 row-cols-sm-2 g-3">
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://c8.alamy.com/comp/2B7869X/muay-thai-fighters-training-at-gym-with-coach-2B7869X.jpg" class="card-img-top rounded-top activity-display-img" alt="Muay Thai Training">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=68" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C1'">
<h6 class="fw-bold mb-0 text-dark me-auto">Muay Thai</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 75 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Main Cage Area
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Mon, Wed, Fri 7 PM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Striking
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://jiujitsulegacy.com/wp-content/uploads/2021/08/bjj-drills.jpg" class="card-img-top rounded-top activity-display-img" alt="BJJ Training">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=1" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C2'">
<h6 class="fw-bold mb-0 text-dark me-auto">BJJ (Gi)</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 90 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Grappling Mat 1
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Tue, Thu 6 PM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Grappling
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://bloximages.chicago2.ospreyom.com/www.theherald-news.com/content/tncms/assets/v3/editorial/3/de/3de66a9c-091f-563b-a5d2-06940f5a77fd/639a0322b722d.image.jpg?resize=1200%2C800" class="card-img-top rounded-top activity-display-img" alt="Wrestling Training">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=17" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C3'">
<h6 class="fw-bold mb-0 text-dark me-auto">Wrestling Fund.</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 45 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Grappling Mat 2
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Sat 10 AM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Grappling
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://cdn.shopify.com/s/files/1/0259/3151/4144/articles/Boxing_1200x1200.jpg?v=1602447957" class="card-img-top rounded-top activity-display-img" alt="Boxing Training">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=33" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C4'">
<h6 class="fw-bold mb-0 text-dark me-auto">Boxing for MMA</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 60 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Striking Zone A
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Mon, Wed, Fri 8:15 PM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Striking
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://media.istockphoto.com/id/1155989104/photo/coach-and-boxer-exercise-in-gym.jpg?s=612x612&w=0&k=20&c=6P43Q10LgIe4rB6iH-N0w1f6O7e0J9b26o6R5g_F2_o=" class="card-img-top rounded-top activity-display-img" alt="S&C Training">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=11" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C5'">
<h6 class="fw-bold mb-0 text-dark me-auto">S&C Training</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 60 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Dedicated Weight Room
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Sun, Tue, Thu 5 PM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Fitness
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card rounded-3 border bs-card-hover shadow-sm h-100">
<img src="https://www.verywellfit.com/thmb/bV7nK8s1UvD_n-s3L7Nn6d-bUoI=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/Verywell-42-4584282-AcroYoga-Sequence-01-f5f24204d13f412c99a6130b91d3420c.jpg" class="card-img-top rounded-top activity-display-img" alt="Yoga and Mobility Class">
<div class="card-body p-2 pt-2">
<div class="d-flex align-items-center mb-3">
<img src="https://i.pravatar.cc/30?img=49" alt="Coach Avatar" class="coach-thumbnail" onerror="this.onerror=null; this.src='https://placehold.co/30x30/6c63ff/ffffff?text=C6'">
<h6 class="fw-bold mb-0 text-dark me-auto">Yoga & Mobility</h6>
<i class="fa-solid fa-angle-right text-muted"></i>
</div>
<div class="activity-icon-grid">
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-clock text-info me-2"></i> 45 min
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-location-dot text-info me-2"></i> Recovery Studio
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-calendar-alt text-info me-2"></i> Wed, Sat 9 AM
</div>
<div class="d-flex align-items-center small text-muted">
<i class="fa-solid fa-tag text-info me-2"></i> Recovery
</div>
</div>
<div class="dropup w-100 position-static mt-3">
<button class="btn btn-sm btn-info dropdown-toggle w-100 text-white fw-bold" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Action <i class="fa-solid fa-angle-right"></i>
</button>
<ul class="dropdown-menu dropdown-menu-start w-100">
<li><a class="dropdown-item fw-bold text-success btn-dropup-full-width" href="#"><i class="fa-solid fa-calendar-check icon-sm me-2"></i> View Schedule</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#"><i class="fa-solid fa-pencil icon-sm me-2"></i> Edit Activity</a></li>
<li><a class="dropdown-item text-danger" href="#"><i class="fa-solid fa-trash-can icon-sm me-2"></i> Delete Activity</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger fw-bold" href="#"><i class="fa-solid fa-mask icon-sm me-2"></i> Assassinate Coach</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="main_dashboard_page" class="page-container">
<div class="placeholder-card">
<h2>Main Dashboard</h2>
<p>Content for the Main Dashboard page goes here.</p>
</div>
</div>
<div id="user_overview_page" class="page-container">
<div class="placeholder-card">
<h2>User Overview</h2>
<p>Content for the User Overview page goes here.</p>
</div>
</div>
<div id="members_page" class="page-container">
<div class="placeholder-card">
<h2>Members List</h2>
<p>Content for the Members list page goes here.</p>
</div>
</div>
<div id="member_directory_page" class="page-container">
<h2 style="margin-top: 0;">Member Directory</h2>
<p style="color: var(--text-medium); margin-bottom: 30px;">A detailed view of an individual member's profile and history.</p>
<div class="profile-card">
<div class="profile-header-content">
<img src="https://bio.innovator.bh/assets/img/2_1757425606.png" alt="Member Profile Picture" class="profile-pic" onerror="this.onerror=null; this.src='https://placehold.co/90x90/6c63ff/ffffff?text=JM'">
<div class="profile-main-info">
<h3>Justin Mason</h3>
<div class="stats-badges">
<div class="stat-item">
<div class="value">12</div>
<div class="icon-badge">🥋 Packages</div>
</div>
<div class="stat-item">
<div class="value">95%</div>
<div class="icon-badge">✅ Attendance</div>
</div>
<div class="stat-item">
<div class="value">BHD 1,500</div>
<div class="icon-badge">💰 Total Revenue</div>
</div>
</div>
<div class="tags">
<span class="tag age">28 Years Old</span>
<span class="tag places">Manama, BH</span>
<span class="tag active">Active Member</span>
</div>
</div>
</div>
<div class="details-grid">
<div><strong>Member ID:</strong> MEM-10045</div>
<div><strong>Joined:</strong> 2022-08-15</div>
<div><strong>Phone:</strong> +973 333-555-123</div>
<div><strong>Email:</strong> justin.m@email.com</div>
<div><strong>Last Check-in:</strong> Today, 19:00 (Muay Thai)</div>
<div><strong>Last Payment:</strong> 2025-01-28</div>
</div>
</div>
<div class="stats-card">
<div class="profile-tabs" id="profileTabs">
<button class="active" onclick="openTab(event, 'packagesTab')">Packages</button>
<button onclick="openTab(event, 'sessionsTab')">Sessions & Attendance</button>
<button onclick="openTab(event, 'invoicingTab')">Invoicing & Payments</button>
<button onclick="openTab(event, 'progressTab')">Progress & Health</button>
</div>
<div id="packagesTab" class="tab-content-section active">
<p>Current Active Packages:</p>
<ul>
<li><strong>MMA Complete (Monthly)</strong> - Expires 2025-02-28</li>
<li><strong>Strength & Conditioning (Quarterly)</strong> - Expires 2025-04-15</li>
</ul>
</div>
<div id="sessionsTab" class="tab-content-section">
<div class="stats-grid">
<div class="stat-box sessions">
<div class="count">25</div>
<p>Total Sessions Last 30 Days</p>
<div class="progress-bar-container"><div class="progress-bar"></div></div>
<small>Goal: 30 Sessions</small>
</div>
<div class="stat-box attendance">
<div class="count">95%</div>
<p>Attendance Rate</p>
<div class="progress-bar-container"><div class="progress-bar"></div></div>
<small>Target: 90%</small>
</div>
<div class="stat-box revenue">
<div class="count">7h 45m</div>
<p>Total Training Time</p>
<div class="progress-bar-container"><div class="progress-bar"></div></div>
<small>Average: 6.5 hours</small>
</div>
</div>
</div>
<div id="invoicingTab" class="tab-content-section">
<p>Recent Invoices:</p>
<ul>
<li>Invoice #00125 - BHD 30.00 - Paid (2025-01-28)</li>
<li>Invoice #00124 - BHD 45.00 - Paid (2024-12-28)</li>
</ul>
</div>
<div id="progressTab" class="tab-content-section">
<p>Progress Notes:</p>
<p>Weight goal progress chart simulation goes here.</p>
</div>
</div>
</div>
</div>
<div id="addMemberModal" class="modal-overlay">
<div class="modal-content">
<div class="modal-header">
<h4>Add New Member</h4>
<button class="modal-close-btn" onclick="hideModal('addMemberModal')">&times;</button>
</div>
<form>
<div class="form-group">
<label for="memberName">Full Name</label>
<input type="text" id="memberName" placeholder="Enter full name" required>
</div>
<div class="form-group">
<label for="memberEmail">Email Address</label>
<input type="email" id="memberEmail" placeholder="Enter email address" required>
</div>
<div class="form-group">
<label for="memberPhone">Phone Number</label>
<input type="tel" id="memberPhone" placeholder="Enter phone number">
</div>
<div class="form-group">
<label for="memberPackage">Select Package</label>
<select id="memberPackage" required>
<option value="">-- Select a package --</option>
<option value="mma">MMA Complete - 30 BHD</option>
<option value="juniors">Junior Grapplers - 25 BHD</option>
<option value="striking">Adult Striking - 35 BHD</option>
</select>
</div>
<div class="form-actions">
<button type="button" class="btn-secondary" onclick="hideModal('addMemberModal')">Cancel</button>
<button type="submit" class="btn-primary">Add Member</button>
</div>
</form>
</div>
</div>
<div id="quickSaleModal" class="modal-overlay">
<div class="modal-content">
<div class="modal-header">
<div>
<h4>Quick Sale Point of Sale (POS)</h4>
<p>Select products and services to complete a rapid sale.</p>
</div>
<button class="modal-close-btn" onclick="hideModal('quickSaleModal')">&times;</button>
</div>
<div class="pos-container">
<div class="catalog-section">
<div class="category-tabs">
<button class="category-tab-btn active">All Items</button>
<button class="category-tab-btn">Packages</button>
<button class="category-tab-btn">Apparel</button>
<button class="category-tab-btn">Supplements</button>
<button class="category-tab-btn">Services</button>
</div>
<div class="product-grid">
<div class="product-tile" onclick="addToCart('Hand Wraps', 5.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=WRAP" alt="Hand Wraps">
<strong>Hand Wraps</strong>
<small>BHD 5.00</small>
</div>
<div class="product-tile" onclick="addToCart('Club T-Shirt', 12.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=SHIRT" alt="Club T-Shirt">
<strong>Club T-Shirt</strong>
<small>BHD 12.00</small>
</div>
<div class="product-tile" onclick="addToCart('MMA Gloves', 25.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=GLOVE" alt="MMA Gloves">
<strong>MMA Gloves</strong>
<small>BHD 25.00</small>
</div>
<div class="product-tile" onclick="addToCart('Protein Powder (Tub)', 35.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=PROTEIN" alt="Protein Powder">
<strong>Protein Powder (Tub)</strong>
<small>BHD 35.00</small>
</div>
<div class="product-tile" onclick="addToCart('MMA Complete Package (1 Mo)', 30.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=MMA" alt="MMA Package">
<strong>MMA Complete (1 Mo)</strong>
<small>BHD 30.00</small>
</div>
<div class="product-tile" onclick="addToCart('Junior Grapplers Package (1 Mo)', 25.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=BJJ" alt="BJJ Package">
<strong>Junior Grapplers (1 Mo)</strong>
<small>BHD 25.00</small>
</div>
<div class="product-tile" onclick="addToCart('Private Session (1 hr)', 20.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=PT" alt="Private Session">
<strong>Private Session (1 hr)</strong>
<small>BHD 20.00</small>
</div>
<div class="product-tile" onclick="addToCart('Hand Wraps', 5.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=WRAP" alt="Hand Wraps">
<strong>Hand Wraps</strong>
<small>BHD 5.00</small>
</div>
<div class="product-tile" onclick="addToCart('Club T-Shirt', 12.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=SHIRT" alt="Club T-Shirt">
<strong>Club T-Shirt</strong>
<small>BHD 12.00</small>
</div>
<div class="product-tile" onclick="addToCart('MMA Gloves', 25.00)">
<img src="https://placehold.co/80x80/6c63ff/ffffff?text=GLOVE" alt="MMA Gloves">
<strong>MMA Gloves</strong>
<small>BHD 25.00</small>
</div>
</div>
</div>
<div class="cart-section">
<h5>Current Cart</h5>
<div class="cart-list" id="cartList">
</div>
<div class="cart-totals">
<div class="total-row">
<span>Subtotal:</span>
<span id="cartSubtotal">BHD 0.00</span>
</div>
<div class="total-row">
<span>Tax (5%):</span>
<span id="cartTax">BHD 0.00</span>
</div>
<div class="total-row grand-total">
<span>Grand Total:</span>
<span id="cartGrandTotal">BHD 0.00</span>
</div>
</div>
<div class="pay-button-container">
<button class="btn-primary pay-button" onclick="checkout()">
Process Payment
</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script>
// --- General Functions ---
function toggleDropdown(id) {
closeAllDropdowns(id); // Close others before opening this one
const dropdown = document.getElementById(id);
if (dropdown) {
dropdown.classList.toggle("show");
}
}
function closeAllDropdowns(exceptId = null) {
const dropdowns = document.getElementsByClassName("dropdown-content");
for (let i = 0; i < dropdowns.length; i++) {
const openDropdown = dropdowns[i];
if (openDropdown.id !== exceptId) {
openDropdown.classList.remove('show');
}
}
}
function showModal(id) {
const modal = document.getElementById(id);
if (modal) {
modal.classList.add('open');
// Optional: Stop background scrolling when modal is open
document.body.style.overflow = 'hidden';
}
}
function hideModal(id) {
const modal = document.getElementById(id);
if (modal) {
modal.classList.remove('open');
// Restore background scrolling
document.body.style.overflow = 'auto';
}
}
// --- Sidebar Navigation Functions ---
function showPage(pageId, linkElement) {
// Remove active-page from all content containers
const pages = document.getElementsByClassName('page-container');
for (let i = 0; i < pages.length; i++) {
pages[i].classList.remove('active-page');
}
// Remove active-link from all sidebar links
const links = document.querySelectorAll('.sidebar a');
links.forEach(link => link.classList.remove('active-link'));
// Add active class to the selected page and link
const targetPage = document.getElementById(pageId);
if (targetPage) {
targetPage.classList.add('active-page');
}
if (linkElement) {
linkElement.classList.add('active-link');
}
// Update breadcrumbs
const breadcrumbsEl = document.getElementById('breadcrumbs');
const linkText = linkElement ? linkElement.textContent.trim() : 'Page';
// Determine the category header (h4) of the clicked link
let parentH4 = 'Core Business'; // Assuming default
let current = linkElement;
while(current) {
if(current.previousElementSibling && current.previousElementSibling.tagName === 'H4') {
parentH4 = current.previousElementSibling.textContent.trim();
break;
}
current = current.previousElementSibling;
}
let breadcrumbText = '';
// Handle the new name: Packages & Activities
if (linkText === 'Packages & Activities') {
breadcrumbText = `${parentH4} <span>></span> <strong>Packages & Activities</strong>`;
} else if (linkText === 'Dashboard') {
breadcrumbText = `${parentH4} <span>></span> <strong>Dashboard</strong>`;
} else if (linkText.includes('Dashboard') && linkText !== 'Dashboard') {
// For Main Dashboard, Revenue Dashboard, etc.
breadcrumbText = `${parentH4} <span>></span> <strong>${linkText.replace(' Dashboard', '')}</strong>`;
} else {
breadcrumbText = `${parentH4} <span>></span> <strong>${linkText}</strong>`; // Bold the final part of the breadcrumb
}
breadcrumbsEl.innerHTML = breadcrumbText;
// Scroll to top of main content
document.querySelector('.main-content').scrollTop = 0;
}
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tab-content-section");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].classList.remove("active");
}
tablinks = document.getElementById("profileTabs").getElementsByTagName("button");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].classList.remove("active");
}
document.getElementById(tabName).classList.add("active");
evt.currentTarget.classList.add("active");
}
// --- Quick Sale POS Logic ---
let cart = [];
const TAX_RATE = 0.05; // 5%
function showQuickSaleModal() {
// Reset cart and update totals every time the modal is opened
cart = [];
updateCartUI();
showModal('quickSaleModal');
}
function addToCart(name, price) {
const existingItem = cart.find(item => item.name === name);
if (existingItem) {
existingItem.quantity += 1;
} else {
cart.push({ name, price, quantity: 1 });
}
updateCartUI();
}
function updateCartItemQuantity(name, change) {
const item = cart.find(i => i.name === name);
if (item) {
item.quantity += change;
if (item.quantity <= 0) {
cart = cart.filter(i => i.name !== name);
}
updateCartUI();
}
}
function updateCartUI() {
const cartList = document.getElementById('cartList');
let subtotal = 0;
// Clear existing list items
cartList.innerHTML = '';
if (cart.length === 0) {
cartList.innerHTML = '<p class="text-muted text-center pt-4">Cart is empty. Add an item from the catalog.</p>';
} else {
cart.forEach(item => {
const itemTotal = item.price * item.quantity;
subtotal += itemTotal;
const itemElement = document.createElement('div');
itemElement.classList.add('cart-item');
itemElement.innerHTML = `
<div class="cart-item-info">
<span class="cart-item-name">${item.name}</span>
<span class="cart-item-price">BHD ${item.price.toFixed(2)} x ${item.quantity}</span>
</div>
<div class="d-flex align-items-center gap-3">
<span class="fw-bold">BHD ${itemTotal.toFixed(2)}</span>
<div class="quantity-control">
<button class="qty-btn" onclick="updateCartItemQuantity('${item.name}', -1)">-</button>
<span class="qty-display">${item.quantity}</span>
<button class="qty-btn" onclick="updateCartItemQuantity('${item.name}', 1)">+</button>
</div>
</div>
`;
cartList.appendChild(itemElement);
});
}
const tax = subtotal * TAX_RATE;
const grandTotal = subtotal + tax;
document.getElementById('cartSubtotal').textContent = `BHD ${subtotal.toFixed(2)}`;
document.getElementById('cartTax').textContent = `BHD ${tax.toFixed(2)}`;
document.getElementById('cartGrandTotal').textContent = `BHD ${grandTotal.toFixed(2)}`;
}
function checkout() {
if (cart.length === 0) {
alert("Your cart is empty!");
return;
}
const total = (cart.reduce((sum, item) => sum + (item.price * item.quantity), 0) * (1 + TAX_RATE)).toFixed(2);
alert(`Processing payment of BHD ${total} for ${cart.length} item(s).\n(Simulation complete!)`);
// Clear cart and close modal on successful checkout simulation
cart = [];
updateCartUI();
hideModal('quickSaleModal');
}
// --- Initialization ---
window.onclick = function(event) {
// Close all dropdowns if the click is outside any dropdown container
if (!event.target.closest('.dropdown')) {
closeAllDropdowns();
}
}
window.onload = function() {
// Set initial state for the dashboard page and link
document.getElementById('dashboard_page').classList.add('active-page');
document.getElementById('link_dashboard_page').classList.add('active-link');
// Initialize cart for POS
updateCartUI();
}
</script>
</body>
</html>