<?php 
/**
 *
 * @package Luzuk
 */
if(get_theme_mod('testimonials_area_disable') != 'on' ){ ?> 


    <?php 
    if( get_theme_mod('testimonials_areaTpadding',true) ) {
      $testimonials_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('testimonials_areaTpadding')).';';
    }
    if( get_theme_mod('testimonials_areaBpadding',true) ) {
      $testimonials_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('testimonials_areaBpadding')).';';
    }
    if( get_theme_mod('testimonials_areaOpacity',true) ) {
    $testimonials_areaOpacity = 'opacity:'.esc_attr(get_theme_mod('testimonials_areaOpacity')).';';
  }
    ?>  
  <div class="testimonials-area wow bounceInLeft" id="testimonials" style="<?php echo esc_attr($testimonials_areaTpadding); ?>" "<?php echo esc_attr($testimonials_areaBpadding); ?>">

    <!-- <div class="testimonials-overlay"></div> -->
    <?php
      $testimonials_page_id = get_theme_mod('testimonials_page'); 
      $testimonials_maintitle = get_theme_mod('testimonials_title', '<span>Our</span> Testimonials');
      
    ?>
      <div class="container">
        <div class="row">
          <?php if($testimonials_maintitle) { ?>
               <div class="col-md-9"> 
            <div class="section-title testi-title">
              <h2><?php echo ($testimonials_maintitle);  ?></h2>
            </div>
               </div> 
          <?php }?>
        </div>
      
<div class="testimonials-single-area">
    <div class="test-brd"> 
      <div class="owl-carousel owl-theme">   
         
      <?php 
      $showStatic = true;
      $cols = get_theme_mod('test_npp_count', 5);
      $cols++;
      switch($cols){
        case 1:
          $colCls = 'col-md-12 col-sm-12 col-xs-12';
          break;
        case 2:
          $colCls = 'col-md-6 col-sm-6 col-xs-12';
          break;
        case 3:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
          $colCls = 'col-md-4 col-sm-6 col-xs-12';
          break;
        default:
          $colCls = 'col-md-3 col-sm-6 col-xs-12';
          break;
      }
      $icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell'); 

      for( $i = 1; $i <= $cols; $i++ ){
        $testimonials_page_id = get_theme_mod('testimonials_page'.$i); 
        $testimonials_page_icon = get_theme_mod('testimonials_page_icon'.$i);
        if($testimonials_page_id){
          $showStatic = false;
          echo testimonialShortCode($testimonials_page_id, $isCustomizer=true, $i);
        }
      }
      // adding the static content
      if($showStatic === true){
        for( $i = 1; $i <= $cols; $i++ ){ ?>
        <div class="item">        
          <div class="ts-area-single text-center col-md-12 col-sm-12 col-xs-12 pd-0">
              <div class="col-md-3 col-sm-4 col-xs-12 pd-0 innertest-thumb">
                  <div class="ts-area-thumb">
                    <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/t4.jpg" alt="">
                  </div>
              </div>
             <div class="ts-area-content text-center col-md-9 col-sm-8 col-xs-12 pd-0">
              
              <div class="ts-area-c section-area-text ">   
                <p>“Praesent scelerisque, odio eu fermentum malesuada, nisi arcu volutpat nisl, sit amet convallis nunc turpis eget eros.”</p> 
                
              </div> 
              <div class="pd-0 ts-area-bx">
                <div class="col-md-1 col-sm-1 col-xs-1 pd-0">
                      <?php 
                    $clientname_image = get_theme_mod('clientname_image');
                    if(!empty($clientname_image)){
                      echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($clientname_image).'" class="img-responsive secondry-bg-img" />';
                    }else{
                      echo '<img alt="clientname image" src="'.get_template_directory_uri().'/images/testim02.png" class="img-responsive" />';
                    }
                    ?>
                </div>
                <div class="col-md-11 col-sm-11 col-xs-11 con-inn">
                    <div class="col-md-6 pd-0">
                      <h6 class="ts-area-title">MR. JEMS BOND</h6>
                    </div>
                    <div class="col-md-6 pd-0">
                      <div class="text-designation">-24 webpro Sudio</div>
                    </div>
                </div>
              </div>
              <div class="clearfix"></div>
            </div>
        </div>
      </div>
        
        <?php 
        }
      } ?>
    </div>
    </div>
 
    <div class="clearfix"></div>
              </div>
           </div>
       </div>
 <script>
        $(document).ready(function() {
          $('.testimonials-area .owl-carousel').owlCarousel({
           slideSpeed : 1500,
            autoplay: true,
              loop: true,
              margin: 30,
              responsiveClass: true,
              responsive: {
                0: {
                  items: 1,
                  nav: true
                },
                600: {
                  items:1,
                  nav: false
                },
                1000: {
                  items:2,
                  nav: true,
                  loop: true,
                  margin: 0
              }
            }
          })
        })
      </script>
      <script>
    jQuery.noConflict();
    $(function(){
      function tsareasingleHeight(){
        var ht = 0;
        $('#testimonials .ts-area-single').each(function(i){
          var tHt = $(this).height();
          if(ht<tHt){
            ht=tHt;
          }
        });
        $('#testimonials .ts-area-single').height(ht+'px');
      }
      tsareasingleHeight();
    });
    $( window ).resize(function(){
      tsareasingleHeight();
    });
  </script>
    <?php }

