<?php   session_start(); include 'xyz.php';
$urlCategory =$_REQUEST['param'];
$urlCategoryName = $_REQUEST['param2'];
$url_type;
 $rem = str_replace('-',' ',$urlCategoryName);

// echo array_search('WASHING MACHINES',$brand);

if(in_array($rem,$brand)){
		   $index = array_search($rem,$brand);
	$totalItems =QueryDB("SELECT COUNT(*) FROM products where brand='$index' ")->fetchColumn();
	}

if($urlCategory=='product-category'){ //echo str_replace('-',' ',$urlCategoryName);
	$url_type=1;
	if(in_array($rem,$brand)){
		 $index = array_search($rem,$brand);
	$totalItems =QueryDB("SELECT COUNT(*) FROM products where brand='$index' ")->fetchColumn();
	}
	$searchTab ='brand';
}else{
	$url_type=2;
	if(in_array($urlCategoryName,$company)){
		 $index = array_search($urlCategoryName,$company);
	$totalItems =QueryDB("SELECT COUNT(*) FROM products where company='$index' ")->fetchColumn();
	}
	$searchTab ='company';
}

// echo $searchTab;

?>

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
	
	
@media screen and (max-width: 485px) and (min-width: 300px){
	.item{height:250px;}
#largeScreenOnly,#largeScreens,#largeScreens2{ display:none; }
.col3{
	width:200px;float:left;
}
}
@media screen and (max-width: 1600px) and (min-width: 486px){.item{height:350px;}
.hidBig{ display:none; }
#SmallScreenOnly{ display:none; }
}
@media screen and (max-width: 2600px) and (min-width: 1601px){
	.item{height:430px;}
	#SmallScreenOnly{ display:none; }

}

.affix {
    top:0px;
    position: fixed;
   	width: 100%;
	z-index:777;
}
</style>
		<link rel="shortcut icon" type="image/png" href="../../<?php echo $getApp['comp_logo']; ?>">
		<title><?php  echo $getApp['web_title'];  ?></title>
		<link href="https://fonts.googleapis.com/css?family=Montserrat:400,500,700" rel="stylesheet">
		<link type="text/css" rel="stylesheet" href="../../css/bootstrap.min.css"/>
		<!-- Slick -->
		<link type="text/css" rel="stylesheet" href="../../css/slick.css"/>
		<link type="text/css" rel="stylesheet" href="../../css/slick-theme.css"/>
		<!-- nouislider -->
		<link type="text/css" rel="stylesheet" href="../../css/nouislider.min.css"/>
		<!-- Font Awesome Icon -->
		<link rel="stylesheet" href="../../css/font-awesome.min.css">
		<!-- Custom stlylesheet -->
		<link type="text/css" rel="stylesheet" href="../../css/style.css"/>
		<link href="../../lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="../../css/outl_ulib.css">


		

</head>
	<body> 
<header ><div id="header" data-spy="affix" data-offset-top="50" style="background:black;"><div class="container" ><div class="row" >
<div class="col-md-3" id="largeScreenOnly" ><div class="header-logo"><a href="index" class="logo">
<img src="../../<?php  echo $getApp['comp_logo'];  ?>" alt=""></a></div></div> 
<div class="col-md-3 clearfix" ><div class="header-ctn">
<div class="col-md-3" id="SmallScreenOnly"><div class="header-logo"><a href="#" class="logo">
<img src="../../<?php  echo $getApp['comp_logo'];  ?>" alt="" style="width: 100px;"></a></div></div>	
<?php  if(isset($_SESSION['mycus'])){
echo '<div class="dropdown" id="largeScreens"><a class=" dropdown-toggle" data-toggle="dropdown"><i class="fa fa-users"></i> Accounts<span class="caret"></span></a><ul class="dropdown-menu">
<li><a href="../../index"><i class="fa fa-shopping-cart"> <strong>Shop</strong></i></a></li>
<li><a href="../../home"><i class="fa fa-home"> <strong>My Account</strong></i></a></li>
<li><a href="../../logout"><i class="fa fa-sign-out"> <b>logout</b></i></a></li>
</ul></div>';
}else{?>
<div class="dropdown" id="largeScreens"><a class=" dropdown-toggle" data-toggle="dropdown"><i class="fa fa-users"></i> Accounts<span class="caret"></span></a><ul class="dropdown-menu">
<li><a href="#">Login</a></li><li><a href="#">Sign Up</a></li></ul></div> <?php } ?>

