<?php
        $article = new Article();
        $article->category_id = 20 ;
        $criteria = $article->search(1);
        $criteria->compare('t.status', Article::STATUS_PUBLISHED);
        $criteria->limit = 12; 
        $teams =   $article->findAll($criteria);
        
        $article = new Article();
        $article->category_id = 21 ;
        $criteria = $article->search(1);
        $criteria->compare('t.status', Article::STATUS_PUBLISHED);
      
        $selling_home =   $article->findAll($criteria);
        
        $about_home = Article::model()->articleById(44);
       
 ?>
 <style> .overlay {    background: transparent;    opacity: 0.55; } </style>
 <div class="section-dark page-banner home-banner" style="background-color:#fff">
    <div
                    class="full-block page-banner-image"
                    data-top="transform:translate3d(0px,0px,0px)"
                    data-top-bottom="transform:translate3d(100px,0px,0px)"
                    data-smooth-scrolling="off"
                    style="background-image: url('<?php echo $this->getAssetPath('images/hero-08-xl.jpg');?>');"
                ></div>
    <div class="banner-video">
      <video id="bannervideo" width="320" height="240" autoplay loop muted>
        <source src="<?php   echo $this->getAssetPath('videos/dubai1.m4v');?>" type="video/mp4" />
      </video>
    </div>
    <div class="full-block overlay"></div>
    <div class="container">
      <div class="row">
        <div class="col col-md-12">
          <div class="page-banner-content">
            <p></p>
           <div class="fancy-title-hold text-initial clearfix">
              <h1 class="fancy-title animate animated"> <span class="title">SELLING SOLUTIONS</span> <br><span class="subtitle" style="float: right;position: relative;">Not Promises</span> </h1>
            </div>
            <div class="property-search property-search-mini">
              <form class="property-search-form" action="<?php echo YIi::app()->createUrl('searchlist/index');?>">
                <div class="row">
                  <div class="col col-sm-4 col-md-5 form-group property-search-location clearfix">
                    <label>Enter Location</label>
                    <input type="text" value="" name="keyword" required placeholder="Enter Location or Keywords" class="form-control" />
                  </div>
                  <button type="submit" class="btn btn-default">Search <span>Properties</span></button>
                </div>
              </form>
            </div>
            <div class="btn-group  mob-sml-pad" role="group" aria-label=""> <a href="<?php echo YIi::app()->createUrl('searchlist/index/section/1');?>" class="btn btn-secondary">Property for Sale</a> <a href="<?php echo YIi::app()->createUrl('searchlist/index/section/2');?>" class="btn btn-secondary">Property for Rent</a> <a href="<?php echo YIi::app()->createUrl('searchlist/index/off_plan/1');?>" class="btn btn-secondary">Off Plan</a> <a href="<?php echo YIi::app()->createUrl('searchlist/index/listing_type/C');?>" class="btn btn-secondary">Commercial <span class="hd-mobile">Properties</span></a> </div>
          </div>
        </div>
      </div>
    </div>
    <span class="discover-more">Discover more</span> </div>
  <div id="content">
    <div class="section page-section section-no-padding">
        <div class="bg">
      <?php
      if(!empty($featuredListing)){ ?> 
      <div class="section section-featured" style="padding-bottom:0px;">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12 col-md-6">
              <div class="featured-title-hold text-left clearfix">
                <h2 class="featured-title animate"> <span class="title">Featured Properties</span> <span class="subtitle">Must see properties</span> </h2>
              </div>
            </div>
            <div class="clear"></div>
            <?php
            foreach($featuredListing as $k=>$v){
            $animation = ($k=='1') ? 'data-bottom-top="transform:translate3d(0px,0px,0px)" data-top-bottom="transform:translate3d(0px,-190px,0px)" style="transform: translate3d(0px, 0px, 0px);"' : 'data-bottom-top="transform:translate3d(0px,-20px,0px)" data-top-bottom="transform:translate3d(0px,40px,0px)" style="transform: translate3d(0px, -20px, 0px);"'; ?> 
            <div class="col col-sm-6 col-md-6 featured-property" <?php echo $animation;?> >
              <div class="card card-property card-link taphover">
                <div class="card-image">
                  <div class="full-block card-image-inner transition" style="background-image: url('<?php echo $v->ProfileImage;?>');"></div>
                  <div class="full-block overlay transition"></div>
                  <div class="property-media"> <span><i class="fa fa-camera"></i> <?php echo $v->TotalImage;?></span> </div>
                  <div class="card-hover transition"> <span class="icon-click"> </span> <span class="click-text"> <span class="gold">Click</span> to explore</span> <span class="arrow transition"> </span> </div>
                 <?php echo $v->SaveFave;?> </div>
                <div class="property-icons">
				 <?php
				 if(!empty($v->bedrooms)){ ?> 
                  <div class="property-icon"><img src="<?php echo $this->getAssetPath('images/icon-bedroom.svg');?>" alt="Bedrooms" /> <?php echo $v->BedroomsTitle;?> <span>Bedrooms</span></div>
                  <?php } ?>
                   <?php
				 if(!empty($v->bathrooms)){ ?>
                  <div class="property-icon"><img src="<?php echo $this->getAssetPath('images/icon-bathroom.svg');?>" alt="Bathrooms" /> <?php echo $v->BathroomsTitle;?> <span>Bathrooms</span></div>
				<?php } ?>  
                  <?php
                  if(!empty($v->parking)){ ?> 
                  <div class="property-icon">
                      <div class="d-flex">
                          <img src="<?php echo $this->getAssetPath('images/icon-reception.svg');?>" alt="parking" /> <?php echo $v->parking;?> 
                          </div>
                          <span>Parking &nbsp; &nbsp;</span></div>
				 <?php } ?> 
               
                
                </div>
                <div class="card-content">
                  <h3><a href="<?php echo $v->DetailUrl;?>"><?php echo $v->AdTitle;?></a></h3>
                   <?php
                      $loc = $v->LocationTitleOffering;
                      if(!empty($loc)){ ?> 
                      <p><?php echo $loc;?></p>
                      <?php } ?>
                  <p class="price"><!--<span class="price-before price-guide">Guide Price</span>--> <?php echo $v->priceWithCurrncy;?></p>
                </div>
                <a href="<?php echo $v->DetailUrl;?>" class="full-block"></a> </div>
            </div>
            <?php } ?> 
            
             <div class="col col-sm-8 col-sm-offset-4 col-md-5 col-md-offset-7" style="display:none;" data-bottom-top="transform:translate3d(0px,0px,0px)" data-top-bottom="transform:translate3d(0px,-80px,0px)">
              <div class="property-search-mini-hold">
                <label for="location">Search properties </label>
                <div class="property-search property-search-mini">
                  <form autocomplate="false" class="property-search-form" action="<?php echo Yii::app()->createUrl('searchlist/index');?>" method="GET">
                    <input type="hidden" name="search" value="1" />
                    <div class="row">
                      <div class="col col-sm-4 col-md-5 form-group property-search-location clearfix">
                        <label>Enter Location</label>
                        <input type="text" value="" name="keyword" required placeholder="Enter Location or Keywords" class="form-control " />
                      </div>
                      <button type="submit" class="btn btn-default">Search <span>Properties</span></button>
                    </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <?php } ?> 
      
      
      <?php
      if(!empty($latestListing)){ ?> 
      <div class="section section-featured section-new-instructions" style="padding-bottom: 30px;">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12 page-content clearfix">
              <div class="featured-title-hold text-left clearfix">
                <h3 class="featured-title animate"><span class="title">New Properties</span></h3>
              </div>
              <div class="row properties">
				<?php
				foreach($latestListing as $k=>$v){ ?> 
                <div class="col col-sm-6 col-md-4">
                  <div class="card card-property card-link taphover">
                    <div class="card-image">
                      <div class="full-block card-image-inner transition" style="background-image: url('<?php echo $v->ProfileImage;?>');"></div>
                      <div class="full-block overlay transition"></div>
                      <div class="property-media"> <span><i class="fa fa-camera"></i> <?php echo $v->TotalImage;?></span> </div>
                      <div class="card-hover transition"> <span class="icon-click"></span> <span class="click-text"><span class="gold">Click</span> to explore</span> <span class="arrow transition"></span> </div>
                      <?php echo $v->SaveFave;?> </div>
                      
                      
                    <div class="property-icons">
					<?php
				 if(!empty($v->bedrooms)){ ?> 
                  <div class="property-icon"><img src="<?php echo $this->getAssetPath('images/icon-bedroom.svg');?>" alt="Bedrooms" /> <?php echo $v->BedroomsTitle;?> <span>Bedrooms</span></div>
                  <?php } ?>
                   <?php
				 if(!empty($v->bathrooms)){ ?>
                  <div class="property-icon"><img src="<?php echo $this->getAssetPath('images/icon-bathroom.svg');?>" alt="Bathrooms" /> <?php echo $v->BathroomsTitle;?> <span>Bathrooms</span></div>
				<?php } ?>  
                  <?php
                  if(!empty($v->parking)){ ?> 
                  <div class="property-icon"><img src="<?php echo $this->getAssetPath('images/icon-reception.svg');?>" alt="parking" /> <?php echo $v->parking;?> <span>Parking &nbsp; &nbsp;</span></div>
				 <?php } ?> 
                    </div>
                    <div class="card-content card-contentts">
                      <h3><a href="<?php echo $v->DetailUrl;?>"><?php echo $v->AdTitle;?></a></h3>
                      <?php
                      $loc = $v->LocationTitleOffering;
                      if(!empty($loc)){ ?> 
                      <p><?php echo $loc;?></p>
                      <?php } ?>
                      <p class="price"><?php echo $v->priceWithCurrncy;?></p>
                    </div>
                    <a href="<?php echo $v->DetailUrl;?>" class="full-block"></a> </div>
                </div>
				<?php } ?> 
          
            </div>
            </div>
          </div>
        </div>
      </div>
      <?php } ?> 
   </div>
   
    <?php
    if(!empty( $selling_home)){?> 
      <div class="section section-dark section-selling" style="background-image: url('<?php echo $this->getAssetPath('images/hero-08-xl.jpg');?>');">
        <div
                            class="full-block page-banner-image"
                            data-bottom-top="transform:translate3d(0px,0px,0px)"
                            data-top-bottom="transform:translate3d(200px,0px,0px)"
                            data-smooth-scrolling="off"
                            style="background-image: url('<?php echo $this->getAssetPath('images/hero-08-xl.jpg');?>');"
                        ></div>
        <div class="full-block overlay"></div>
        <div class="container">
          <div class="row">
            <div class="col col-sm-12">
              <div class="fancy-title-hold text-initial clearfix">
                <h3 class="fancy-title animate"> <span class="title">Selling your home</span> <span class="subtitle">made easy</span> </h3>
              </div>
            </div>
            <div class="col col-sm-6 selling-left">
              <ul class="slider steps">
                  <?php
                  foreach( $selling_home as $k=>$v){ ?> 
                <li><span class="step-no"><?php echo $k+1; ?> </span><?php echo $v->title;?></li>
                <?php } ?> 
                 
              </ul>
            </div>
            <div class="col col-sm-6 selling-right">
              <div class="slider steps-content">
                   <?php
                  foreach( $selling_home as $k=>$v){ ?> 
                  <div class="box-hold">
                  <div class="box box-selling">
                    <h3><?php echo $v->title;?></h3>
                    <p> <?php echo $v->content;?></p>
                    <!--<a href="#" class="btn btn-default" data-toggle="modal" data-target="#">Get a Free Valuation</a>--> 
                  </div>
                </div>
                
                <?php } ?>
             </div>
            </div>
          </div>
        </div>
      </div>
      <?php } ?>
       <div class="bg">
      <?php
      if(!empty($about_home)){ ?>
      <style>
          .chief-sect .fancy-title { padding-right:0px;padding-bottom:0px;  }
          .chief-sect img {  border-radius: 5px; }
      </style>
      <div class="section section-about">
        <div class="container">
          <?php echo $about_home->content;?>
        </div>
      </div>
      <?php } ?> 
     
      <?php
      if(!empty($blog)){ ?> 
      <div class="section section-blog">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12 clearfix">
              <div class="featured-title-hold text-left clearfix">
                <h3 class="featured-title animate"><span class="title">What's new with us?</span></h3>
              </div>
              <div class="row">
                <div class="col col-sm-8">
                  <div class="row row-news row-news-portrait">
					  <?php
					  foreach($blog as $k=>$v){
						  preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', $v->content, $image);
	 
							$img = @$image['1'] ;
						  
						   ?> 
                    <div class="col col-sm-5 <?php echo $k=='1' ? 'col-sm-offset-1' : '';?>">
                      <div class="card card-news card-news-alt card-link taphover">
                        <div class="card-image">
                          <div class="full-block card-image-inner transition" style="background-image: url('<?php echo $img;?>');"></div>
                          <div class="full-block overlay transition"></div>
                          <div class="card-hover transition"> <span class="icon-click"> </span> <span class="click-text"> <span class="gold">Click</span> to explore</span> <span class="arrow transition"> </span> </div>
                          <a href="<?php echo Yii::app()->createUrl('articles/view', array('slug' => $v->slug));?>" class="full-block"></a> </div>
                        <div class="card-content">
                          <p class="the-date"><?php echo $v->DateNew;?></p>
                          <h3> <a href="<?php echo Yii::app()->createUrl('articles/view', array('slug' => $v->slug));?>"><?php echo $v->title;?></a> </h3>
                        </div>
                      </div>
                    </div>
                    <?php } ?> 
                    </div>
                </div>
                <div class="col col-sm-4">
                  <div class="widget box1 widget-tweet">
                   <a href="<?php echo $this->options->get('system.common.twitter_url');?>"  target="_blank" rel="nofollow">  <div class="tweet-list"> <i class="fa fa-twitter"></i> </div></a>
                  </div>
                  <div class="widget box2 widget-tweet">
                    <a href="<?php echo $this->options->get('system.common.google_plus_url');?>"  target="_blank" rel="nofollow"><div class="tweet-list"> <i class="fa fa-youtube-play"> </i> </div></a>
                  </div>
                  <div class="widget box3 widget-tweet">
                   <a href="<?php echo $this->options->get('system.common.facebook_url');?>"  target="_blank" rel="nofollow"> <div class="tweet-list"> <i class="fa fa-facebook"> </i> </div></a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <?php } ?> 
     
     <?php
     if(!empty($teams)){ ?> 
     
      <div class="section section-blog" style="padding-top: 0px;">
        <div class="container">
          <div class="row">
            <div class="col col-sm-12 clearfix">
              <div class="featured-title-hold text-left clearfix">
                <h3 class="featured-title animate"><span class="title">Our Team</span></h3>
              </div>
              <div class="row">
                  <?php
              
                  foreach($teams as $k=>$v){
                  
							$img = $v->ArticleMainImage ;
                  ?> 
                <div class="col col-lg-3 col-sm-12 col-md-2 home-teams">
                  <div class="card card-block card-link taphover">
                    <div class="card-image">
                      <div class="full-block card-image-inner transition" style="background-image:url( '<?php echo $img;?>' );"></div>
                      <div class="full-block overlay transition"></div>
                      <div class="card-hover transition"> <span class="icon-click"></span> <span class="click-text"><span class="gold">Click</span> to explore</span> <span class="arrow transition"></span></div>
                    </div>
                    <div class="card-content" style="padding-bottom: 0px; ">
                      <h3 style="margin-bottom: 0px;color: #fff;"><?php echo $v->title;?></h3>
                      <p style="margin-bottom: 0px;color: #fff;"><?php echo $v->sub_title;?></p>
                    </div>
                    <a href="<?php echo Yii::app()->createUrl('articles/view',array('slug'=>$v->slug));?>" class="full-block"></a></div>
                </div>
			    <?php } ?> 
			  </div>
            </div>
          </div>
        </div>
      </div>
      <?php } ?> 
        </div>
  
    </div>
  </div>
