<?php
/**
 * Template part for displaying page content in page.php
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package jcconsulting
 */

?>
<?php
if (have_rows('content')):
    while (have_rows('content')) :
        the_row();
        if (get_row_layout() == 'hero_section'): ?>
		<section class="banner_section  container-fluid" style="background: url(<?php the_sub_field('hbg_img'); ?>) center top/ cover no-repeat;">
			<div class="row">
				<div class="container">
					<div class="col-sm-6">
						<div class="row">
						<div class="banner_text">
							<h2><?php the_sub_field('htitle'); ?></h2>
							<?php
								$bbutton=get_sub_field('hbtn_text');
								$url=get_sub_field('hbtn_link');
								if(!empty($bbutton) && !empty($url)):?>
							<a href="<?php echo $url; ?>" class="btn btn-primary m_t_30"><?php echo $bbutton; ?></a>
							<?php endif; ?>
						</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'left_img_with_content'): ?>
		<section class="container-fluid z_index_1"   style="background: url(<?php the_sub_field('liwc_bg_img'); ?>) center top / cover no-repeat; margin-top:-150px; padding-top:100px;">
			<div class="row">
				<div class="container">
					<div class="row flex_col about_box m_t_90 p_t_50 p_b_90 m_b_90">
						<div class="col-sm-6 col-xs-12 about_left" style="background: url(<?php the_sub_field('liwc_img'); ?>) center center / cover no-repeat;">
							
						</div>
						<div class="col-sm-6 col-xs-12 about_right">
							<img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="img-top"/>
							<img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="img-bottom"/>
							<h2><?php the_sub_field('liwc_title'); ?></h2>
							
							<img src="<?php echo get_stylesheet_directory_uri();?>/images/title_line.svg" class="img-responsive title_line">
							
							<?php the_sub_field('liwc_content'); ?>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'services_sections'): ?>
		<section class="container-fluid z_index_1 service_section"   style="background: url(<?php the_sub_field('ssbg_img'); ?>) center top/ cover no-repeat; margin-top:-70px;">
			<div class="row">
				<div class="container">
					<div class="row flex_col m_t_90    m_b_90">
						 <div class="title_text col-md-12 text-center">
						 	<h2><?php the_sub_field('sstitle'); ?></h2>
						 </div>
						 <div class="col-md-12 m_t_40">
						 	<div class="row flex_col">
							<?php
								$featured_posts = get_sub_field('services');
								if( $featured_posts ): 
									foreach( $featured_posts as $post ):
										setup_postdata($post); ?>
						 		<div class="col-md-4 col-sm-4 col-xs-12 flex_col">
						 			<div class="services_box">
						 				<img src="<?php the_field( 'ssicon' ); ?>" class="service_img">
						 				<h3><?php the_title(); ?></h3>
						 				<img src="<?php echo get_stylesheet_directory_uri();?>/images/title_line.svg" class="img-responsive center-block m_t_20 m_b_20 title_line">
						 				<p><?php the_excerpt(); ?></p>
						 			</div>
						 		</div>
						 		<?php endforeach; 
										wp_reset_postdata(); ?>
									<?php endif; ?>
						 		
						 	</div>
						 </div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'center_content_with_bg'): ?>
		<section class="container-fluid z_index_1 cta_section"   style="background: url(https://nikunj.creativamotions.com/jc-consulting/wp-content/uploads/2021/05/ss-1.png) center center / cover no-repeat;">
			<div class="row">
				<div class="container">
					<div class="row flex_col m_t_90    m_b_90">
						 <div class="title_text2 col-md-12 text-center">
						 	<h2><?php the_sub_field('cccontent'); ?></h2>
						 	<h3><?php the_sub_field('cctext'); ?></h3>
						 </div>
						 
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'e_learning_section'): ?>
		<section class="container-fluid   e_learning_section" style="background: linear-gradient(#fff 60%,#F0F0F0 0%)"   >
			<div class="row m_b_90">
				<div class="container">
					<div class="row flex_col align_end m_t_90    ">
						 <div class="title_text3 col-md-10 col-sm-8 col-xs-12  ">
						 	 <h2><?php the_sub_field('els_title'); ?></h2>
						 	 <p><?php the_sub_field('els_content'); ?></p>
						 </div>
						 <div class="  col-md-2 col-sm-4 col-xs-12 ">
						 <?php
								$ebutton=get_sub_field('els_btn_text');
								$eurl=get_sub_field('els_btn_link');
								if(!empty($ebutton) && !empty($eurl)):?>
							<a href="<?php echo $eurl; ?>" class="btn btn-primary m_t_30 m_b_10"><?php echo $ebutton; ?></a>
							<?php endif; ?>
						 </div>
					</div>
				</div>
			</div>
			<div class="row m_b_90 pos_rel">
				<img src="<?php the_sub_field('elc_left_img'); ?>" class="lady_left" />
				<div class="container">
					<div class="col-md-10 col-md-offset-2 col-sm-10 col-sm-offset-2  col-xs-12">
						<div class="row flex_col">
						<?php
							if( have_rows('learning') ):
								while ( have_rows('learning') ) : the_row();?>
							<div class="flex_col col-md-4 col-sm-4 col-xs-12">
								<div class="e_learning_box">
									<img src="<?php the_sub_field('licon'); ?>" class="e_learning_img" />
									<h3><?php the_sub_field('ltitle'); ?></h3>
									<hr/>
									<?php the_sub_field('lcontent'); ?>
								</div>
							</div>
							<?php
									endwhile;
								endif;
									wp_reset_postdata();
							?>

						</div>
						
						<div class="row flex_col">
							<div class="col-md-10 col-md-offset-1 col-sm-12 col-xs-12 cta_box">
								<img src="<?php the_sub_field('elc_phone_icon'); ?>" />
								<div class="contnet">
									<p><?php the_sub_field('elc_text'); ?></p>
								</div>
								<div class="right_cta">
									<a href="<?php the_sub_field('elcli_link'); ?>"><h4><?php the_sub_field('elc_title'); ?></h4></a>
									<p><?php //the_sub_field('elc_phone_no'); ?></p>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'get_a_quote'): ?>
		<section class="container-fluid m_b_70"  style="background: linear-gradient( #F0F0F0 50%,#fff 0%)" >
			<div class="row    ">
				<div class="container">
					<div class="row m0">
						<div class="cta_section2">
							<div class="row flex_col align_center">
								<div class="col-md-8 col-sm-6 col-xs-12">
									<h2><?php the_sub_field('gaq_title'); ?></h2>
									<p><?php the_sub_field('gaq_content'); ?></p>
								</div>
								<div class="col-md-4 col-sm-6 col-xs-12">
									<?php $form=get_sub_field('shortcode');
												echo do_shortcode($form); ?>
										
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'inner_hero'): ?>
		<section class="banner_section z_index_1 container-fluid" style="background: url(<?php the_sub_field('ihbg_img'); ?>) center bottom/ cover no-repeat;">
			<div class="row">
				<div class="container">
					<div class="col-sm-12">
						<div class="row">
						 	<div class="sub_banner_text">
						 		<h2><?php the_sub_field('ih_title'); ?></h2>
						 	</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'center_content'): ?>
		<section class="container-fluid   e_learning_section"   >
			<div class="row m_b_90">
				<div class="container">
					<div class="row flex_col align_end m_t_90    ">
						 <div class="title_text  col-md-10 col-md-offset-1  text-center">
						 	 <h2><?php the_sub_field('cctitle'); ?></h2>
						 	 <img src="<?php echo get_stylesheet_directory_uri();?>/images/title_line.svg" class="img-responsive center-block m_t_20 m_b_30">
						 	 <p><?php the_sub_field('cccontent'); ?></p>
						 </div>
						  
					</div>
				</div>
			</div>
			 
		</section>
		<?php elseif (get_row_layout() == 'projects_sections'): ?>
		<section class="container-fluid z_index_1 service_section" style="background: url(<?php the_sub_field('prbg_img'); ?>) center top/ cover no-repeat; ">
			<div class="row">
				<div class="container">
					<div class="row flex_col m_t_90    m_b_90">
						 <div class="title_text col-md-12 ">
						 	<div class="row flex_col align_center">
						 		<div class="col-md-3 text-center">
						 			<h2 class="m0"><?php the_sub_field('prtitle'); ?></h2>
						 		</div>
						 		<div class="col-md-9 b_l">
						 			<h3 class="m0"><?php the_sub_field('prcontent'); ?></h3>
						 		</div>
						 	</div>
						 </div>
						 <div class="col-md-12 m_t_40">
						 	<div class="row flex_col">
							<?php
								$featured_posts = get_sub_field('projects');
								if( $featured_posts ): 
									foreach( $featured_posts as $post ):
										setup_postdata($post); ?>
						 		<div class="col-md-3 col-sm-6 col-xs-12 flex_col">
						 			<div class="services_box s2">
						 				<img src="<?php the_field( 'ssicon' ); ?>" class="service_img">
						 				<h3><?php the_title(); ?></h3>
						 				<img src="<?php echo get_stylesheet_directory_uri();?>/images/title_line.svg" class="img-responsive center-block m_t_20 m_b_20 title_line">
						 				<p><?php the_excerpt(); ?></p>
										</div>
						 		</div>
								<?php endforeach; 
										wp_reset_postdata(); ?>
									<?php endif; ?>
						 		 
						 	</div>
						 </div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'contact_service_sections'): ?>
		<section class="container-fluid  contact_section"  >
			<div class="row">
				<div class="container  m_t_90    m_b_90">
					<div class="row flex_col m0">
						 <div class="col-md-7  col-xs-12 contact_left z_index_1">
						 	<h2><?php the_sub_field('cstitle'); ?></h2>
						 	<p><?php the_sub_field('css_content'); ?></p>
						 	
						 	<hr/>
						 	<?php $scform=get_sub_field('scontact_form');
							echo do_shortcode($scform); ?>
						 </div>
						 <div class="col-md-5  col-xs-12 contact_right   m_t_30 m_b_30" style="background: url(<?php the_sub_field('cssbg_img'); ?>) center center / cover no-repeat">
						 	<img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="c_dot_left" />
						 	<img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="c_dot_right" />
						 	<h2><?php the_sub_field('css_title'); ?></h2>
