Files
SkyArtShop/website/admin/products.html
Local Server 61929a5daf updateweb
2025-12-14 01:54:40 -06:00

258 lines
7.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Products Management - Sky Art Shop</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
/>
<link rel="stylesheet" href="/admin/css/admin-style.css" />
</head>
<body>
<!-- Sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-brand">🛍️ Sky Art Shop</div>
<ul class="sidebar-menu">
<li>
<a href="/admin/dashboard.html"
><i class="bi bi-speedometer2"></i> Dashboard</a
>
</li>
<li>
<a href="/admin/homepage.html"
><i class="bi bi-house"></i> Homepage Editor</a
>
</li>
<li>
<a href="/admin/products.html" class="active"
><i class="bi bi-box"></i> Products</a
>
</li>
<li>
<a href="/admin/portfolio.html"
><i class="bi bi-easel"></i> Portfolio</a
>
</li>
<li>
<a href="/admin/blog.html"><i class="bi bi-newspaper"></i> Blog</a>
</li>
<li>
<a href="/admin/pages.html"
><i class="bi bi-file-text"></i> Custom Pages</a
>
</li>
<li>
<a href="/admin/media-library.html"
><i class="bi bi-images"></i> Media Library</a
>
</li>
<li>
<a href="/admin/menu.html"><i class="bi bi-list"></i> Menu</a>
</li>
<li>
<a href="/admin/settings.html"><i class="bi bi-gear"></i> Settings</a>
</li>
<li>
<a href="/admin/users.html"><i class="bi bi-people"></i> Users</a>
</li>
</ul>
</div>
<!-- Main Content -->
<div class="main-content">
<!-- Top Bar -->
<div class="top-bar">
<div>
<h3>Products Management</h3>
<p class="mb-0 text-muted">Manage your product catalog</p>
</div>
<div>
<button class="btn-logout" onclick="logout()">
<i class="bi bi-box-arrow-right"></i> Logout
</button>
</div>
</div>
<!-- Actions Bar -->
<div class="actions-bar">
<button class="btn btn-primary" onclick="showCreateProduct()">
<i class="bi bi-plus-circle"></i> Add New Product
</button>
<div class="search-box">
<i class="bi bi-search"></i>
<input
type="text"
placeholder="Search products..."
id="searchInput"
oninput="filterProducts()"
/>
</div>
</div>
<!-- Products Table -->
<div class="card">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Product Name</th>
<th>Price</th>
<th>Stock</th>
<th>Status</th>
<th>Best Seller</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="productsTableBody">
<tr>
<td colspan="8" class="text-center">
<div class="loading-spinner"></div>
Loading products...
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Create/Edit Product Modal -->
<div class="modal fade" id="productModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalTitle">Add New Product</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
></button>
</div>
<div class="modal-body">
<form id="productForm">
<input type="hidden" id="productId" />
<div class="mb-3">
<label for="productName" class="form-label"
>Product Name *</label
>
<input
type="text"
class="form-control"
id="productName"
required
/>
</div>
<div class="mb-3">
<label for="productDescription" class="form-label"
>Description</label
>
<textarea
class="form-control"
id="productDescription"
rows="4"
></textarea>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label for="productPrice" class="form-label">Price *</label>
<input
type="number"
step="0.01"
class="form-control"
id="productPrice"
required
/>
</div>
<div class="col-md-6 mb-3">
<label for="productStock" class="form-label"
>Stock Quantity</label
>
<input type="number" class="form-control" id="productStock" />
</div>
</div>
<div class="mb-3">
<label for="productCategory" class="form-label">Category</label>
<input type="text" class="form-control" id="productCategory" />
</div>
<div class="mb-3">
<label for="productImages" class="form-label"
>Product Images</label
>
<input
type="file"
class="form-control"
id="productImages"
multiple
accept="image/*"
/>
<small class="text-muted">You can upload multiple images</small>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="productActive"
checked
/>
<label class="form-check-label" for="productActive">
Active (Visible on website)
</label>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="productBestSeller"
/>
<label class="form-check-label" for="productBestSeller">
Mark as Best Seller
</label>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-bs-dismiss="modal"
>
Cancel
</button>
<button
type="button"
class="btn btn-primary"
onclick="saveProduct()"
>
<i class="bi bi-save"></i> Save & Publish
</button>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="/admin/js/auth.js"></script>
<script src="/admin/js/products.js"></script>
</body>
</html>