<?php

if(get_theme_mod('clientlogo_area_disable') != 'on' ){
	?>
	<?php 
		if( get_theme_mod('clientlogo_areaTpadding',true) ) {
			$clientlogo_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('clientlogo_areaTpadding')).';';
		}
		if( get_theme_mod('clientlogo_areaBpadding',true) ) {
			$clientlogo_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('clientlogo_areaBpadding')).';';
		}

	?>		

	<div class="clientlogo-area" id="clientlogo" style="<?php echo esc_attr($clientlogo_areaTpadding); ?>" "<?php echo esc_attr($clientlogo_areaBpadding); ?>">
			<div class="container"> 
		 <?php
	          $showStatic = true;
	          for( $i = 1; $i < 9; $i++ ){
	            $clientlogo_page_id = get_theme_mod('clientlogo_page_icon'.$i); 
	            if(!empty($clientlogo_page_id)){
	              $showStatic = false;
	              break;
	            }
	          }
         ?> 
  
					<div class="clientlogo-single-area">  
							<div class="owl-carousel owl-theme">
								<?php
								$cols = get_theme_mod('clientlogo_npp_count', 5);
								$cols++;
											// echo '$cold: '.$cols;
								switch($cols){
									case 1:
									$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
									break;
									case 2:	
									$colCls = 'col-lg-6 col-md-6 col-sm-6 col-xs-12';
									break;
									case 3:
									case 5:
									case 6:
									case 9:
									case 11:
									case 13:
									case 15:
									$colCls = 'col-lg-4 col-md-4 col-sm-6 col-xs-12';
									break;
									default: 
									$colCls = 'col-lg-3 col-md-6 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');
								?>
 						
		            <?php
		            for( $i = 1; $i <= $cols; $i++ ){
		              if($showStatic === false){
		               	$clientlogo_page_id = get_theme_mod('clientlogo_page'.$i);
		            		$clientlogo_page_icon = get_theme_mod('clientlogo_page_icon'.$i);
		            if($clientlogo_page_icon){
		            ?>
		                <div class="item">
		                    <div class="clientlogo-single wow zoomIn">
		                      	<div class="clientlogo-box">
		                            <img src="<?php echo esc_url($clientlogo_page_icon); ?>" class="img-responcive" />
		                      	</div>
		                  	</div>
		              </div>
                <?php
                      }
                          
                }else{?>
									<div class="item ">
											<div class="clientlogo-single wow zoomIn">
													<div class="clientlogo-box">
															<img class="img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/client-logo.png');?>" alt="achivment" />
													</div>
											</div>
									</div>
                <?php }
              }?>
						</div>
				</div>
			</div>
	</div> 
	<!-- clientlogo Area Start -->
    <script>
        $(document).ready(function() {
          $('#clientlogo .owl-carousel').owlCarousel({
            refreshClass: 'owl-refresh',
            autoplayTimeout:4000,
            loop: true,
            margin: 30,
            autoHeight: true,
            autoWidth: false,
            autoplay: false,
            // rtl:true,
            responsiveClass: true,
            responsive: {
              0: {
                items: 1,
                nav: true,
                margin: 50
              },
              320: {
                items: 2,
                nav: true,
                margin: 50
              },
              501: {
                items: 3,
                nav: true,
                margin: 60
              },
              992: {
                items:4,
                nav: true,
                margin: 90
              },
              1200: {
                items:5,
                nav: true,
                loop: true,
                margin: 145
              }
            }
          })
        })
    </script>
	
<?php } 