<p><?php the_sub_field('css_rcontent'); ?></p>

<div class="contact_box m_t_60">
								<img src="<?php the_sub_field('email_icon'); ?>" />
								<a href="mailto:<?php the_sub_field('email_id'); ?>"><?php the_sub_field('email_id'); ?></a>
							</div>
							<div class="contact_box">
								<img src="<?php the_sub_field('phone_icon'); ?>" />
								<a href="tel:<?php the_sub_field('phone_no'); ?>"><?php the_sub_field('phone_no'); ?></a>
							</div>
						 </div>
						  
					</div>
				</div>
			</div>
		</section>
<?php elseif (get_row_layout() == 'why_choose'): ?>
<section class="container-fluid   e_learning_section"   >
			<div class="row m_b_50">
				<div class="container">
					<div class="row flex_col align_end m_t_90    ">
						 <div class="title_text  col-md-10 col-md-offset-1  text-center">
						 	 <h2><?php the_sub_field('wctitle'); ?></h2>
						 	  
						 </div>
						  <div class="col-md-12 m_t_40">
						  	<div class="row flex_col align_center">
						  		<div class="col-md-4">
								<?php
									if( have_rows('left_content') ):
										while ( have_rows('left_content') ) : the_row();?>
											<div class="contact_icon_box">
						  				<img src="<?php the_sub_field('wicon'); ?> " />
						  				<div>
						  					<h3><?php the_sub_field('wtitle'); ?></h3>
						  					<p><?php the_sub_field('wcontent'); ?></p>
						  				</div>
						  			</div>     
								<?php
										endwhile;
									endif;
										wp_reset_postdata();
								?>
						  		</div>
						  		<div class="col-md-4">
						  			<img src="<?php the_sub_field('wcc_img'); ?>" class="img-responsive center-block">
						  		</div>
						  		<div class="col-md-4">
						  			<?php
									if( have_rows('right_content') ):
										while ( have_rows('right_content') ) : the_row();?>
											<div class="contact_icon_box">
						  				<img src="<?php the_sub_field('ricon'); ?> " />
						  				<div>
						  					<h3><?php the_sub_field('rwtitle'); ?></h3>
						  					<p><?php the_sub_field('rcontent'); ?></p>
						  				</div>
						  			</div>     
								<?php
										endwhile;
									endif;
										wp_reset_postdata();
								?>
						  		</div>
						  	</div>
						  </div>
					</div>
				</div>
			</div>
			 
		</section>
