<?php
/**
 *
 * @package LZ Fitness Premium
 */
// if(get_theme_mod('faq_section_disable') != 'on' ){ ?>
<section id="faq-teachers-section" class="ht-section lz-faq-teachers-section">
	<div class="lightbox">
		<div class="col-md-10 col-md-offset-1">
			
			<div class="col-md-6 pftab">
				<ul class="nav nav-tabs" role="tablist">
					<div class="slider"></div>
					<li role="presentation" class="active">
						<a href="#home" aria-controls="home" role="tab" data-toggle="tab">
							<?php
							$lz_fitness_blog_title = get_theme_mod('lz_fitness_blog_title', 'LATEST NEWS');
							if($lz_fitness_blog_title){ ?>
							<h2 class="lz-blog-heading"><?php echo esc_html($lz_fitness_blog_title); ?></h2>
							<?php } ?>
							<?php
							$lz_fitness_blog_sub_title = get_theme_mod('lz_fitness_blog_sub_title', 'SEE ALL LATEST NEWS');
							if($lz_fitness_blog_sub_title){ ?>
							<h6 class="lz-blog-subheading"><?php echo esc_html($lz_fitness_blog_sub_title); ?></h6>
							<?php } ?>
						</a>
					</li>
					<li role="presentation">
						<a href="#FAQ" aria-controls="profile" role="tab" data-toggle="tab">
							<?php
							$faq_section_title = get_theme_mod('faq_section_title', 'FAQ');
							if($faq_section_title){ ?>
							<h2 class="lz-faq-heading"><?php echo esc_html($faq_section_title); ?></h2>
							<?php } ?>
							<?php
							$faq_section_subtitle = get_theme_mod('faq_section_subtitle', 'FREQUENTLY ASKED QUESTIONS');
							if($faq_section_subtitle){ ?>
							<h6 class="lz-faq-subheading"><?php echo esc_html($faq_section_subtitle); ?></h6>
							<?php } ?>
						</a>
					</li>    
				</ul>
				<div class="tab-content">
					<div role="tabpanel" class="tab-pane active" id="home">
						<?php 
						$lz_fitness_blog_post_count = get_theme_mod('lz_fitness_blog_post_count', 2 );
						$lz_fitness_blog_cat_exclude = get_theme_mod('lz_fitness_blog_cat_exclude');
						$lz_fitness_blog_cat_exclude = explode(',', $lz_fitness_blog_cat_exclude);
						$args = array(
							'posts_per_page' => $lz_fitness_blog_post_count,
						);
						if(!empty($lz_fitness_blog_cat_exclude)){
							$args['category__not_in'] = $lz_fitness_blog_cat_exclude;
						}
						$arg['paged']=1;
						$query = new WP_Query($args);
						if($query -> have_posts()):
							while($query -> have_posts()) : $query -> the_post();
								$lz_fitness_image = wp_get_attachment_image_src(get_post_thumbnail_id() , 'total-blog-thumb');
								?>
								<?php 
								if(has_post_thumbnail()){
									$img = esc_url($lz_fitness_image[0]);
								}
								if(empty($lz_fitness_image)){
									$img = get_template_directory_uri().'/images/about.jpg';
								}
								?>
								<div class="ht-blog-post">											
									<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
									<div class="blog-date"><i class="fa fa-user" aria-hidden="true"></i> <?php //echo get_the_date(); ?> <span><?php the_author(); ?></span> <span>|</span> <i class="fa fa-comments" aria-hidden="true"></i> <span><?php $commentscount = get_comments_number(); echo $commentscount; ?></span>  </div>
									<div class="ht-blog-excerpt">
										<?php 
										if(has_excerpt()){
											echo get_the_excerpt();
										}else{
											echo lz_fitness_excerpt( get_the_content() , 190 );
										}
										?>
										<!--<a href="<?php //the_permalink(); ?>"><?php //_e('Read More', 'total'); ?></a>-->
									</div>
								</div>
								<?php
							endwhile;
						endif;
						wp_reset_postdata();
						?>
					<div class="clearfix"></div>	
					</div>
					<div role="tabpanel" class="tab-pane" id="FAQ">
						<?php echo faqShortcode(1);?>  
						<div class="clearfix"></div>
					</div>    
				</div>
				<div class="clearfix"></div>
			</div>



			<div class="col-md-6">
				<div class="testimonials-member-wrap">
					<?php
					$lz_fitness_testimonials_title = get_theme_mod('lz_fitness_testimonials_title', 'QUALIFIED TEACHERS');
					$lz_fitness_testimonials_sub_title = get_theme_mod('lz_fitness_testimonials_sub_title', 'STUDENT AND PARENTS OPINION');
					?>

					<div class="ht-section-title-tagline">
						<h2 class="ht-section-title lz-testimonials-heading"><?php if(!empty($lz_fitness_testimonials_title)) { echo esc_html($lz_fitness_testimonials_title);}?></h2>
						<div class="ht-section-tagline lz-testimonials-text"><?php if(!empty($lz_fitness_testimonials_sub_title)){echo esc_html($lz_fitness_testimonials_sub_title);}?></div>
						<div class="clearfix"></div>
					</div>
					<!-- Carousel slider -->
					<div class="col-md-12" data-wow-delay="0.2s">
						<div class="carousel slide" data-ride="carousel" id="quote-carousel">
							<?php
							$showStatic = true;
							$testimonialTxt = '';
							$counter = -1 ;
							?>
							<!-- Bottom Carousel Indicators -->
							<ol class="carousel-indicators">
								<?php
								for( $i = 1; $i < 5; $i++ ){
									$lz_fitness_testimonials_page_id = get_theme_mod('lz_fitness_testimonials_page'.$i); 
									$lz_fitness_testimonials_page_icon = get_theme_mod('lz_fitness_testimonials_page_icon'.$i);
									if(get_post_status($lz_fitness_testimonials_page_id) != 'publish'){
										continue;
									}else{
										++$counter;
									}
									if($lz_fitness_testimonials_page_id){
										$showStatic = false;
										$testimonialTxt .= testimonialShortCode($lz_fitness_testimonials_page_id, $isCustomizer=false, $counter);
									}
									$lz_fitness_image = wp_get_attachment_image_src(get_post_meta( $lz_fitness_testimonials_page_id, '_thumbnail_id', true ),'total-team-thumb');
									if($showStatic == false && !empty($lz_fitness_image[0])){
										?>
										<li data-target="#quote-carousel" data-slide-to="<?php echo $counter;?>" <?php if($i==1){?>class="active"<?php }?>></li>
										<?php } 
										if(empty($lz_fitness_image[0]) && !empty($lz_fitness_testimonials_page_id)){?>
										<li data-target="#quote-carousel" data-slide-to="<?php echo $counter;?>" <?php if($i==0){?>class="active"<?php }?>><!--<img class="img-responsive " src="<?php //echo get_template_directory_uri(); ?>/images/team-thumb.png" alt="">-->
										</li>
										<?php }
									}

									if($showStatic === true){
										for($i=0;$i<=3;$i++){?>
										<li data-target="#quote-carousel" data-slide-to="<?php echo $i;?>" <?php if($i==0){?>class="active"<?php }?>><!--<img class="img-responsive " src="<?php //echo get_template_directory_uri(); ?>/images/team-thumb.png" alt="">-->
										</li>
										<?php }
									}
									?>
								</ol>
								<!-- Carousel items -->
								<!-- Carousel Slides / Quotes -->
								<div class="carousel-inner">
									<?php 
									echo $testimonialTxt;
									if($showStatic == true){
										for($i=0;$i<=3;$i++){?>
										<div class="item <?php if($i==0){?>active<?php }?>">
											<blockquote>
												<div class="row">
												<!--<div class="col-sm-3 team-thumb">
													<img class="img-responsive" src="<?php //echo get_template_directory_uri(); ?>/images/titem.jpg" alt="">												
												</div>-->
												<div class="col-md-12">
													<h6 class="secondry-text">Someone famous</h6>
													<!--<div class="text-designation">CEO</div>-->
													<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>                                     
												</div>
											</div>
										</blockquote>
									</div>

									<?php }
								}
								?>
							</div>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>
				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>
		</div>
		<div class="clearfix"></div>
	</div>
</section>

<!--tab script-->
<script>
	$(".nav-tabs a").click(function() {
		var position = $(this).parent().position();
		var width = $(this).parent().width();
		$(".slider").css({"left":+ position.left,"width":width});
	});
	var actWidth = $(".nav-tabs .active").width();
	var actPosition = $(".nav-tabs .active").position();
	$(".slider").css({"left":+ actPosition.left,"width": actWidth});
</script>
<!--end tab script-->
<?php // }
