<?php 
error_reporting(0);
include("header.php"); 
?>


<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style>
.mySlides {display:none;}
</style>

 
		
		<div class="w3-content w3-section" style="max-width:100%;">
		<?php 
								$metabanner="select * from banner order by id ASC";
    if(!($resultbn=mysql_query($metabanner))){echo mysql_error($metabanner); exit;}
    while($rowban=mysql_fetch_assoc($resultbn)){?>
  <img class="mySlides" src="<?php echo "admin/".$uploadpath.$rowban['bphoto']; ?>" style="width:100%">
  
  <?php } ?>
</div>
        <!--// Heroslider Area -->

<script>
var myIndex = 0;
carousel();

function carousel() {
  var i;
  var x = document.getElementsByClassName("mySlides");
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";  
  }
  myIndex++;
  if (myIndex > x.length) {myIndex = 1}    
  x[myIndex-1].style.display = "block";  
  setTimeout(carousel, 4000); // Change image every 2 seconds
}
</script>

        <!-- Page Content -->
        <main class="page-content">

           

<br>
            <!-- Banners Area -->
            <div class="tm-section tm-banners-area">
                <div class="container">
				<div class="row justify-content-center">
                        <div class="col-lg-6 col-12">
                            <div class="tm-sectiontitle text-center">
                                <h3>POPULAR CATEGORY</h3>
                                <p>Our popular category are so beautyful to see that the shoppers are easily attracted
                                    to them. </p>
                            </div>
                        </div>
                    </div>
                   <div class="row mt-30-reverse">
    <?php
    $query1 = "SELECT * FROM topcategories ORDER BY id ASC";
    $result1 = mysql_query($query1);

    if (!$result1) {
        echo mysql_error($query1);
        exit;
    }

    while ($rowbncat = mysql_fetch_assoc($result1)) {
        $categoryName = $rowbncat['catname'];
        $categoryImage = "admin/" . $uploadpath . $rowbncat['cimg'];
        $categoryLink = "more-category-products.php?id=" . strtolower(str_replace(' ', '+', $categoryName));
    ?>
        <!-- Single Banner -->
        <div class="col-lg-4 col-md-6 col-sm-6 col-12 mt-30 text-center">
            <h4 class="category-title"><?php echo $categoryName; ?></h4>
            <a href="<?php echo $categoryLink; ?>" class="tm-banner tm-scrollanim">
                <img src="<?php echo $categoryImage; ?>" alt="<?php echo $categoryName; ?>" class="img-fluid" style="border-bottom:6px solid #000;box-shadow:0 4px 10px 0 rgba(0,0,0,0.3);height: 160px; width:160px; border-radius:50%;">
            </a>
        </div>
        <!--// Single Banner -->
    <?php } ?>
</div>

                </div>
            </div>
            <!--// Banners Area -->

          
<br><br>
<?php
			$superproduct=sprintf("select * from products ORDER BY RAND() limit 1");
			if(!($resultsp = mysql_query($superproduct))){echo $superproduct."Error".mysql_error(); exit;}
			$rowsp=mysql_fetch_array($resultsp); ?>
            <!-- Offer Area -->
            <div class="tm-section tm-offer-area tm-padding-section bg-grey">
                <div class="container">
                    <div class="row align-items-center">
                        <div class="col-lg-6 col-12 order-2 order-lg-1">
                            <div class="tm-offer-content">
                                <h6>Super deal of the Month</h6>
                                <h1><?php echo $rowsp[proname];?></h1>
								 <p><?php echo $rowsp[catid];?></p>
                                <!--<div class="tm-countdown" data-countdown="2020/10/12"></div>-->
                                <a href="product-details.php?id=<?php echo $rowsp[id];?>&cname=<?php echo $rowsp[catid];?>" class="tm-button">Enquiry now</a>
                            </div>
                        </div>
                        <div class="col-lg-6 col-12 order-1 order-lg-2">
                            <div class="tm-offer-image">
                          
								<img src="<?php echo "admin/".$uploadpath.$rowsp['proimg']; ?>" alt="" style="height:280px;width:260px;" class="tm-offer">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--// Offer Area -->

            <!-- Popular Products Area -->
            <div id="tm-popular-products-area" class="tm-section tm-popular-products-area tm-padding-section bg-white">
                <div class="container">
                    <div class="row justify-content-center">
                        <div class="col-lg-6 col-12">
                            <div class="tm-sectiontitle text-center">
                                <h3>POPULAR PRODUCTS</h3>
                                <p>Our popular products are so beautyful to see that the shoppers are easily attracted
                                    to them. </p>
                            </div>
                        </div>
                    </div>
                    <div class="row tm-products-slider">
