<?php include("header.php");
//echo'<pre>';print_r($_POST);exit;
if(isset($_POST['find']))
{
	$cityid=$_POST['cityid'];
	$ads=str_replace(" ","-",$_POST['ads']);
	
	$ads=str_replace("&","and",$ads);
	
	if(isset($_POST['mcid']) && $_POST['mcid']==!"")
	{
		$mcatid=$_POST['mcid'];
	}
	else
	{
		$mcatid="all";
	}
	
	
	$city=$_POST['city'];
	
	?><script>
    window.location="<?php echo $actual_link;?>products/<?php echo $city."/".$cityid."/".$mcatid."/".$ads;?>";
    </script><?php
}


?>
<div class="intro">
<div class="dtable hw100">
<div class="dtable-cell hw100">
<div class="container text-center">
<h1 class="intro-title animated fadeInDown"> Find Classified Ads </h1>
<p class="sub animateme fittext3 animated fadeIn"> Find local classified ads on bootclassified in Minutes </p>
<div class="row search-row animated fadeInUp">
<form method="post" autocomplete="off">
<div class="col-lg-4 col-sm-4 search-col relative locationicon">
<i class="icon-location-2 icon-append"></i>
<input type="text" name="city" id="autocomplete-ajax" class="form-control locinput input-rel searchtag-input has-icon citys" placeholder="City..." value="">
<input type="hidden" name="cityid" id="cityid" value="">
</div>
<div style="position: absolute; max-height: 300px; z-index: 9999; top: 329px; left: 289.5px; width: 255px; display:none;" id="citysearch" class="autocomplete-suggestions">
</div>

<div class="col-lg-4 col-sm-4 search-col relative"> <i class="icon-docs icon-append"></i>
<input type="text" name="ads" id="search_ads" class="form-control has-icon" placeholder="I'm looking for a ..." value="" required>
<input type="hidden" name="mcid" id="Mcid" value="">
</div>
<div style="position: absolute; max-height: 300px; z-index: 9999; top: 329px; left: 544.5px; width: 258px; border-radius:none; display:none;" id="productsearch" class="autocomplete-suggestions">
</div>
<div class="col-lg-4 col-sm-4 search-col">
<button class="btn btn-primary btn-search btn-block" name="find"><i class="icon-search"></i><strong>Find</strong></button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
 
<div class="main-container">
<div class="container">
<div class="row">
<div class="col-sm-9 page-content col-thin-right">
<div class="inner-box category-content">
<h2 class="title-2">Find Classified Ads World Wide </h2>
<div class="row">

<?php $sqlmaincat=mysql_query("select * from tbl_maincategory");
	  while($resmaincat=mysql_fetch_assoc($sqlmaincat))
	  {
?>
	<div class="col-md-4 col-sm-4" style="min-height:300px;">
    <div class="cat-list">
    <h3 class="cat-title"><a href=""><i class="fa fa-car ln-shadow"></i> <?php echo $resmaincat['name']?> <span class="count"></span> </a>
    <span data-target=".cat-id-1" data-toggle="collapse" class="btn-cat-collapsed collapsed"> <span class=" icon-down-open-big"></span> </span>
    </h3>
    <ul class="cat-collapse collapse in cat-id-1">
    <?php $sqlcats=mysql_query("select * from tbl_category where mcid='".$resmaincat['mcid']."'");
		  while($rescats=mysql_fetch_assoc($sqlcats))
		  {
	
	?>
    <li> <a><?php echo $rescats['name'];?></a> </li>
    
    <?php } ?>
    
    </ul>
    </div>
    </div>
    
    
<?php }?>




