26
26
27
27
<body>
28
28
<nav class="container">
29
-
30
29
<header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3">
31
30
<div class="col-md-3 mb-2 mb-md-0">
32
31
<a href="/" class="d-inline-flex link-body-emphasis text-decoration-none">
33
32
<img class="logo-img" src="/assets/shopping-cart_market-place.png">
34
33
</a>
35
34
</div>
36
35
37
-
38
36
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
39
37
<li><a href="/" class="nav-link px-2 link-secondary">Home</a></li>
40
38
<li><a href="/service-centre-landing" class="nav-link px-2">Service Centre</a></li>
41
- <!-- <li><a href="#" class="nav-link px-2">FAQs</a></li>-->
42
39
<li><a href="/about-us" class="nav-link px-2">About</a></li>
43
- <li><a href="# " class="nav-link px-2">
40
+ <li><a href="/view-cart " class="nav-link px-2">
44
41
<ion-icon name="cart-outline"></ion-icon>
45
42
</a></li>
46
43
</ul>
47
44
48
- <!-- --><?php //if (Application::isGuestTechnician()): ?>
49
- <!-- <div class="col-md-3 text-center">-->
50
- <!-- <button type="button" class="btn btn-outline-primary me-2"><a class="text-decoration-none"-->
51
- <!-- href="/select-user-login">Login</a>-->
52
- <!-- </button>-->
53
- <!-- <button type="button" class="btn btn-primary"><a class="text-decoration-none"-->
54
- <!-- href="/select-user-sign-up">Sign Up</a></button>-->
55
- <!-- </div>-->
56
- <!-- --><?php //else: ?>
57
- <!-- <div class="col-md-3 text-center">-->
58
- <!---->
59
- <!-- </div>-->
60
- <!-- --><?php //endif; ?>
61
45
<form class="search-bar">
62
46
<input class="search-bar-enter" type="search" placeholder="Search" aria-label="Search">
63
47
<button class="btn" type="submit">Search</button>
64
48
</form>
49
+ <h6>
50
+ <?php
51
+
52
+ $ username = strtoupper (Application::$ app ->customer ->{'name ' });
53
+
54
+ if ($ username ) {
55
+ echo $ username ;
56
+ } else {
57
+ echo '<button class="btn" onclick="window.location.href= \'/customer-login \'" style="margin-right:20px;">Login</button> ' ;
58
+ }
59
+
60
+ ?>
61
+ </h6>
65
62
</header>
66
63
</nav>
67
64
75
72
</div>
76
73
</section>
77
74
78
-
79
- <section class="marketplace">
80
- <h1 class="marketplace-title">Available Products</h1>
81
- <div class="products-grid">
82
- <?php if (!empty ($ products )): ?>
83
- <?php foreach ($ products as $ product ): ?>
84
- <div class="product-card">
85
- <img class="product-image"
86
- src="/assets/uploads/<?php echo htmlspecialchars ($ product ['media ' ]); ?> "
87
- alt="Product Image">
88
- <div class="product-details">
89
- <h2 class="product-title"><?php echo htmlspecialchars ($ product ['description ' ]); ?> </h2>
90
- <p class="product-price">Rs. <?php echo htmlspecialchars ($ product ['price ' ]); ?> </p>
91
- <p class="product-seller">Sold by: <?php echo htmlspecialchars ($ product ['seller_name ' ]); ?> </p>
92
- </div>
93
- <a href="/check-out-page" class="product-btn">View Details</a>
75
+ <!-- Main Content with Sidebar -->
76
+ <section class="marketplace-container">
77
+ <!-- Categories Sidebar -->
78
+ <aside class="categories-sidebar">
79
+ <h3 class="categories-title">Product Categories</h3>
80
+ <ul class="categories-list">
81
+ <li><a href="/get-product-by-category?category=all" class="category-link" data-category="all" >All</a></li>
82
+ <li><a href="/get-product-by-category?category=tools" class="category-link" data-category="tools" >Tools</a></li>
83
+ <li><a href="/get-product-by-category?category=engine-transmission" class="category-link" data-category="engine-transmission" >Engine & Transmission</a></li>
84
+ <li><a href="/get-product-by-category?category=brakes-suspension" class="category-link" data-category="brakes-suspension" >Brakes & Suspension</a></li>
85
+ <li><a href="/get-product-by-category?category=electrical-electronics" class="category-link" data-category="electrical-electronics" >Electrical & Electronics</a></li>
86
+ <li><a href="/get-product-by-category?category=body-parts-exterior" class="category-link" data-category="body-parts-exterior" >Body Parts & Exterior</a></li>
87
+ <li><a href="/get-product-by-category?category=tires-wheels" class="category-link" data-category="tires-wheels" >Tires & Wheels</a></li>
88
+ <li><a href="/get-product-by-category?category=interior-accessories" class="category-link" data-category="interior-accessories" >Interior Accessories</a></li>
89
+ <li><a href="/get-product-by-category?category=fluids-maintenance" class="category-link" data-category="fluids-maintenance" >Fluids & Maintenance</a></li>
90
+ <li><a href="/get-product-by-category?category=performance-upgrades" class="category-link" data-category="performance-upgrades" >Performance & Upgrades</a></li>
91
+ <li><a href="/get-product-by-category?category=safety-security" class="category-link" data-category="safety-security" >Safety & Security</a></li>
92
+ </ul>
93
+ </aside>
94
+
95
+ <!-- Marketplace Products Section -->
96
+ <div class="marketplace">
97
+ <h1 class="marketplace-title">Available Products</h1>
98
+ <div class="products-grid">
99
+ <?php if (!empty ($ products )): ?>
100
+ <?php foreach ($ products as $ product ): ?>
101
+ <div class="product-card">
102
+ <img class="product-image"
103
+ src="/assets/uploads/<?php echo htmlspecialchars ($ product ['media ' ]); ?> "
104
+ alt="Product Image">
105
+ <div class="product-details">
106
+ <h2 class="product-title"><?php echo htmlspecialchars ($ product ['description ' ]); ?> </h2>
107
+ <p class="product-price">Rs. <?php echo htmlspecialchars ($ product ['price ' ]); ?> </p>
108
+ <p class="product-seller">Sold by: <?php echo htmlspecialchars ($ product ['seller_name ' ]); ?> </p>
109
+ <p>Product id: <?php echo htmlspecialchars ($ product ['product_id ' ]) ?> </p>
110
+ </div>
111
+ <!-- <a href="/check-out-page" class="product-btn">View Details</a> -->
112
+ <!-- <button class="add-to-cart-btn" data-product-id="<?php echo $ product ['product_id ' ]; ?> ">Add to Cart</button> -->
113
+ <form action="/add-to-cart" method="post">
114
+ <input type="hidden" name="product_id" value="<?php echo $ product ['product_id ' ]; ?> ">
115
+ <button class="btn" style="color:black;" type="submit">Add to cart</button>
116
+ </form>
94
117
</div>
95
118
<?php endforeach ; ?>
96
119
<?php else : ?>
97
- <p class="no-products">No products are available at the moment .</p>
120
+ <p class="no-products">No products are available in this category .</p>
98
121
<?php endif ; ?>
99
122
</div>
123
+ </div>
100
124
</section>
101
125
102
-
126
+ <!-- Footer -->
103
127
<div class="container-f">
104
128
<footer class="py-5">
105
129
<div class="row">
110
134
<h5>Company</h5>
111
135
<ul class="nav-f flex-column">
112
136
<li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">About Us</a></li>
113
- <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Our Offerings</a>
114
- </li>
137
+ <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Our Offerings</a></li>
115
138
</ul>
116
139
</div>
117
140
118
141
<div class="col-6 col-md-2 mb-3">
119
142
<h5>Products</h5>
120
143
<ul class="nav flex-column">
121
- <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Nearby
122
- Technicians</a></li>
123
- <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Service
124
- Centers</a></li>
125
- <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Service Center
126
- Marketplace</a></li>
144
+ <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Nearby Technicians</a></li>
145
+ <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Service Centers</a></li>
146
+ <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Service Center Marketplace</a></li>
127
147
</ul>
128
148
</div>
129
149
130
150
<div class="col-6 col-md-2 mb-3">
131
151
<h5>Safety Measures</h5>
132
152
<ul class="nav flex-column">
133
153
<li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Safety</a></li>
134
- <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Diversity and
135
- Inclusion</a></li>
154
+ <li class="nav-item-f mb-2"><a href="#" class="nav-link-f p-0 text-body-secondary">Diversity and Inclusion</a></li>
136
155
</ul>
137
156
</div>
138
-
139
157
</div>
140
158
141
159
<div class="d-flex flex-column flex-sm-row justify-content-between py-4 my-4 mx-4 border-top">
142
160
<p>© 2024 Fixme Technologies Inc.</p>
143
161
<ul class="list-unstyled d-flex">
144
162
<li class="ms-3"><a class="link-body-emphasis" href="#">
145
163
<svg class="bi" width="24" height="24">
146
- <path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.284-.009-.425A6.683 6.683 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518A3.301 3.301 0 0 0 15.555 2a6.533 6.533 0 0 1-2.084.797 3.301 3.301 0 0 0-5.617 3.005A9.355 9.355 0 0 1 1.114 2.1a3.3 3.3 0 0 0 1.019 4.396A3.267 3.267 0 0 1 .64 6.575v.034a3.301 3.301 0 0 0 2.644 3.234 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.621-.059 3.305 3.305 0 0 0 3.067 2.281A6.588 6.588 0 0 1 0 13.027 9.286 9.286 0 0 0 5.031 15z"/>
147
164
<use xlink:href="#twitter"></use>
148
165
</svg>
149
166
</a></li>
150
167
<li class="ms-3"><a class="link-body-emphasis" href="#">
151
168
<svg class="bi" width="24" height="24">
152
- <path d="M8 0C5.79 0 5.555.01 4.69.047a6.153 6.153 0 0 0-2.292.431 4.383 4.383 0 0 0-1.633 1.064A4.394 4.394 0 0 0 .048 4.69 6.154 6.154 0 0 0 0 6.977C0 7.445.002 7.805.005 8.128L.02 9.81v1.154c.003.352.006.729.006 1.104 0 .375-.003.752-.006 1.104v1.154c-.003.326-.005.687-.005 1.155 0 .642.027 1.192.125 1.684.099.492.264.939.518 1.33.22.333.514.616.87.857.33.226.706.41 1.12.556.466.166 1.065.239 1.747.263C5.805 16 6.287 16 8 16c1.713 0 2.195-.002 2.74-.014.682-.024 1.28-.097 1.746-.263a4.432 4.432 0 0 0 1.12-.556c.357-.241.65-.524.87-.857.253-.391.419-.838.518-1.33.098-.492.125-1.042.125-1.684 0-.469-.002-.83-.005-1.155v-1.154c-.003-.352-.006-.729-.006-1.104 0-.375.003-.752.006-1.104V9.81l.015-1.683c.003-.326.005-.687.005-1.155 0-.642-.027-1.192-.125-1.684a4.406 4.406 0 0 0-.518-1.33c-.22-.333-.514-.616-.87-.857a4.438 4.438 0 0 0-1.12-.556 6.163 6.163 0 0 0-1.746-.263C10.195.003 9.713.001 8 .001zm0 1.557c1.65 0 1.914.007 2.586.036.589.026 1.021.102 1.344.231.408.17.706.375.956.624.249.249.453.548.624.956.129.323.205.755.231 1.344.03.672.037.936.037 2.586 0 1.65-.007 1.914-.036 2.586-.026.589-.102 1.021-.231 1.344a2.764 2.764 0 0 1-.624.956 2.784 2.784 0 0 1-.956.624c-.323.129-.755.205-1.344.231-.672.03-.936.037-2.586.037-1.65 0-1.914-.007-2.586-.036-.589-.026-1.021-.102-1.344-.231a2.77 2.77 0 0 1-.956-.624 2.786 2.786 0 0 1-.624-.956c-.129-.323-.205-.755-.231-1.344-.03-.672-.037-.936-.037-2.586 0-1.65.007-1.914.036-2.586.026-.589.102-1.021.231-1.344.17-.408.375-.706.624-.956.249-.249.548-.453.956-.624.323-.129.755-.205 1.344-.231.672-.03.936-.037 2.586-.037zM8 3.292a4.706 4.706 0 1 0 0 9.411 4.706 4.706 0 0 0 0-9.411zm0 1.55a3.156 3.156 0 1 1 0 6.311 3.156 3.156 0 0 1 0-6.311zm4.566-.855a1.088 1.088 0 1 0 0 2.176 1.088 1.088 0 0 0 0-2.176z"/>
153
169
<use xlink:href="#instagram"></use>
154
170
</svg>
155
171
</a></li>
156
172
<li class="ms-3"><a class="link-body-emphasis" href="#">
157
173
<svg class="bi" width="24" height="24">
158
- <path d="M8 0C3.582 0 0 3.582 0 8c0 4.07 3.065 7.428 7.032 7.931V10.14H5.037V8h1.995V6.392c0-1.973 1.21-3.05 2.963-3.05.84 0 1.562.063 1.77.09v2.053h-1.215c-.952 0-1.137.451-1.137 1.113V8h2.273l-.296 2.14H9.413v5.79C13.35 15.428 16 12.07 16 8c0-4.418-3.582-8-8-8z"/>
159
174
<use xlink:href="#facebook"></use>
160
175
</svg>
161
176
</a></li>
162
177
</ul>
163
178
</div>
164
179
</footer>
165
180
</div>
166
- </body>
181
+
182
+ <!-- <script src="/js/service-center/filterProducts.js"></script> -->
183
+ <!-- <script>
184
+ document.addEventListener("DOMContentLoaded", function () {
185
+ document.querySelectorAll(".category-link").forEach(link => {
186
+ link.addEventListener("click", function (event) {
187
+ event.preventDefault(); // Prevent default anchor behavior
188
+
189
+ let category = this.getAttribute("data-category");
190
+
191
+ // Send an AJAX request to fetch filtered products
192
+ fetch(`/get-product-by-category?category=${category}`, {
193
+ method: "GET",
194
+ headers: {
195
+ "X-Requested-With": "XMLHttpRequest"
196
+ }
197
+ })
198
+ .then(response => response.text())
199
+ .then(data => {
200
+ document.getElementById("product-list").innerHTML = data; // Update the product list
201
+ })
202
+ .catch(error => console.error("Error:", error));
203
+ });
204
+ });
205
+ });
206
+ </script> -->
207
+
208
+ <script src="/js/service-center/cart.js"></script>
209
+
210
+ </body>
211
+ </html>
0 commit comments