Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
palaniapp_demo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hussain Mohamed
palaniapp_demo
Commits
4c4e5f7c
Commit
4c4e5f7c
authored
Dec 31, 2025
by
Hussain Mohamed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
1ba39d4d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
166 additions
and
50 deletions
+166
-50
FrontendController.php
app/Http/Controllers/FrontendController.php
+42
-0
ProductModel.php
app/Models/ProductModel.php
+6
-0
main.css
public/assets/css/main.css
+34
-6
ajax_products.blade.php
resources/views/ajax_products.blade.php
+5
-1
product_detail.blade.php
resources/views/product_detail.blade.php
+27
-0
products.blade.php
resources/views/products.blade.php
+51
-43
web.php
routes/web.php
+1
-0
No files found.
app/Http/Controllers/FrontendController.php
View file @
4c4e5f7c
...
...
@@ -4,9 +4,11 @@
use
App\Http\Controllers\Controller
;
use
App\Models\BrandProduct
;
use
App\Models\Country
;
use
App\Models\Currency
;
use
App\Models\DistanceRequest
;
use
App\Models\IndustryProduct
;
use
App\Models\WebRequestModel
;
use
App\Models\LanguageModel
;
use
App\Models\ManageRequestModel
;
...
...
@@ -20,9 +22,13 @@
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
App\Models\Settings
;
use
App\Models\SizeModel
;
use
App\Models\SizeProduct
;
use
App\Models\SliderModel
;
use
Google\Service\AdExchangeBuyer\Product
;
use
Illuminate\Support\Facades\Crypt
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Str
;
class
FrontendController
extends
Controller
{
...
...
@@ -47,6 +53,42 @@ public function products()
return
view
(
'products'
,
compact
(
'productType'
,
'brandData'
,
'industryData'
));
}
public
function
getProduct
(
$name
=
''
)
{
$product
=
ProductModel
::
Where
(
'product_slug'
,
$name
)
->
first
();
$id
=
isset
(
$product
->
id
)
?
$product
->
id
:
0
;
if
(
$id
!=
''
)
{
$brands
=
BrandProduct
::
from
(
'product_brand as pb'
)
->
leftJoin
(
'brand as b'
,
'b.id'
,
'='
,
'pb.brand_id'
)
->
where
(
'pb.product_id'
,
$id
)
->
select
(
'b.brand'
,
'b.id'
)
->
get
();
$industrys
=
IndustryProduct
::
from
(
'product_industry as pb'
)
->
leftJoin
(
'industry as b'
,
'b.id'
,
'='
,
'pb.industry_id'
)
->
where
(
'pb.product_id'
,
$id
)
->
select
(
'b.industry'
,
'b.id'
)
->
get
();
$size
=
SizeProduct
::
from
(
'product_size as pb'
)
->
leftJoin
(
'size as b'
,
'b.id'
,
'='
,
'pb.size_id'
)
->
where
(
'pb.product_id'
,
$id
)
->
select
(
'b.size'
,
'b.id'
)
->
get
();
return
view
(
'product_detail'
,
compact
(
'product'
,
'size'
,
'industrys'
,
'brands'
));
}
// $records = ProductModel::get();
// foreach($records as $row)
// {
// ProductModel::Where('id',$row->id)->update(array('product_slug'=>Str::slug($row->product_name)));
// }
}
public
function
getAjaxProducts
(
Request
$request
)
{
$offset
=
$request
->
get
(
'offset'
,
0
);
...
...
app/Models/ProductModel.php
View file @
4c4e5f7c
...
...
@@ -17,5 +17,11 @@ public function category()
}
// public function brand()
// {
// return $this->belongsToMany(ProductBrandModel::class,'product_brand','product_id', 'brand_id');
// }
}
public/assets/css/main.css
View file @
4c4e5f7c
...
...
@@ -5262,16 +5262,22 @@ section,
color
:
#333
;
}
.filter-accordion
.accordion-body
div
.active
{
font-weight
:
600
;
color
:
#fff
;
background
:
#024959
;
text-align
:
center
;
.filter-accordion
.accordion-body
div
.active
{
color
:
#282828
;
background
:
#eeeeee
;
margin-right
:
5px
;
border-radius
:
12px
;
font-weight
:
400
;
width
:
60%
;
}
#brand
.accordion-body
{
#brand
.accordion-body
{
max-height
:
250px
;
overflow-y
:
auto
;
}
#industry
.accordion-body
{
max-height
:
250px
;
overflow-y
:
auto
;
}
...
...
@@ -5309,6 +5315,19 @@ h2.htwo {
animation
:
dotPulse
.65s
0s
infinite
cubic-bezier
(
.21
,
.53
,
.56
,
.8
);
}
/* Infinite Scrolling */
.et-loader
{
position
:
relative
;
padding-bottom
:
30px
;
margin-bottom
:
30px
;
}
.et-loader
:after
{
top
:
auto
;
bottom
:
0
;
}
@keyframes
dotPulse
{
0
%
{
-webkit-transform
:
scale
(
.1
);
...
...
@@ -5329,3 +5348,11 @@ h2.htwo {
transform
:
scale
(
1.2
);
opacity
:
0
}
}
.plink
{
color
:
#282828
;
font-size
:
14px
;
;
}
.plink
:hover
{
color
:
#282828
;
}
\ No newline at end of file
resources/views/ajax_products.blade.php
View file @
4c4e5f7c
<?php
use
Illuminate\Support\Str
;
if
(
isset
(
$records
))
{
foreach
(
$records
as
$key
=>
$row
)
{
?>
<div
class=
"col-lg-4 col-md-6 col-sm-12"
>
<div
class=
"product-card text-center"
>
<
a
class=
"plink"
href=
"
<?=
route
(
'products'
,[
Str
::
slug
(
$row
->
product_name
)])
?>
"
><
div
class=
"product-card text-center"
>
<img
src=
"
<?=
(
$row
->
product_image
==
''
)
?
asset
(
'assets/img/placeholder.png'
)
:
$row
->
product_image
?>
"
class=
"img-fluid product-img"
alt=
"Product"
>
<h6
class=
"product-title mt-3"
>
<?=
ucwords
(
$row
->
product_name
)
?>
</h6>
</div>
</a>
</div>
<?php
}
}
...
...
resources/views/product_detail.blade.php
0 → 100644
View file @
4c4e5f7c
@
extends
(
'app_layout'
)
@
section
(
'title'
,
'Contact Us'
)
@
section
(
'content'
)
<
main
class
="
main
">
<div class="
page
-
title
">
<div class="
container
">
<div class="
row
g
-
4
">
<h1 class="
hfive
text
-
center
">Products</h1>
<div class="
col
-
lg
-
6
">
</div>
<div class="
col
-
lg
-
6
">
<div class="
container
py
-
4
">
<div class="
row
g
-
4
" id="
productList
">
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
\ No newline at end of file
resources/views/products.blade.php
View file @
4c4e5f7c
...
...
@@ -22,8 +22,8 @@
<div
class=
"accordion-body"
>
<?php
if
(
isset
(
$productType
))
{
foreach
(
$productType
as
$row
)
{
?>
<div>
<?
=
$row
->
type
?>
</div>
<?php
}
<div>
<?
php
echo
$row
->
type
?>
</div>
<?php
}
}
?>
</div>
</div>
...
...
@@ -42,8 +42,8 @@
<div
class=
"accordion-body"
>
<?php
if
(
isset
(
$industryData
))
{
foreach
(
$industryData
as
$row
)
{
?>
<div>
<?
=
$row
->
industry
?>
</div>
<?php
}
<div>
<?
php
echo
$row
->
industry
?>
</div>
<?php
}
}
?>
</div>
</div>
...
...
@@ -62,8 +62,8 @@
<div
class=
"accordion-body"
>
<?php
if
(
isset
(
$brandData
))
{
foreach
(
$brandData
as
$row
)
{
?>
<div>
<?
=
$row
->
brand
?>
</div>
<?php
}
<div>
<?
php
echo
$row
->
brand
?>
</div>
<?php
}
}
?>
</div>
</div>
...
...
@@ -75,14 +75,11 @@
<div
class=
"col-lg-8"
>
<div
class=
"container py-4"
>
<div
class=
"row g-4"
id=
"productList"
>
</div>
<div
class=
"text-center mt-4"
>
<button
id=
"loadMore"
class=
"btn btn-outline-dark"
>
Load More
</button>
<span
id=
"loadMore"
class=
"btn et-loader"
></span>
</div>
</div>
...
...
@@ -106,41 +103,52 @@
let
offset
=
0
;
const
limit
=
6
;
function
loadProducts
(
reset
=
false
)
{
if
(
reset
)
{
offset
=
0
;
$
(
'#productList'
).
html
(
''
);
}
$
.
ajax
({
url
:
'
<?=
route
(
'getProducts'
)
?>
'
,
type
:
'GET'
,
data
:
{
offset
:
offset
,
limit
:
limit
},
success
:
function
(
data
)
{
// if (data.length === 0) {
// $('#loadMore').hide();
// return;
// }
$
(
'#productList'
).
append
(
data
);
offset
+=
limit
;
const
limit
=
6
;
$
(
'#loadMore'
).
hide
();
function
loadProducts
(
reset
=
false
)
{
if
(
reset
)
{
offset
=
0
;
$
(
'#productList'
).
html
(
''
);
}
$
(
'#loadMore'
).
show
();
$
.
ajax
({
url
:
'
<?php
echo
route
(
'getProducts'
)
?>
'
,
type
:
'GET'
,
data
:
{
offset
:
offset
,
limit
:
limit
},
success
:
function
(
data
)
{
// if (data.length === 0) {
// $('#loadMore').hide();
// return;
// }
$
(
'#loadMore'
).
hide
();
$
(
'#productList'
).
append
(
data
);
offset
+=
limit
;
}
});
}
});
}
// Initial Load
loadProducts
();
// Initial Load
loadProducts
();
$
(
window
).
on
(
'scroll'
,
function
()
{
if
(
$
(
window
).
scrollTop
()
+
$
(
window
).
height
()
>=
$
(
document
).
height
()
-
100
)
{
loadProducts
();
}
});
// Load More Click
$
(
'#loadMore'
).
on
(
'click'
,
function
()
{
loadProducts
();
});
// Load More Click
//
$('#loadMore').on('click', function () {
//
loadProducts();
//
});
</script>
...
...
routes/web.php
View file @
4c4e5f7c
...
...
@@ -28,6 +28,7 @@
Route
::
get
(
'about-us'
,
[
FrontendController
::
class
,
'about'
])
->
name
(
'about-us'
);
Route
::
get
(
'career'
,
[
FrontendController
::
class
,
'career'
])
->
name
(
'career'
);
Route
::
get
(
'product'
,
[
FrontendController
::
class
,
'products'
])
->
name
(
'product'
);
Route
::
get
(
'products/{name?}'
,
[
FrontendController
::
class
,
'getProduct'
])
->
name
(
'products'
);
Route
::
match
([
'get'
,
'post'
],
'getProducts'
,
[
FrontendController
::
class
,
'getAjaxProducts'
])
->
name
(
'getProducts'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment