update pos
This commit is contained in:
parent
5f4a0b383c
commit
30f1ee1e49
487
current_pos_snapshot.html
Normal file
487
current_pos_snapshot.html
Normal file
@ -0,0 +1,487 @@
|
||||
<!doctype html>
|
||||
<html lang="ar" dir="rtl">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>نقاط البيع · حلوى الريامي | Al Riyami Sweets</title>
|
||||
<meta name="description" content='حلوى الريامي: Simplify sweets sales with multilingual POS, stock management, and detailed reports for multi-branch effic' />
|
||||
<meta property="og:description" content="حلوى الريامي: Simplify sweets sales with multilingual POS, stock management, and detailed reports for multi-branch effic" />
|
||||
<meta property="twitter:description" content="حلوى الريامي: Simplify sweets sales with multilingual POS, stock management, and detailed reports for multi-branch effic" />
|
||||
<meta property="og:image" content="https://project-screens.s3.amazonaws.com/screenshots/39728/app-hero-20260419-014257.png" />
|
||||
<meta property="twitter:image" content="https://project-screens.s3.amazonaws.com/screenshots/39728/app-hero-20260419-014257.png" />
|
||||
<meta name="theme-color" content="#343a40" />
|
||||
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=202604201942">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
</head>
|
||||
<body class="">
|
||||
|
||||
<!-- Private Admin Layout -->
|
||||
<div class="d-flex" id="wrapper">
|
||||
<!-- Sidebar -->
|
||||
<div class="border-end bg-dark text-white shadow-sm" id="sidebar-wrapper">
|
||||
<div class="sidebar-heading text-center py-4 fs-5 fw-bold text-uppercase border-bottom border-secondary d-flex flex-column align-items-center">
|
||||
<i class="bi bi-shop me-2 fs-2 mb-2"></i>
|
||||
<span>حلوى الريامي</span>
|
||||
</div>
|
||||
|
||||
<div class="p-3 text-center border-bottom border-secondary">
|
||||
<div class="fw-semibold">مالك النظام</div>
|
||||
<div class="text-white-50 small">مالك / مدير عام · الفرع الرئيسي</div>
|
||||
</div>
|
||||
|
||||
<div class="list-group list-group-flush my-3 pb-5">
|
||||
<a class="list-group-item list-group-item-action " href="index.php?lang=ar">
|
||||
<i class="bi bi-speedometer2"></i> لوحة التحكم </a>
|
||||
|
||||
<!-- المخزون (Inventory) - Now First -->
|
||||
<a class="list-group-item list-group-item-action collapsed" data-bs-toggle="collapse" href="#collapseStock" role="button" aria-expanded="false" aria-controls="collapseStock">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<span><i class="bi bi-box-seam"></i> المخزون</span>
|
||||
<i class="bi bi-chevron-down toggle-icon" style="transition: transform 0.2s;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse " id="collapseStock">
|
||||
<div class="list-group list-group-flush" style="background-color: rgba(0,0,0,0.15);">
|
||||
<a class="list-group-item list-group-item-action " href="stock.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> قائمة الأصناف </a>
|
||||
<a class="list-group-item list-group-item-action " href="categories.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> التصنيفات </a>
|
||||
<a class="list-group-item list-group-item-action " href="units.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> الوحدات </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- المبيعات (Sales) - Now Collapsible -->
|
||||
<a class="list-group-item list-group-item-action " data-bs-toggle="collapse" href="#collapseSales" role="button" aria-expanded="true" aria-controls="collapseSales">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<span><i class="bi bi-cart"></i> المبيعات</span>
|
||||
<i class="bi bi-chevron-down toggle-icon" style="transition: transform 0.2s;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse show" id="collapseSales">
|
||||
<div class="list-group list-group-flush" style="background-color: rgba(0,0,0,0.15);">
|
||||
<a class="list-group-item list-group-item-action " href="sales.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> قائمة الفواتير </a>
|
||||
<a class="list-group-item list-group-item-action " href="normal_sale.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> فاتورة جديدة </a>
|
||||
<a class="list-group-item list-group-item-action active" href="pos.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> نقاط البيع </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="list-group-item list-group-item-action collapsed" data-bs-toggle="collapse" href="#collapsePurchases" role="button" aria-expanded="false" aria-controls="collapsePurchases">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<span><i class="bi bi-bag-plus"></i> المشتريات</span>
|
||||
<i class="bi bi-chevron-down toggle-icon" style="transition: transform 0.2s;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse " id="collapsePurchases">
|
||||
<div class="list-group list-group-flush" style="background-color: rgba(0,0,0,0.15);">
|
||||
<a class="list-group-item list-group-item-action " href="purchases.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> قائمة المشتريات </a>
|
||||
<a class="list-group-item list-group-item-action " href="new_purchase.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> فاتورة مشتريات جديدة </a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- المصروفات (Expenses) -->
|
||||
<a class="list-group-item list-group-item-action collapsed" data-bs-toggle="collapse" href="#collapseExpenses" role="button" aria-expanded="false" aria-controls="collapseExpenses">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<span><i class="bi bi-wallet2"></i> المصروفات</span>
|
||||
<i class="bi bi-chevron-down toggle-icon" style="transition: transform 0.2s;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse " id="collapseExpenses">
|
||||
<div class="list-group list-group-flush" style="background-color: rgba(0,0,0,0.15);">
|
||||
<a class="list-group-item list-group-item-action " href="expenses.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> قائمة المصروفات </a>
|
||||
<a class="list-group-item list-group-item-action " href="expense_categories.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> تصنيفات المصروفات </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="list-group-item list-group-item-action " href="suppliers.php?lang=ar">
|
||||
<i class="bi bi-truck"></i> الموردون </a>
|
||||
<a class="list-group-item list-group-item-action " href="online_orders.php?lang=ar">
|
||||
<i class="bi bi-cart-check"></i> طلبات المتجر </a>
|
||||
<a class="list-group-item list-group-item-action " href="customers.php?lang=ar">
|
||||
<i class="bi bi-people-fill"></i> العملاء </a>
|
||||
<a class="list-group-item list-group-item-action " href="debts.php?lang=ar">
|
||||
<i class="bi bi-journal-text"></i> الديون والفواتير الآجلة </a>
|
||||
<a class="list-group-item list-group-item-action " href="reports.php?lang=ar">
|
||||
<i class="bi bi-bar-chart"></i> التقارير </a>
|
||||
<a class="list-group-item list-group-item-action " href="users.php?lang=ar">
|
||||
<i class="bi bi-people"></i> المستخدمون والأدوار </a>
|
||||
|
||||
<a class="list-group-item list-group-item-action collapsed" data-bs-toggle="collapse" href="#collapseSettings" role="button" aria-expanded="false" aria-controls="collapseSettings">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<span><i class="bi bi-gear"></i> الإعدادات</span>
|
||||
<i class="bi bi-chevron-down toggle-icon" style="transition: transform 0.2s;"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse " id="collapseSettings">
|
||||
<div class="list-group list-group-flush" style="background-color: rgba(0,0,0,0.15);">
|
||||
<a class="list-group-item list-group-item-action" href="#" data-bs-toggle="modal" data-bs-target="#settingsModal" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> إعدادات الشركة </a>
|
||||
<a class="list-group-item list-group-item-action " href="outlets.php?lang=ar" style="padding-left: 2.5rem; padding-right: 2.5rem;">
|
||||
<i class="bi bi-dot"></i> الفروع (المنافذ) </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="page-content-wrapper" class="d-flex flex-column min-vh-100">
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom top-navbar px-3">
|
||||
<div class="d-flex align-items-center justify-content-between w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<button class="btn btn-outline-secondary me-2" id="menu-toggle"><i class="bi bi-list"></i></button>
|
||||
<h4 class="mb-0 ms-2 fw-semibold d-none d-md-block">نقاط البيع</h4>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<a href="shop.php" target="_blank" class="btn btn-outline-success btn-sm me-2" title="زيارة المتجر"><i class="bi bi-shop"></i> <span class="d-none d-md-inline">المتجر</span></a>
|
||||
<div class="language-switcher btn-group" role="group">
|
||||
<a class="btn btn-sm btn-primary" href="pos.php?lang=ar">AR</a>
|
||||
<a class="btn btn-sm btn-outline-primary" href="pos.php?lang=en">EN</a>
|
||||
</div>
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-light dropdown-toggle border" type="button" id="userMenu" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<img src="assets/images/users/9869519f5f02861e6471bb2219173462.webp" alt="Avatar" class="rounded-circle me-1" style="width: 24px; height: 24px; object-fit: cover;">مالك النظام </button>
|
||||
<ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="userMenu">
|
||||
<li><a class="dropdown-item" href="profile.php?lang=ar"><i class="bi bi-person me-2 text-primary"></i> الملف الشخصي</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="logout.php?lang=ar"><i class="bi bi-box-arrow-right text-danger me-2"></i> تسجيل الخروج</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container-fluid p-4">
|
||||
<!-- Flash messages integration using SweetAlert2 -->
|
||||
|
||||
<style>
|
||||
/* Modern POS Styles */
|
||||
.pos-wrapper {
|
||||
height: calc(100vh - 140px); /* Adjust based on your header */
|
||||
min-height: 600px;
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
.pos-products-area {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.pos-cart-area {
|
||||
width: 380px;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Categories Scroll */
|
||||
.cat-scroll-container {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
overflow-x: auto;
|
||||
padding-bottom: 0.5rem;
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
.cat-scroll-container::-webkit-scrollbar {
|
||||
display: none; /* Chrome */
|
||||
}
|
||||
.cat-btn {
|
||||
white-space: nowrap;
|
||||
border-radius: 20px;
|
||||
padding: 0.5rem 1.25rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
background: #fff;
|
||||
border: 1px solid #e9ecef;
|
||||
color: #495057;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cat-btn:hover {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
.cat-btn.active {
|
||||
background: linear-gradient(90deg, #0d6efd, #0dcaf0);
|
||||
color: #fff;
|
||||
border-color: transparent;
|
||||
box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
|
||||
}
|
||||
|
||||
/* Products Grid */
|
||||
.products-grid {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding-right: 0.5rem;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
||||
gap: 1.25rem;
|
||||
align-content: start;
|
||||
}
|
||||
.product-card {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
border: 1px solid transparent;
|
||||
position: relative;
|
||||
user-select: none;
|
||||
}
|
||||
.product-card:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
|
||||
border-color: #0dcaf0;
|
||||
}
|
||||
.product-card:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
.product-img-wrapper {
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
background: #f8f9fa;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.product-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.product-placeholder {
|
||||
font-size: 2rem;
|
||||
color: #dee2e6;
|
||||
}
|
||||
.product-info {
|
||||
padding: 0.75rem;
|
||||
text-align: center;
|
||||
}
|
||||
.product-badges {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.35rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.4rem;
|
||||
}
|
||||
.product-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
.product-badge-new {
|
||||
background: rgba(13, 202, 240, 0.14);
|
||||
color: #087990;
|
||||
}
|
||||
.product-badge-no-image {
|
||||
background: rgba(108, 117, 125, 0.12);
|
||||
color: #6c757d;
|
||||
}
|
||||
.product-title {
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.35rem;
|
||||
color: #212529;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
line-height: 1.25;
|
||||
min-height: 2.5em;
|
||||
word-break: break-word;
|
||||
}
|
||||
.product-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.15rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.product-sku,
|
||||
.product-created {
|
||||
font-size: 0.76rem;
|
||||
color: #6c757d;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.product-price {
|
||||
font-weight: 700;
|
||||
color: #0d6efd;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
/* Cart Styles */
|
||||
.cart-header {
|
||||
background: linear-gradient(90deg, #0d6efd, #0dcaf0);
|
||||
color: #fff;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
.cart-items {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
.cart-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0.75rem 0;
|
||||
border-bottom: 1px dashed #e9ecef;
|
||||
}
|
||||
.cart-item-info {
|
||||
flex: 1;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
.cart-item-title {
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
color: #343a40;
|
||||
}
|
||||
.cart-item-price {
|
||||
color: #6c757d;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.cart-item-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
background: #f8f9fa;
|
||||
border-radius: 20px;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
.cart-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
border: none;
|
||||
background: #fff;
|
||||
color: #495057;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.cart-btn:hover {
|
||||
background: #e9ecef;
|
||||
}
|
||||
.cart-qty {
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
min-width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.cart-footer {
|
||||
padding: 1.25rem;
|
||||
background: #f8f9fa;
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
.summary-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.95rem;
|
||||
color: #495057;
|
||||
}
|
||||
.summary-total {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #212529;
|
||||
padding-top: 0.5rem;
|
||||
border-top: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
/* Pay / Action Buttons */
|
||||
.btn-pay {
|
||||
background: linear-gradient(90deg, #198754, #20c997);
|
||||
border: none;
|
||||
color: white;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
padding: 0.75rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(25, 135, 84, 0.2);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.btn-pay:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(25, 135, 84, 0.3);
|
||||
}
|
||||
.btn-pay:disabled {
|
||||
background: #adb5bd;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.action-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
[dir="ltr"] .cart-item-info {
|
||||
padding-right: 0;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="pos-wrapper">
|
||||
<!-- Left Area: Products -->
|
||||
<div class="pos-products-area">
|
||||
<!-- Top Bar: Search & Hold -->
|
||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2">
|
||||
<div class="d-flex gap-2 flex-wrap">
|
||||
<div class="position-relative" style="width: 200px;">
|
||||
<input type="text" id="posBarcode" class="form-control rounded-pill ps-4 border-primary shadow-sm" placeholder="الباركود..." autocomplete="off" autofocus>
|
||||
<i class="bi bi-upc-scan position-absolute top-50 translate-middle-y text-primary" style="left: 15px;"></i>
|
||||
</div>
|
||||
<div class="position-relative" style="width: 250px;">
|
||||
<input type="text" id="posSearch" class="form-control rounded-pill ps-4" placeholder="بحث بالاسم..." autocomplete="off">
|
||||
<i class="bi bi-search position-absolute top-50 translate-middle-y text-muted" style="left: 15px;"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-outline-primary rounded-pill px-4 shadow-sm" onclick="openHeldOrdersModal()">
|
||||
<i class="bi bi-clock-history me-1"></i> <span id="heldOrdersCount">0</span> قيد الانتظار </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Categories -->
|
||||
<div class="cat-scroll-container mb-4" id="catContainer">
|
||||
<button class="cat-btn active" data-cat="all" onclick="filterCat('all')">الكل</button>
|
||||
<button class="cat-btn" data-cat="2" onclick="filterCat('2')">إكسسوارات</button>
|
||||
<button class="cat-btn" data-cat="1" onclick="filterCat('1')">إلكترونيات</button>
|
||||
<button class="cat-btn" data-cat="3" onclick="filterCat('3')">ملابس</button>
|
||||
</div>
|
||||
|
||||
<!-- Grid -->
|
||||
<div class="products-grid" id="productsGrid">
|
||||
<div class="product-card" data-sku="25427" data-name="هدايا مختلفة" data-price="5.65" data-cat="1" data-search="
|
||||
12
pos.php
12
pos.php
@ -421,8 +421,14 @@ require __DIR__ . '/includes/header.php';
|
||||
<!-- Grid -->
|
||||
<div class="products-grid" id="productsGrid">
|
||||
<?php foreach ($catalog as $sku => $item):
|
||||
$itemSku = h($sku);
|
||||
$itemName = h(current_lang() === 'ar' ? $item['name_ar'] : $item['name_en']);
|
||||
$itemSkuRaw = (string) $sku;
|
||||
$itemNameRaw = (string) (current_lang() === 'ar' ? $item['name_ar'] : $item['name_en']);
|
||||
$searchTextRaw = $itemNameRaw . ' ' . $itemSkuRaw;
|
||||
$searchText = function_exists('mb_strtolower')
|
||||
? mb_strtolower($searchTextRaw, 'UTF-8')
|
||||
: strtolower($searchTextRaw);
|
||||
$itemSku = h($itemSkuRaw);
|
||||
$itemName = h($itemNameRaw);
|
||||
$itemPrice = h($item['price']);
|
||||
$itemCat = h($item['category_id'] ?? '');
|
||||
$imageUrl = !empty($item['image_url']) ? h($item['image_url']) : '';
|
||||
@ -431,7 +437,7 @@ require __DIR__ . '/includes/header.php';
|
||||
$isRecentlyAdded = $createdAtStamp && $createdAtStamp >= strtotime('-7 days');
|
||||
$createdLabel = $createdAtStamp ? date('Y-m-d', $createdAtStamp) : '';
|
||||
?>
|
||||
<div class="product-card" data-sku="<?= $itemSku ?>" data-name="<?= $itemName ?>" data-price="<?= $itemPrice ?>" data-cat="<?= $itemCat ?>" data-search="<?= h(mb_strtolower($itemName . ' ' . $sku)) ?>" data-created="<?= h($createdAtRaw) ?>" onclick="addToCart('<?= $itemSku ?>')">
|
||||
<div class="product-card" data-sku="<?= $itemSku ?>" data-name="<?= $itemName ?>" data-price="<?= $itemPrice ?>" data-cat="<?= $itemCat ?>" data-search="<?= h($searchText) ?>" data-created="<?= h($createdAtRaw) ?>" onclick="addToCart('<?= $itemSku ?>')">
|
||||
<div class="product-img-wrapper">
|
||||
<?php if (!empty($imageUrl)):
|
||||
$imgAlt = h(tr('صورة المنتج', 'Product Image'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user