<?php
/**
 *
 * @package Luzuk Premium
 */
if(get_theme_mod('lz_fitness_project_section_disable') != 'on' ){ ?>
<section id="ht-project-section" class="lz-project-section">
	<?php
		// echo "post id: ". 
		$lz_fitness_project_page_id = get_theme_mod('lz_fitness_project_page');	
		  // echo '<br>title '.		
		$lz_fitness_project_title = get_theme_mod('lz_fitness_project_title', 'RECENT PROJECTS');
		?>
		<div class="container">
		<?php if( $lz_fitness_project_title || $lz_fitness_project_sub_title ){ ?>
		<div class="row">
			<div class="col-md-12">
				<div class="ht-section-title-tagline">
					<?php if($lz_fitness_project_title){ ?>
					<h2 class="ht-section-title lz-project-heading"><?php echo($lz_fitness_project_title); ?></h2>
					<?php } ?>
					<div class="dlab-separator-outer m-b0">
		                <div class="dlab-separator text-primary style-icon"></div>
		            </div>
					<div class="clearfix"></div>
				</div>
			</div>
		</div>
		<?php } ?>
		<div class="clearfix"></div>
	</div>
	<div class="container"> 
	<!-- <div class="ht-team-member-wrap ht-clearfix"> -->
		<?php 
		$showStatic = true;
		$cols = get_theme_mod('lz_fitness_project_npp_count', 7);
		$cols++;
		switch($cols){
			case 1:
                $colCls = 'col-md-12 col-sm-12';
                break;
            case 2:
                $colCls = 'col-md-6 col-sm-6';
                break;
            case 3:
            case 5:
            case 6: 
            case 9: 
            $colCls = 'col-md-4 col-sm-6';
                break;
            case 4: 
            case 7: 
            case 8: 
            case 10:
            case 11:
            case 12:                    
                $colCls = 'col-md-3 col-sm-6';
                break;
			
			default: 
				$colCls = 'col-md-4 col-sm-6';
				break;
		}
		for( $i = 1; $i <= $cols; $i++ ){
			$lz_fitness_project_page_id = get_theme_mod('lz_fitness_project_page'.$i); 
			$lz_fitness_project_page_icon = get_theme_mod('lz_fitness_project_page_icon'.$i);
			if($lz_fitness_project_page_id){
				$showStatic = false;
				echo projectShortCode($lz_fitness_project_page_id, $isCustomizer=true, $i);
			}
		}
		// adding the static content
		if($showStatic === true){
			for( $i = 1; $i <= $cols; $i++ ){ ?>
			<div class="<?php echo $colCls;?> padding5">
				<div class="ht-project-member paddingBot20">
					
						<img class="secondry-bg img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/project.jpg');?>" alt="Team" />
					
					<div class="project-main-box team-content">
					<!--  <h3 class="post-title">Constructions Projects</h3> -->
					 <div class="project-button">
					 	<?php
					 	$viewprojectbutton1 = get_theme_mod('lz_fitness_viewprojectbutton1', 'VIEW PROJECT');
					 	?>
				 		<a class="btn" href="#"> <?php echo ($viewprojectbutton1 );  ?></a>
				 	</div>
				 </div>
				 <div class="team-prof">
				 	<h3 class="post-title">Finance Business</h3>
				 </div>

				</div>	
					<div class="clearfix"></div>			 
			</div>
			<?php 
			}
		} ?>
		<div class="clearfix"></div>
		<div class="Projectbtn text-center">
		<?php 
        $showStatic = true;
        for ($i = 1; $i <= 1; $i++) {
            $lz_fitness_project_page_id = get_theme_mod('lz_fitness_project_page' . $i);            
            $link = get_theme_mod('project_button_url_'.$i);
            $url = get_theme_mod('project_button_url_'.$i, '#');


            if ($lz_fitness_project_page_id || $url) {
                $showStatic = false;
                ?>
                <?php if( get_theme_mod('aboutproject_button_display','show' ) == 'show') :
							?>
                <div class="readmore-btn">
                    <?php
								$aboutprojectbutton = get_theme_mod('lz_fitness_aboutproject', 'All Projects'); 
								$aboutprojectlink = get_theme_mod('lz_fitness_header_aboutprojectlink', 'add link here');
								?>
							<?php if(!empty($aboutprojectlink)){ ?>
									<a href="<?php echo $aboutprojectlink ?>" title=""><?php echo ($aboutprojectbutton );  ?><i class="fa fa-arrow-right"></i></a>
								<?php }?>
                </div>
                <?php endif ?>
                <?php
            }
        }
        if ($showStatic === true) {
            for ($i = 1; $i <= 1; $i++) {
                $link = get_theme_mod('project_button_url_'.$i);
                 $url = get_theme_mod('project_button_url_'.$i, '#');

                ?>
                <div class="readmore-btn">
                   <a href="<?php echo esc_url(!empty($url)?$url:'#');?>"><?php _e('All Projects', 'lz-fitness-premium'); ?><i class="fa fa-arrow-right"></i></a> 
                </div>
                <?php
            }
        }
	?>
	</div>
	<div class="clearfix"></div>
	</div>	
	<div class="clearfix"></div>
</section>
<script>
	jQuery.noConflict();
	$(function(){
		function teamprofHeight(){
			var ht = 0;
			$('section#ht-project-section .team-prof').each(function(i){
				var tHt = $(this).height();
				if(ht<tHt){
					ht=tHt;
				}
			});
			$('section#ht-project-section .team-prof').height(ht+'px');
		}
		teamprofHeight();
	});
	$( window ).resize(function(){
		teamprofHeight();
	});
</script>
<?php }