</div>
</div>
<div class="inner-box relative">
<h2 class="title-2">Featured Listings
<a id="nextItem" class="link  pull-right carousel-nav"> <i class="icon-right-open-big"></i></a>
<a id="prevItem" class="link pull-right carousel-nav"> <i class="icon-left-open-big"></i> </a>
</h2>
<div class="row">
<div class="col-lg-12">
<div class="no-margin item-carousel owl-carousel owl-theme">
<?php $sqlmostlike=mysql_query("select * from tbl_favorite");
	  while($resmostlike=mysql_fetch_assoc($sqlmostlike))
	  {
		  $sqlads1=mysql_query("select * from tbl_ads where ads_id='".$resmostlike['ads_id']."' and admin_status!='Achieved'");
		  if(mysql_num_rows($sqlads1)>0)
		  {
		  	$resads1=mysql_fetch_assoc($sqlads1);
			
			
			?>
				<div class="item"> 
                	<a href="ads-details.html">
                        <span class="item-carousel-thumb">
                        	<img class="img-responsive" src="<?php echo $actual_link."postedfile/".$resads1['file1']; ?>" alt="img">
                        </span>
                        <span class="item-name"> <?php echo $resads1['description'];?> </span>
                        <span class="price"> <i class="fa fa-inr"></i> <?php echo $resads1['price'];?> </span>
                    </a>
                </div>
			<?php
		  	
		  }
		  
		  
	  }
?>




</div>
</div>
</div>
</div>
<div class="inner-box relative">
<div class="row">
<div class="col-md-5">
<div>
<h3 class="title-2"> <i class="icon-location-2"></i> Popular locations </h3>
<div class="row"> <ul class="cat-list col-xs-6">
<li> <a href="category.html">Atlanta</a></li>
<li> <a href="category.html">Wichita </a></li>
<li> <a href="category.html"> Anchorage </a></li>
<li> <a href="category.html"> Dallas </a></li>
<li> <a href="category.html"> New York </a></li>
<li> <a href="category.html">Santa Ana/Anaheim </a></li>
<li> <a href="category.html"> Miami </a></li>
<li> <a href="category.html">Los Angeles</a></li>
</ul>
<ul class="cat-list cat-list-border col-xs-6">
<li> <a href="category.html">Virginia Beach </a></li>
<li> <a href="category.html"> San Diego </a></li>
<li> <a href="category.html">Boston </a></li>
<li> <a href="category.html">Houston</a></li>
<li> <a href="category.html">Salt Lake City </a></li>
<li> <a href="category.html">San Francisco </a></li>
<li> <a href="category.html">Tampa </a></li>
<li> <a href="category.html"> Washington DC </a></li>
</ul></div>
</div>
</div>
<div class="col-md-7 ">
<h3 class="title-2"> <i class="icon-search-1"></i> Popular Makes </h3>
<div class="row">
<ul class="cat-list col-md-4 col-xs-4 col-xxs-6">
<li> <a href="category.html">free </a></li>
<li> <a href="category.html">furniture </a></li>
<li> <a href="category.html">general </a></li>
<li> <a href="category.html">household </a></li>
<li> <a href="category.html">jewelry </a></li>
<li> <a href="category.html">materials </a></li>
<li> <a href="category.html">sporting </a></li>
<li> <a href="category.html">tickets </a></li>
</ul>
<ul class="cat-list col-md-4 col-xs-4 col-xxs-6">
<li> <a href="category.html">tools </a></li>
<li> <a href="category.html">wanted </a></li>
<li> <a href="category.html">cell phones </a></li>
<li> <a href="category.html">clothes+acc </a></li>
<li> <a href="category.html">collectibles </a></li>
<li> <a href="category.html">electronics </a></li>
<li> <a href="category.html">farm+garden </a></li>
<li> <a href="category.html">garage sale </a></li>
</ul>
<ul class="cat-list col-md-4 col-xs-4 col-xxs-6">
<li> <a href="category.html">heavy equip </a></li>
<li> <a href="category.html">motorcycles </a></li>
<li> <a href="category.html">music instr </a></li>
<li> <a href="category.html">photo+video </a></li>
<li> <a href="category.html">appliances </a></li>
<li> <a href="category.html">Land </a></li>
<li> <a href="category.html">arts+crafts </a></li>
<li> <a href="category.html">auto parts </a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3 page-sidebar col-thin-left">
<aside>
<div class="inner-box no-padding">
<div class="inner-box-content"> <a href="#"><img class="img-responsive" src="images/site/app.jpg" alt="tv"></a> </div>
</div>
<div class="inner-box">
<h2 class="title-2">Popular Categories </h2>
<div class="inner-box-content">
<ul class="cat-list arrow">
<li> <a href="sub-category-sub-location.html"> Apparel (1,386) </a></li>
<li> <a href="sub-category-sub-location.html"> Art (1,163) </a></li>
<li> <a href="sub-category-sub-location.html"> Business Opportunities (4,974) </a></li>
<li> <a href="sub-category-sub-location.html"> Community and Events (1,258) </a></li>
<li> <a href="sub-category-sub-location.html"> Electronics and Appliances (1,578) </a></li>
<li> <a href="sub-category-sub-location.html"> Jobs and Employment (3,609) </a></li>
<li> <a href="sub-category-sub-location.html"> Motorcycles (968) </a></li>
<li> <a href="sub-category-sub-location.html"> Pets (1,188) </a></li>
<li> <a href="sub-category-sub-location.html"> Services (7,583) </a></li>
<li> <a href="sub-category-sub-location.html"> Vehicles (1,129) </a></li>
</ul>
</div>
</div>
<div class="inner-box no-padding"> <img class="img-responsive" src="images/add2.jpg" alt=""> </div>
</aside>
</div>
</div>
</div>
</div>
 