<?php elseif (get_row_layout() == 'left_form_with_img'): ?>
<section class="container-fluid  contact_section"  style="background: url(<?php the_sub_field('lf_bg_img'); ?> ) center top / cover no-repeat; margin-bottom: -60px;" >
			<div class="row">
				<div class="container  m_t_90 p_b_90    m_b_90">
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12 cta_box c2 ">
								<img src="<?php the_sub_field('phone_icon'); ?>">
								<div class="contnet">
									<p><?php the_sub_field('lfei_content'); ?></p>
								</div>
								<div class="right_cta">
									<a href="<?php the_sub_field('lfei_link'); ?>"><h4><?php the_sub_field('phone_text'); ?></h4></a>
									<p><?php //the_sub_field('phone_no'); ?></p>
								</div>
							</div>
					</div>
					<div class="row flex_col m0">
						 <div class="col-md-7 col-xs-12  contact_left z_index_1">
						 	<h2><?php the_sub_field('form_title'); ?></h2>
						 	<p><?php the_sub_field('form_content'); ?></p>
						 	
						 	<hr/>
						 	<?php
								$cform=get_sub_field('lfform');
								echo do_shortcode($cform);
							?>
						 </div>
						 <div class="col-md-5 col-xs-12 contact_right   m_t_30 m_b_30" style="background: url(<?php the_sub_field('lf_img'); ?>) center center / cover no-repeat">
						 	 
						 </div>
						  
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'right_img_with_content'): ?>
		<section class="container-fluid    "   >
			<div class="row m_b_90 m_t_90">
				<div class="container">
					<div class="row flex_col   align_center      ">
						 <div class="title_text_about  col-md-7  col-sm-6 col-xs-12 ">
						 		<?php the_sub_field('riwc_content'); ?>
								<?php
									$rbutton=get_sub_field('rw_btn_text');
									$rurl=get_sub_field('rw_btn_link');
									if(!empty($rbutton) && !empty($rurl)): ?>
