<?php
/**
 *
 * @package Luzuk Premium
 */ 
if( get_theme_mod('dinero_testimonials_enable',true) == true){ ?>
<div class="testimonials_section" id="testimonials">
   <div class="testimonials-bg"></div>
    <div class="<?php if(get_theme_mod('dinero_testimonials_section_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_testimonials_section_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">   
 <?php
        $dinero_testimonials_page_id = get_theme_mod('dinero_testimonials_page');   
        $dinero_testimonials_maintitle = get_theme_mod('dinero_testimonials_maintitle', 'TESTIMONIAL');
        $dinero_testimonials_subtitle = get_theme_mod('dinero_testimonials_subtitle', 'What People Say about Business');
        ?>
        <div class="row ">
                <?php if($dinero_testimonials_maintitle || $dinero_testimonials_subtitle){ ?>
                <div class="col-xl-12 col-lg-12 col-sm-12">
                    <div class="dinero-section-head" style="text-align: <?php if(get_theme_mod('dinero_testimonials_head_align','Left') == 'Left'){ ?> left <?php } elseif(get_theme_mod('dinero_testimonials_head_align','Center') == 'Center'){ ?> center <?php } elseif(get_theme_mod('dinero_testimonials_head_align','Right') == 'Right'){ ?> right <?php } ?> ">
                        <?php if($dinero_testimonials_maintitle){ ?>
                        <h2><?php echo ($dinero_testimonials_maintitle);  ?></h2>
                        <?php }?>
                           <?php if( get_theme_mod('dinero_testimonials_head_icon_enable','No') == 'Yes'){ ?>
                            <div class="dinero-section-head-icon">
                                <i class="<?php echo esc_attr(get_theme_mod('dinero_testimonials_head_icon', 'fa fa-bell')); ?>"></i>
                            </div>
                            <?php }?>
                        <h3><?php echo ($dinero_testimonials_subtitle);  ?></h3>               
                    </div>
                </div>
                <?php }?>
            </div>
        <div class="clearfix"></div>
  </div>
<div class="dinero-testimonial-block">   
   
    <div class="<?php if(get_theme_mod('dinero_testimonials_section_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_testimonials_section_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">    
         <div class="owl-carousel owl-theme">   
      <?php 
      $showStatic = true;
      $cols = get_theme_mod('dinero_testimonials_npp_count', 4);
      $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++ ){
        $dinero_testimonials_page_id = get_theme_mod('dinero_testimonials_page'.$i); 
        $dinero_testimonials_page_icon = get_theme_mod('dinero_testimonials_page_icon'.$i);
        if($dinero_testimonials_page_id){
          $showStatic = false;
          echo testimonialShortCode($dinero_testimonials_page_id, $isCustomizer=true, $i);
        }
      }
      // adding the static content
      if($showStatic === true){
        for( $i = 1; $i <= $cols; $i++ ){ ?>
        <div class="item">
            <div class="dinero-testimonials-single  <?php echo esc_attr(get_theme_mod('dinero_testimonials_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="2s" style="text-align : <?php if(get_theme_mod('dinero_testimonials_box_align','Center') == 'Center'){ ?> center <?php } elseif(get_theme_mod('dinero_testimonials_box_align','Left') == 'Left'){ ?> left <?php } elseif(get_theme_mod('dinero_testimonials_box_align','Right') == 'Right'){ ?> right <?php } ?> ">
                <div class="dinero-testimonials-image">
                    <img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/testimonial.jpg" alt="">
                </div>      
                <div class="dinero-testimonials-content">
                    <h4 class="dinero-testimonials-name" style="text-transform : <?php if(get_theme_mod('dinero_testimonials_title_case','Capitalize') == 'Capitalize'){ ?> capitalize <?php } elseif(get_theme_mod('dinero_testimonials_title_case','Lowercase') == 'Lowercase'){ ?> lowercase <?php } elseif(get_theme_mod('dinero_testimonials_title_case','Uppercase') == 'Uppercase'){ ?> uppercase <?php } ?> ">John Smith</h4>
                    <h6 class="dinero-testimonials-designation">Designer</h6>              
                    <p>There are many variations of passages of Lorem Ipsum able the majority have suffered alteration in some form, by injed humour, or randomised words.</p>
                    <i class="fa fa-quote-right" aria-hidden="true"></i> 
                    <div class="clearfix"></div>
                </div>  
             </div>
        </div>
        
        <?php 
        }
      } ?>

    </div>
     <div class="clearfix"></div>
</div>
      <div class="clearfix"></div>
  </div>


</div>
 <script>
        $(document).ready(function() {
          $('#testimonials .owl-carousel').owlCarousel({
           slideSpeed : 1500,
            autoplay: true,
              loop: true,
              margin: 30,
              responsiveClass: true,
              responsive: {
                0: {
                  items: 1,
                  nav: true
                },
                600: {
                  items:2,
                  nav: true
                },
                1000: {
                  items:3,
                  nav: true,
                  loop: true,
                  margin: 30
              }
            }
          })
        })
      </script>
<?php }