<?php
									$queryPopular=sprintf("select * from products ORDER BY RAND()");
			if(!($resultPopular = mysql_query($queryPopular))){echo $queryPopular."Error".mysql_error(); exit;}
			while($rowfetchPopular=mysql_fetch_array($resultPopular)) { ?>
                        <!-- Single Product -->
                        <div class="col-lg-3 col-md-4 col-sm-6 col-12">
                            <div class="tm-product tm-scrollanim" >
                                <div class="tm-product-topside">
									
                                    <div class="tm-product-images">
									
                                       <a href="product-details.php?id=<?php echo $rowfetchPopular[id];?>&cname=<?php echo $rowfetchPopular[catid];?>">  <img src="<?php echo "admin/".$uploadpath.$rowfetchPopular['proimg']; ?>" style="height:200px;width:180px;">
                                    </a>
									</div>
                                  
                                </div>
                                
                            </div>
                        </div>
                        <!--// Single Product -->
			<?php } ?>
                       


                    </div>
                </div>
            </div>
            <!--// Popular Products Area -->
       <marquee class="news-scroll" style="background-color:#f1f7f5;" scrollamount="4"  behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();"> 
				<b>Today Rates:	</b>&nbsp;&nbsp; &nbsp; 
									<?php 
	$r="select * from  livegoldrate order by id ASC	";
    if(!($r4=mysql_query($r))){echo mysql_error($r); exit;}
  while($rowgold=mysql_fetch_assoc($r4)){?>
				<span class="dot"></span> <a href="#"><b><?php echo $rowgold[particulars];?> - Rs. <?php echo $rowgold[todayrate];?></b> </a>
				
				&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  
				<?php } ?>
				<span class="dot"></span> <a href="#">  <small>The above gold rates are indicative and do not include GST, TCS and other levies. For the exact rates contact your local jeweller. </small></a>
				</marquee>

            <!-- Brand Logos -->
            <div class="tm-section tm-brandlogo-area tm-padding-section">
                <div class="container">
                    <div class="row tm-brandlogo-slider">
<?php 
	$meta="select * from  umteam order by id ASC	";
    if(!($r4r=mysql_query($meta))){echo mysql_error($meta); exit;}
  while($galdata=mysql_fetch_assoc($r4r)){?>
                        <!-- Brang Logo Single -->
                        <div class="col-12 tm-brandlogo">
                            <a href="#">
                               
								<img src="<?php echo "admin/".$uploadpath.$galdata['photo']; ?>" alt="" style="height:200px;" class="tm-offer">
                            </a>
                        </div>
                        <!--// Brang Logo Single -->

  <?php } ?>

                    </div>
                </div>
            </div>
            <!--// Brand Logos -->
  <!-- Popular Products Area -->
            <div id="tm-popular-products-area" class="tm-section tm-popular-products-area tm-padding-section bg-white">
                <div class="container">
                    <div class="row justify-content-center">
                        <div class="col-lg-6 col-12">
                            <div class="tm-sectiontitle text-center">
                                <h3>Client Review</h3>
                               
                            </div>
                        </div>
                    </div>
                    <div class="row tm-products-slider">
<?php
				$queryREview=sprintf("select * from umreview ORDER BY RAND()");
			if(!($resultReviewdata = mysql_query($queryREview))){echo $queryREview."Error".mysql_error(); exit;}
			while($datareview=mysql_fetch_array($resultReviewdata)) { ?>
                        <!-- Single Product -->
                        <div class="col-lg-3 col-md-4 col-sm-6 col-12">
                            <div class="tm-product tm-scrollanim" >
                                <div class="tm-product-topside">
									
                                    <div class="tm-product-images">
									
                                      <center><img src="<?php echo "admin/".$uploadpath.$datareview['cphoto']; ?>" style="height:60px;width:60px;border-radius:50%;">
                                      <?php echo $datareview['review']; ?><br> <b> - <?php echo $datareview['cname']; ?> </b></center>
									</div>
                                  
                                </div>
                                
                            </div>
                        </div>
                        <!--// Single Product -->
			<?php } ?>
                       


                    </div>
                </div>
            </div>
        </main>
        <!--// Page Content -->
<?php include("footer.php");?>