<div class="dropdown" id="showcart"></div>



<div class="menu-toggle"><a href="#"><i class="fa fa-bars"></i><span>Menu</span></a></div>					</div></div></div></header>
		
	<!-- NAVIGATION -->
<nav id="navigation" style="background: white;" ><div class="container"><div id="responsive-nav">
<ul class="main-nav nav navbar-nav">
<?php  if(isset($_SESSION['mycus'])){
echo '<li id="SmallScreenOnly" class="dropdown" >&nbsp;&nbsp;&nbsp;
<a class=" dropdown-toggle" data-toggle="dropdown"><i class="fa fa-users"></i> Accounts<span class="caret"></span></a><ul class="dropdown-menu">
<li><a href="../../index" style="color:white"><i class="fa fa-shopping-cart"> <strong>Shop</strong></i></a></li>
<li><a href="../../home" style="color:white"><i class="fa fa-home"> <strong>My Account</strong></i></a></li>
<li><a href="../../logout" style="color:white"><i class="fa fa-sign-out"> <b>logout</b></i></a></li>
</ul>


</li>';
}else {?>
<li><span style="color:white;"><br>&nbsp;&nbsp;&nbsp;<a href="../../login"  style="color:white" class="btn btn-primary">Login</a></span><span >&nbsp;<a href="../../register" style="color:white" class="btn btn-success">Sign Up</a></span></li><?php } ?>
<?php  for($y=0;$y<count($brand);$y++){ if($cat_status[$y]==1){?>
<li><a href="../../product-category/<?php echo str_replace(' ','-',$brand[$y]).'/';  ?> "><?php echo str_replace('-',' ',$brand[$y]); ?></a></li><?php }}?>
<!-- <li>Shopper</li> -->
</ul></div></div></nav>
<!-- /NAVIGATION -->
	



		


<!-- BREADCRUMB -->
		<div id="breadcrumb" class="section" style="background:red;color:White">
			<!-- container -->
			<div class="container">
				<!-- row -->
				<div class="row">
					<div class="col-md-12">
						<ul class="breadcrumb-tree" style="color:white">
		<li><a href="../../index"style="color:white;" >Home</a></li>
							<li style="color:White;"><a href="#" style="color:white;"><?php  echo str_replace('-',' ',$_REQUEST['param']);    ?></a></li>
		<li><a href="#" style="color:white;"><?php  echo str_replace('-',' ',$_REQUEST['param2']);    ?></a></li>
							<li class="active">(<?php echo $totalItems; ?> Results)</li>
						</ul>
					</div>
				</div>
				<!-- /row -->
			</div>
			<!-- /container -->
		</div>
		<!-- /BREADCRUMB -->

		<!-- SECTION -->
		<div class="section">
			<!-- container -->
			<div class="container">
				<!-- row -->
				<div class="row">
					<?php // include 'inc/outl_aside.php';  ?>

					

						<!-- store products -->
						<div class="row">
							<!-- product -->

<?php 