<a href="<?php echo $rurl; ?>" class="btn btn-primary btn-big"><?php echo $rbutton; ?></a>
<?php endif; ?>
						 </div>
						  <div class="title_text  col-md-5   col-sm-6 col-xs-12">
						 	  <img src="<?php the_sub_field('right_img'); ?>" class="img-responsive" />
						 </div>
						  
					</div>
				</div>
			</div>
			 
		</section>
		<?php elseif (get_row_layout() == 'counter_section'): ?>
		<section class="container-fluid    "   >
			<div class="row    flex_col">
				 <div class="col-md-5  col-sm-6 col-xs-12 about_page_side_left" style="background: url(<?php the_sub_field('cbg_img'); ?>) center center / cover no-repeat;">
				 	
				 </div>
				 <div class="col-md-7  col-sm-6 col-xs-12 about_page_side_right" style="background: url(<?php the_sub_field('cbr_img'); ?>) center center / cover no-repeat;">
				 		<div class="about_page_side_right_content">
				 			<h2><?php the_sub_field('cs_title'); ?></h2>
								<img src="<?php echo get_stylesheet_directory_uri();?>/images/title_line.svg" class="img-responsive m_t_20 m_b_20">
														 	  
								<p><?php the_sub_field('cs_content'); ?>

								</p>

								<div class="row m_t_50">
								<?php
									if( have_rows('counter') ):
										while ( have_rows('counter') ) : the_row();?>
									<div class="col-md-4  col-sm-12 col-xs-12">
										<div class="counter_box">
											<img src="<?php the_sub_field('cicon'); ?>" />
											<div>
												<h2><?php the_sub_field('cno'); ?></h2>
												<p><?php the_sub_field('ctext'); ?> </p>
											</div>
										</div>
									</div>
									<?php
										endwhile;
									endif;
										wp_reset_postdata();
								?>
								</div>
				 		</div>
				 </div>
			</div>
		</section> 
		<?php elseif (get_row_layout() == 'testimonials_sections'): ?>
		 <section class="container-fluid    "   >
			<div class="row m_b_90 m_t_90">
				<div class="container">
					<div class="row    ">
						 <div class="title_text_about text-center  col-md-12  ">
						 		<h4><?php the_sub_field('ts_title'); ?> </h4>
						 	  <h2><?php the_sub_field('tss_title'); ?> </h2> 
						 	  
						 </div>
						  <div class="col-md-10 col-md-offset-1 pos_rel testtt">
							  <img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="dot_left"/>
						  				<img src="<?php echo get_stylesheet_directory_uri();?>/images/dots_a.png" class="dot_right"/>
						  	<div class="owl-carousel " id="testimonail">
							<?php
									if( have_rows('testimonials') ):
										while ( have_rows('testimonials') ) : the_row();?>
						  		<div class="item">
						  			<div class="test_box">
						  				
						  				<div class="test_img">
						  					<img src="<?php the_sub_field('timg'); ?>" class="user_img" />
						  					<!--<img src="<?php //echo get_stylesheet_directory_uri();?>/images/quote.png" class="quote_img" />-->
						  				</div>
						  				<h3><?php the_sub_field('tname'); ?></h3>
						  				<h4><?php the_sub_field('tpostions'); ?></h4>
						  				<p><?php the_sub_field('tcontent'); ?></p>
						  			</div>
						  		</div>
								<?php
										endwhile;
									endif;
										wp_reset_postdata();
								?>
						  	</div>
						  </div>
						</div>
				</div>
			</div>
			 
		</section>
		<?php elseif (get_row_layout() == 'e-learning_section'): ?>
		<section class="container-fluid    "   >
			<div class="row m_b_90 m_t_90">
				<div class="container">
					<div class="row flex_col   align_center      ">
						 <div class="title_text3   col-md-7 col-sm-6 col-xs-12">
						 	 <h2 class="m0"><?php the_sub_field('els_title'); ?><br/>
