<?php
/**
 *
 * @package LZ Fitness Premium
 */
if(get_theme_mod('project_section_disable') != 'on' ){ ?>
<section id="ht-project-section" class="lz-project-section">
	<div class="lightbox">
		<?php
		// echo "post id: ". 
		$project_page_id = get_theme_mod('project_page');	
		  // echo '<br>title '.		
		$project_title = get_theme_mod('project_title', 'FEATURE <b>PROJECTS</b>');
		$project_sub_title = get_theme_mod('project_sub_title', 'Lorem Ipsum is simply text');
		?>
		<div class="col-md-10 col-md-offset-1">
		<?php if( $project_title || $project_sub_title ){ ?>
		<div class="row">
			<div class="col-md-12">
				<div class="ht-section-title-tagline">
					
					<?php if($project_sub_title){ ?>
					<div class="ht-section-tagline lz-project-text"><?php echo ($project_sub_title); ?></div>
					<?php } ?>
					<?php if($project_title){ ?>
					<h2 class="ht-section-title lz-project-heading"><?php echo($project_title); ?></h2>
					<?php } ?>
				</div>
			</div>
		</div>
		<?php } ?>
		<div class="clearfix"></div>
	</div>
	<div class="col-md-10 col-md-offset-1">
	<!-- <div class="ht-team-member-wrap ht-clearfix"> -->
		<?php 
		$showStatic = true;
		$cols = get_theme_mod('project_npp_count', 2);
		$cols++;
		switch($cols){
			case 1:
				$colCls = 'col-md-12 col-sm-12';
				break;
			case 2:
				$colCls = 'col-md-6 col-sm-6';
				break;
			case 4:			
				$colCls = 'col-md-3 col-sm-6';
				break;
			case 5:
			case 6:	
			default: 
				$colCls = 'col-md-4 col-sm-6';
				break;
		}
		for( $i = 1; $i <= $cols; $i++ ){
			$project_page_id = get_theme_mod('project_page'.$i); 
			$project_page_icon = get_theme_mod('project_page_icon'.$i);
			if($project_page_id){
				$showStatic = false;
				echo projectShortCode($project_page_id, $isCustomizer=true, $i);
			}
		}
		// adding the static content
		if($showStatic === true){
			for( $i = 1; $i <= $cols; $i++ ){ ?>
			<div class="<?php echo $colCls;?>">
				<div class="ht-project-member paddingBot20">
					<div class="ht-project-member-image">
						<img class="secondry-bg img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/projects.jpg');?>" alt="Team" />
					</div>
					<div class="clearfix"></div>
					<div class="project-main-box">
					<div class="ht-title-Project">
				 		<h6 class="member-name">Client Best Houses</h6>
				 	</div>
				 	<div class="ht-Project-contents">
				 		<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s</p>
				 	</div>
				 	<div class="project-button">
				 		<a class="btn" href="#"> VIEW PROJECT</a>
				 	</div>
				 </div>
				</div>	
					<div class="clearfix"></div>			 
			</div>
			<?php 
			}
		} ?>
		<div class="clearfix"></div>
		<?php 
        $showStatic = true;
        for ($i = 1; $i <= 1; $i++) {
            $project_page_id = get_theme_mod('project_page' . $i);            
            $link = get_theme_mod('project_button_url_'.$i);
            $url = get_theme_mod('project_button_url_'.$i, '#');


            if ($project_page_id || $url) {
                $showStatic = false;
                ?>
                <div class="readmore-btn">
                    <a href="<?php echo esc_url(!empty($url)?$url:'#');?>"><?php _e('VIEW MORE PROJECTS', 'lz-fitness-premium'); ?></a>
                </div>
                <?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('VIEW MORE PROJECTS', 'lz-fitness-premium'); ?></a> 
                </div>
                <?php
            }
        }
	?>
	<div class="clearfix"></div>
	</div>	
	<div class="clearfix"></div>
</div>
</section>
<script>
		$(function(){
			function projectmainboxHeight(){
				var ht = 120;
				$('.project-main-box p').each(function(i){
					var tHt = $(this).height();
					if(ht<tHt){
						ht=tHt;
					}
				});
				$('.project-main-box p').height(ht+'px');
			}
			projectmainboxHeight();
		});
		$( window ).resize(function(){
			projectmainboxHeight();
		});
	</script>
<?php }