foreach(QueryDB("SELECT * FROM products where $searchTab='$index' and tm_status=1 ")as $listProd){?>
<div class="col-md-3 col-xs-6"><div class="product"><div class="product-img"><img src="<?php echo explode(',', $listProd['item_img'])[0];  ?>" class="img img-responsive img-thumbnail" style=""><div class="product-label"><?php  if($listProd['item_offer']!=0){  echo '<span class="sale">-'.$listProd['item_offer'].'%</span>';  }  ?><span class="new">Original</span></div>
</div><div class="product-body"><p class="product-category"><?php echo $brand[$index]; ?></p>
<h3 class="product-name"><a href="#"><?php  echo $company[$listProd['company']].','.$listProd['item_name'].' '.$brand[$listProd['brand']] ?></a></h3>
<h4 class="product-price">
&#8358;<?php  echo number_format(calcDiscount($listProd['item_cost'],$listProd['item_offer']));   ?>
<?php  if($listProd['item_offer']!=''){?>
	<del class="product-old-price">&#8358;<?php  echo number_format($listProd['item_cost']);  ?></del><?php  } ?></h4>
<div class="product-rating"><i class="fa fa-star"></i><i class="fa fa-star"></i>
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></div>
												<div class="product-btns">
<a href="../../<?php echo getItemLink($listProd['id'],$listProd['item_pid']);  ?>" class="quick-view"><i class="fa fa-eye"></i> View</a>
												</div>
											</div>
<!-- <div class="add-to-cart"><button class="add-to-cart-btn"><i class="fa fa-shopping-cart"></i> add to cart</button></div> -->

</div></div> <?php } ?>


							
						</div>
						<!-- /store products -->

						<!-- store bottom filter -->
					<!-- 	<div class="store-filter clearfix">
							<span class="store-qty">Showing 20-100 products</span>
							<ul class="store-pagination">
								<li class="active">1</li>
								<li><a href="#">2</a></li>
								<li><a href="#">3</a></li>
								<li><a href="#">4</a></li>
								<li><a href="#"><i class="fa fa-angle-right"></i></a></li>
							</ul>
						</div> -->
						<!-- /store bottom filter -->
					</div>
					<!-- /STORE -->
				</div>
				<!-- /row -->
			</div>
			<!-- /container -->
		</div>
		<!-- /SECTION -->





<div class="section"><div class="container"><div class="row">
<div class="col-md-12"><div class="section-title"><h4 class="title">Top Manufacturers</h4>
</div></div>


<?php for($y=0;$y<count($company);$y++){ if($comp_status[$y]!=0){?>

<div class="col-md-3 col3" style="max-height:140px;margin-top:10px;box-shadow: 5px 5px 10px gray;">
<a href="../../products-supplier/<?php echo $company[$y];  ?>/"><img src="<?php echo $compLogo[$y];  ?>" style="width:100%;"></a>
</div>

<?php } } ?></div></div></div>






<?php include 'inc/outl_newsbottom.php'; include 'inc/outl_footer.php'; ?>

		<script src="../../js/jquery.min.js"></script>
		<script src="../../js/bootstrap.min.js"></script>
		<script src="../../lib/easing/easing.min.js"></script>
		<script src="../../lib/owlcarousel/owl.carousel.min.js"></script>
		<script src="../../js/slick.min.js"></script>
		<script src="../../js/nouislider.min.js"></script>
		<script src="../../js/jquery.zoom.min.js"></script>
		<script src="../../js/main.js"></script>
   

<script type="text/javascript">
	// Vendor carousel
    $('.vendor-carousel').owlCarousel({
        loop: true,
        margin: 29,
        nav: false,
        autoplay: true,
        smartSpeed: 1000,
        responsive: {
            0:{
                items:2
            },
            576:{
                items:3
            },
            768:{
                items:4
            },
            992:{
                items:5
            },
            1200:{
                items:6
            }
        }
    });


    // Related carousel
    $('.related-carousel').owlCarousel({
        loop: true,
        margin: 29,
        nav: false,
        autoplay: true,
        smartSpeed: 1000,
        responsive: {
            0:{
                items:1
            },
            576:{
                items:2
            },
            768:{
                items:3
            },
            992:{
                items:4
            }
        }
    });


    $(document).ready(function(){ 
	// bind and scroll header div
	$(window).bind('resize', function(e){
		$(".affix").css('width',$(".container-fluid" ).width());
	});
	$(window).on("scroll", function() {
		$(".affix").css('width',$(".container-fluid" ).width());
	});
});

    interval = 1500;
function get_mprevious_msg(){
 $.ajax({
  type: "GET", url: "../../inc/update_cart_category.php",dataType: "html",
        success: function(response){
       $("#showcart").html(response);
    },
        complete:function(response){ setTimeout(get_mprevious_msg, interval);   }    }); }

setTimeout(get_mprevious_msg, interval);
</script>
	</body>
</html>