<div class="page-info" style="background: url(images/bg.jpg); background-size:cover">
<div class="container text-center section-promo">
<div class="row">
<div class="col-sm-3 col-xs-6 col-xxs-12">
<div class="iconbox-wrap">
<div class="iconbox">
<div class="iconbox-wrap-icon">
<i class="icon  icon-group"></i>
</div>
<div class="iconbox-wrap-content">
<h5><span>2200</span> </h5>
<div class="iconbox-wrap-text">Trusted Seller</div>
</div>
</div>
 
</div> 
</div>
<div class="col-sm-3 col-xs-6 col-xxs-12">
<div class="iconbox-wrap">
<div class="iconbox">
<div class="iconbox-wrap-icon">
<i class="icon  icon-th-large-1"></i>
</div>
<div class="iconbox-wrap-content">
<h5><span>100</span> </h5>
<div class="iconbox-wrap-text">Categories</div>
</div>
</div>
 
</div> 
</div>
<div class="col-sm-3 col-xs-6  col-xxs-12">
<div class="iconbox-wrap">
<div class="iconbox">
<div class="iconbox-wrap-icon">
<i class="icon  icon-map"></i>
</div>
<div class="iconbox-wrap-content">
<h5><span>700</span> </h5>
<div class="iconbox-wrap-text">Location</div>
</div>
</div>
 
</div> 
</div>
<div class="col-sm-3 col-xs-6 col-xxs-12">
<div class="iconbox-wrap">
<div class="iconbox">
<div class="iconbox-wrap-icon">
<i class="icon icon-facebook"></i>
</div>
<div class="iconbox-wrap-content">
<h5><span>50,000</span> </h5>
<div class="iconbox-wrap-text"> Facebook Fans</div>
</div>
</div>
 
</div> 
</div>
</div>
</div>
</div>
 
<div class="page-bottom-info">
<div class="page-bottom-info-inner">
<div class="page-bottom-info-content text-center">
<h1>If you have any questions, comments or concerns, please call the Classified Advertising department at (000) 555-5555</h1>
<a class="btn  btn-lg btn-primary-dark" href="tel:+000000000">
<i class="icon-mobile"></i> <span class="hide-xs color50">Call Now:</span> (000) 555-5555 </a>
</div>
</div>
</div>




<?php include("footer.php");?>

<script>
$(document).click(function() {
//alert('sdgdg');
$(".autocomplete-suggestions").css('display','none');
});

$("#autocomplete-ajax").keyup(function(){
	
	//$(".autocomplete-suggestions").show();
	$("#citysearch").show();
	
	$(this).val();
	$.post("<?php echo $actual_link?>ajax/slocation.php",{sname:$(this).val()},function(data){
	
	$("#citysearch").html(data);
	});
	

});

/*$("#search_ads").keyup(function(){

$("#productsearch").show();

$.post("<?php echo $actual_link?>ajax/sproductads.php",{sname:$(this).val()},function(data){
	
	$("#productsearch").html(data);
	});


});*/

</script>
