-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
128 lines (93 loc) · 3.88 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
session_start();
require("inc/settings.php");
require("inc/staticpages.php");
require("inc/dynamicpages.php");
require("inc/system_functions.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Listing</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/alpine.min.js" defer></script>
<link href="css/output.css" rel="stylesheet">
</head>
<!--nav star-->
<?php userMyNav() ?>
<?php myoffer() ?>
<?php indexheader() ?>
<?php showProducts() ?>
<!--nav end-->
<body class="bg-light">
<script>
document.addEventListener('DOMContentLoaded', function () {
const tabLinks = document.querySelectorAll('.louaycateg'); // Replace with your actual class
const productDivs = document.querySelectorAll('.louayprod'); // Replace with your actual class
function handleTabClick(event) {
event.preventDefault();
// Get the data-category-id attribute of the clicked element
const categoryId = event.currentTarget.getAttribute('data-category-id');
// Show/hide products based on the clicked category
productDivs.forEach(div => {
const productCategoryId = div.getAttribute('data-category-id');
if (productCategoryId === categoryId || categoryId === 'all') {
div.style.display = 'block';
} else {
div.style.display = 'none';
}
});
}
// Attach the click event listener to each tab link
tabLinks.forEach(link => {
link.addEventListener('click', handleTabClick);
});
});
</script>
<!-- ... (Previous HTML code) ... -->
<script>
document.addEventListener('DOMContentLoaded', function () {
// Mobile menu button
const mobileMenuButton = document.getElementById('mobile-menu-button');
// Mobile menu
const mobileMenu = document.getElementById('mobile-menu');
// Toggle mobile menu visibility
mobileMenuButton.addEventListener('click', function () {
if (mobileMenu) {
mobileMenu.classList.toggle('hidden');
}
});
// Profile dropdown button
const userMenuButton = document.getElementById('user-menu-button');
// Profile dropdown menu
const userMenu = document.getElementById('user-menu');
// Toggle profile dropdown menu visibility
userMenuButton.addEventListener('click', function () {
if (userMenu) {
userMenu.classList.toggle('hidden');
}
});
// Close the mobile menu and profile dropdown when clicking outside
document.addEventListener('click', function (event) {
if (mobileMenu && !mobileMenu.contains(event.target) && !mobileMenuButton.contains(event.target)) {
mobileMenu.classList.add('hidden');
}
if (userMenu && !userMenu.contains(event.target) && !userMenuButton.contains(event.target)) {
userMenu.classList.add('hidden');
}
});
});
</script>
<!-- ... (Remaining HTML code) ... -->
<script src="https://unpkg.com/[email protected]/dist/flowbite.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/alpine.min.js" defer></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>