<?php the_sub_field('elsb_title'); ?></h2>
						 </div>
						  <div class="title_text3  col-md-5   col-sm-6 col-xs-12 b_left">
						 	    <p class="m0"><?php the_sub_field('els_content'); ?></p>
						 </div>
						  
					</div>
					
					<div class="row m_t_20">
					<?php
					  $args =  array('post_type' =>'learning',
					  'posts_per_page'=>'-1'
					);
					   query_posts( $args );
					   
						while ( have_posts() ) : the_post();
						 ?>
						<div class="col-md-4 col-sm-6 col-xs-12">
							<div class="consulting_box">
								<img src="<?php the_post_thumbnail_url(); ?>" class="main_study_img">
								<div class="consulting_desc">
									<h3><?php the_title(); ?></h3>
									<div class="consulting_icons">
									
										<div class="c_icon">
											<img src="<?php echo get_stylesheet_directory_uri();?>/images/calender_icon.svg" />
											<h4><?php echo get_the_date('j M,Y'); ?></h4>
										</div>
										<div class="c_icon">
											<img src="<?php echo get_stylesheet_directory_uri();?>/images/user_icon.svg" />
											<h4><?php the_field('studentstotla'); ?></h4>
										</div>
									</div>
									<p><?php the_excerpt(); ?></p>
								</div>
							</div>
						</div>
						<?php endwhile;
				wp_reset_query(); ?>
					</div>
				</div>
			</div>
			 
		</section>
		<?php elseif (get_row_layout() == 'title_with_2_button'): ?>
		 <section class="container-fluid   gradient_bg_cta "   style="background: url(<?php the_sub_field('twb_bg_img'); ?>) center center / cover no-repeat;" >
			<div class="row m_b_90 m_t_70">
				<div class="container">
					<div class="row flex_col   align_center      ">
						<div class="col-md-12 text-center  col-sm-12 col-xs-12">
							<h2><?php the_sub_field('twb_title'); ?></h2>
							<br/> 
							
							<?php
									$cbutton1=get_sub_field('twb_btn_text1');
									$curl1=get_sub_field('twb_btn_link1');
									if(!empty($cbutton1) && !empty($curl1)): ?>
							<a href="<?php echo $curl1; ?>" class="btn btn-primary1"><?php echo $cbutton1; ?></a>
							<?php endif; ?>
							<?php
									$cbutton2=get_sub_field('twb_btn_text2');
									$curl2=get_sub_field('twb_btn_link2');
									if(!empty($cbutton2) && !empty($curl2)): ?>
							<a href="<?php echo $curl2; ?>" class="btn btn-primary2"><?php echo $cbutton2; ?></a>
							<?php endif; ?>
							
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php elseif (get_row_layout() == 'tools_sections'): ?>
		<section class="container-fluid     " style="background: url(<?php the_sub_field('ts_bg_img'); ?>) center top / cover no-repeat; margin-bottom: -50px;"   >
			<div class="row">
				<div class="container bigger">
					<div class="row flex_col  m_b_90 p_b_50 m_t_90  align_center      ">
						<div class="col-md-4 col-sm-6 col-xs-12">
							<div class="tools_box">
								<h4><?php the_sub_field('ts_title'); ?></h4>
								<h2><span><?php the_sub_field('tssa_title'); ?></span><?php the_sub_field('tss_title'); ?></h2>
								<img src="https://nikunj.creativamotions.com/jc-consulting/wp-content/themes/jcconsulting/images/title_line.svg" class="img-responsive m_t_20 m_b_20 title_line">
								<p><?php the_sub_field('ts_content'); ?><p>
								<?php
									$tbutton=get_sub_field('ts_btn_text');
									$turl=get_sub_field('ts_btn_link');
									if(!empty($tbutton) && !empty($turl)): ?>
							<a href="<?php echo $turl; ?>" class="btn btn-primary m_t_20"><?php echo $tbutton; ?></a>
							<?php endif; ?>
								
							</div>
						</div>
						<div class="col-md-8 col-sm-6 col-xs-12">
							<div class="row we_provide_section">
							<?php 
							$i=1;
							if( have_rows('tools') ):
								while ( have_rows('tools') ) : the_row();?>
								<div class="col-md-5 col-xs-12 <?php if($i==3):echo'col-md-offset-2';endif; ?>">
									<div class="we_provide_best">
										<div class="img_box">
											<img src="<?php the_sub_field('img'); ?>" />
										</div>
										<div class="img_desc">
											<h3><?php the_sub_field('title'); ?></h3>
											<p><?php the_sub_field('content'); ?></p>
										</div>
									</div>
								</div>
								<?php $i++;
										endwhile;
											endif;
										wp_reset_postdata();
									?>	
								
								
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<?php
        endif;
    endwhile;
endif;
?>