<style>.funkyradio input[type="radio"]:empty ~ label, .funkyradio input[type="checkbox"]:empty ~ label { margin-top:0px; }

.d-flex{display:flex; margin-bottom:5px;}
  .funkyradio input[type="checkbox"], .funkyradio  input[type="radio"] { margin:0px 5px 5px 0px; } 
  .property-search-full .property-search-form {
    padding: 10px;
    background: #eee;
    border-radius: var(--system-bradius);
    position: relative;
    z-index: 1111111;
}html .typeahead__button {
    display: none !important;
}.section {
    padding: 40px 0; 
}.page-banner {
    padding: 30px 0px; 
}
#header {
    position: relative;
}.header {
    padding: 20px 0;
    background: #102448;
}.header .logo img {
    max-height: 53px;
    width: auto;
    position: relative;
    top: -3px;
    margin-top: 0px;
}a.current { background-color:#eee;}
.bi-x-square-fill{color:red;}
@media only screen and (min-width: 1024px) {
.properties .plr-3:nth-child(3n+1){
    clear:left !important;
}
}
</style>	 
                
                      <?php
                    $listing_type = PlaceAnAd::model()->ListingTypeArray(); 
                    $CategoryModel = Category::model()->ListData(); 
                     ?> 
	<div class="section-dark page-banner list-banner-home for-listing-page">
      <div class="full-block page-banner-image" ></div>
      <div class="full-block overlay"></div>
      <div class="container">
        <div class="row disp-table">
          <div class="col col-md-12">
            <div class="page-banner-content">
               
             
              <div class="property-search property-search-full">
                    <div class="only-small-screen open-filre">
                    <ul class="mob-opener-first">
                        <li onclick="closefiltersrch()"><i class="bi bi-arrow-left"></i></li>
                        <li class="headi">Filter </li> 
                        <li class="reset-frm">Reset</li>
                    </ul>
                </div>
                <form class="property-search-form" id="frmId" action="<?php echo Yii::app()->createUrl('searchlist/find');?>" >
                
                  
                  <div class="row">
                        <div class="col-sm-2 no-list-normal" style="    min-width: 128px;">
                     <select   name="sect" style="    width: 100%;" class="form-control">
                          
                         <option value="for-sale" <?php echo $formData['sect']=='1' ? 'selected' : '';?> >Buy</option>
                         <option value="for-rent"  <?php echo $formData['sect']=='2' ? 'selected' : '';?> >Rent</option> 
                      </select>
                      <div class="clearfix"></div>
                      </div>
                    <div class="col col-sm-4 col-md-8 form-group locat-picker  clearfix">
                      
                       <?php  $this->renderPartial('//site/_autocomplete');  
                       
                      
                       ?>
                    </div>
                    <div class="col col-sm-2 col-md-2 form-group drop-module  no-list-normal clearfix">
                        
                        <input type="hidden"  id="list_type" name="listing_type" value="<?php echo @$_GET['listing_type'];?>">
                        <input type="hidden"  id="category_list" name="category" value="<?php echo @$_GET['category'];?>">
                        <input type="hidden" name="community" id="community" value="">
                        <input type="hidden" name="subcommunity" id="subcommunity" value="">
                        <?php
                        $this->renderPartial('_property_type');
                        ?>
                   
                    </div>
                    
                    <div class="col col-sm-6 col-md-5 form-group no-small-screen clearfix">
					
                   </div>
                   </div>
                 
                   <div class="row mt-2" style="margin-top: 5px;">
					  
				 
                    <div class="col col-sm-4 col-md-4 form-group no-list-normal clearfix">
                      
                      <select id="search_min_bedrooms" name="minbeds" class="form-control">
                        <?php $adModel->getBedroomHtml();?>
                      </select>
                      <select name="maxbeds" class="form-control">
                        <?php $adModel->getMaxBedroomHtml();?>
                      </select>
                    </div>
                    <div class="col col-sm-4 col-md-4 form-group no-list-normal clearfix">
                    
                      <select id="search_min_price" name="minprice" class="form-control">
                        <?php $adModel->getMinPriceHtml();?>
                       
                      </select>
                      <select name="maxprice" class="form-control">
                        <?php $adModel->getMaxPriceHtml();?>
                      </select>
                       <input type="hidden" name="sort" id="sort-me" value="<?php echo @$formData['sort'];?>" /> 
                        <input type="hidden" name="agent" id="agent"  value="<?php echo @$formData['agent'];?>" /> 
                        <input type="hidden" name="keyword" id="keyword1"  value="<?php echo @$formData['keyword'];?>" /> 
                    </div>
                    <div class="col col-sm-4 col-md-4 form-group no-list-normal no-border-here clearfix" id="btm-srch">
					<a href="javascript:void(0)"  onclick="closefiltersrch()" id="close-btn" class=" only-small-screen">Close</a>
                   <button type="submit" id="btnSubmit" class="btn btn-primary" style="    height: 56px;    margin-left: 10px; width:calc(100% - 10px)">Search Properties</button>
                    </div>
                   
                  </div>
                </form>
            
            
                <div class="only-small-screen">
                    <ul class="mob-opener">
                        <li onclick="openfiltersrch()"><i class="bi bi-sliders"></i> Filter </li>
                        <li onclick="openSortlist()"><i class="bi bi-sort-up"></i> Sort </li>
                        <li><i class="bi bi-share"></i> Share </li>
                    </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  <script>resetthistfrmagent
      function resetthistfrmagent(k){ 
         jQuery('#agent').val("");jQuery("#btnSubmit").click(); 
      }
       function resetthistfield(k){ 
         jQuery('#keyword1').val("");jQuery("#btnSubmit").click(); 
      }
  </script>
  <div id="content">
      <div class="breadcrumbs hide">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12"> <span><span><a href="<?php echo $this->app->createUrl('site/index');?>">Home</a> <i class="fa fa-angle-right"></i> <span class="breadcrumb_last" aria-current="page">Properties</span></span></span></div>
          </div>
        </div>
      </div>
      <div class="section page-section listing-page-m" id="propserch">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12 page-content clearfix">
              <div class="row">
                <div class="col col-sm-9">
                  <div class="fancy-title-hold text-left clearfix">
                    <h2 class="site-h2" style="margin-bottom:0px;"><?php echo  $title ;?></h2>
                    <p><?php echo $count;?> properties found</p>
                    <ul id="clearfrm">
                    <?php
                    if(!empty($formData['agent'])){ ?> 
                    <li data-name="agent"><?php echo $customerModel->first_name;?> <i class="bi bi-x-square-fill" onclick="resetthistfrmagent(this)"></i></li> 
                    <?php } ?> 
                    <?php
                    if(!empty($formData['keyword'])){ ?> 
                    <li data-name="keyword"><?php echo $formData['keyword'];?> <i class="bi bi-x-square-fill" onclick="resetthistfield(this)"></i></li> 
                    <?php } ?> 
                    </ul>
                  </div>
                  </h4>
                </div>
                <div class="col col-sm-3 no-small-screen" id="sort-div">
                  
                    <div class="form-group property-sort clearfix">
                      <div>
                       <span class="only-small-screen s-by-text">Sort By:</span>
                        <select id="search_sort" class="form-control autosubmit" name="sort" onchange="setSort(this)"  style="float: right;display: block;/*! text-align: right; */right: 0;position: absolute;max-width: 200px;">
						 <?php
						  $sortArray = $adModel->sortArray();
                        foreach($sortArray as $k=>$v){ 
								$checked = ($k==@$formData['sort']) ?'selected=true': '';
                        echo '<option value="'.$k.'" '.$checked.'>'.$v.'</option>';
						} 
						?>
                        </select>
                         <span class="only-small-screen s-by-link"><button type="button" class="btn" onclick="clncelSort()" >Cancel</button></span>
                      </div>
                  </div> 
                </div>
                </div>
                <?php
                if(!empty($list)){ ?> 
            
                
                <ul class="count-list <?php echo !defined('COMMUNITY') ? 'aut-width': '';?>">
                    <?php 
                    foreach($list as $k2=>$v2){
                          if(defined('COMMUNITY')){
                                echo '<li><a href="javascript:void(0)" data-slug="'.$v2->community_slug.'" onclick="generateUrlCommunity(this)" >'.$v2->community_name.'<span>('.$v2->id.')</span></a></li>';
                        
                         }else{
                             echo '<li><a href="javascript:void(0)" data-slug="'.$v2->category_slug.'" onclick="generateUrl1(this)" >'.$v2->category_name.'<span>('.$v2->id.')</span></a></li>';
                        }
                    }
                    ?>
                </ul>
                <?php } ?>
                
            <div class="row">
                <div class="row properties lis-i" id="d_column">
					
				  <?php    
				   $this->renderPartial('//searchlist/_list_proprty',compact('models' ));
				    ?>  
             
              <div id="suggest_friends_last_id"></div><div class="clearfix"></div> 
              <?php
              /*
              if(sizeOf($models) >= $limit){
				echo '<p class="text-center loadingDiv"><a href="javascript:void(0)" onclick="checkScroll();" class="btn   btn-primary  btn-shadow btn-rounded btn-icon-right">'.  'Load More' .'</a></p>';
				} 
				*/
				?>
                </div>
                
     
        <div class="page-ination">
        <div class="page-in">
          <ul class="custom-pagination">
             <?php 
		//if($pages->itemCount>3){
		$this->widget('frontend.components.web.widgets.SimplaPager', array(
		'pages'=>$pages,'maxButtonCount'=>5,
		));  
		//}
		?>
          </ul>
        </div>
      </div>
 
               </div>
              <div class="clear"></div>
            </div>
          </div>
        </div>
      </div>
      </div>
      <?php /*
<script type="text/javascript">
	var stopPagination;
	var loadingHtml    	= '<div style="position:relative;"><div class="loading "><div class="spinner rmsdf"><div class="bounce1"></div>  <div class="bounce2"></div>  <div class="bounce3"></div></div><div class="clearfix"></div><div style="    clear: both;    margin-top: 30px;    font-weight: 600;">Loading more properties, please wait.    <div></div></div>';
	var	loadMoreHtml 	= '<a href="javascript:void(0)" class="btn   btn-primary  btn-shadow btn-rounded btn-icon-right" onclick="checkScroll();"  id="refresh_list" ><?php echo 'Load More' ;?></a>';  
	var afterFinishHtml = '';   
	var elementId='slideSheet';
	var appendId='suggest_friends_last_id';
	var scroll=true;
	var limit='<?php echo $limit;?>';
	var offest='0';
	var formID  = 'frmId';
	var checkFuture = true ;
	var loadingDiv ;
	jQuery(document).ready(function () {
	loadingDiv  =  jQuery('.loadingDiv');
	});
	var currentPage = 1;
	var scroll_Pagination5;
	var slug ='<?php echo Yii::app()->createUrl('searchlist/fetch_work');?>';


   var data1 = encodeURIComponent( jQuery('#frmId').serialize());
          function checkScroll() {
                    currentPage++;
                    offset =  (currentPage - 1) * limit   ;
					jQuery.ajax(slug+'?offset=' + offset + '&limit='+limit+'&is_form=1',  { data		 : {formData:data1  } ,asynchronous:true, evalScripts:true, method:'get', 
						beforeSend: function(){
							  scroll = false;
							loadingDiv.html(loadingHtml);               
						},
						success: function(data, textStatus, jqXHR) {
							loadingDiv.html('');     
							if(data=='1') { stopPagination = false;   }
							else{
							data = JSON.parse(data);
							jQuery('#suggest_friends_last_id').before(data.dataHtml);
						    scroll = true;
					 	}
					},});
					 
					}
          
  

	jQuery(document).ready(function () {
	      
	jQuery(window).scroll(function() {
	if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery('#d_column').height() &&  scroll && !stopPagination) {
		scroll = false;
		 checkScroll();
	}
	})
	})
	
	</script> 
	*/
	?>
 <script>
$(function(){
const observer = lozad(); // lazy loads elements with default selector as '.lozad'
observer.observe();
})
</script>