<?php
$bosa_job_portal_page_one 	= get_theme_mod( 'bosa_job_portal_reviews_page_one', '' );
$bosa_job_portal_page_two 	= get_theme_mod( 'bosa_job_portal_reviews_page_two', '' );
$bosa_job_portal_page_three	= get_theme_mod( 'bosa_job_portal_reviews_page_three', '' );
$bosa_job_portal_page_four 	= get_theme_mod( 'bosa_job_portal_reviews_page_four', '' );
$bosa_job_portal_page_five 	= get_theme_mod( 'bosa_job_portal_reviews_page_five', '' );
$bosa_job_portal_page_six	= get_theme_mod( 'bosa_job_portal_reviews_page_six', '' );

$bosa_job_portal_page_array = array();
$bosa_job_portal_has_page = false;
if( !empty( $bosa_job_portal_page_one ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_one'] = array(
		'ID' => $bosa_job_portal_page_one,
	);
}
if( !empty( $bosa_job_portal_page_two ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_two'] = array(
		'ID' => $bosa_job_portal_page_two,
	);
}
if( !empty( $bosa_job_portal_page_three ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_three'] = array(
		'ID' => $bosa_job_portal_page_three,
	);
}
if( !empty( $bosa_job_portal_page_four ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_four'] = array(
		'ID' => $bosa_job_portal_page_four,
	);
}
if( !empty( $bosa_job_portal_page_five ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_five'] = array(
		'ID' => $bosa_job_portal_page_five,
	);
}
if( !empty( $bosa_job_portal_page_six ) ){
	$bosa_job_portal_has_page = true;
	$bosa_job_portal_page_array['page_six'] = array(
		'ID' => $bosa_job_portal_page_six,
	);
}

if( !get_theme_mod( 'bosa_job_portal_disable_reviews_section', true ) && $bosa_job_portal_has_page ){ ?>
	<section class="section-reviews-area">
			<div class="row justify-content-center">
				<?php foreach( $bosa_job_portal_page_array as $bosa_job_portal_each_page ){ ?>
					<div class="col-md-6">
						<article class="review-item text-center">
								<div class="review-text">
									<?php 
									$bosa_job_portal_excerpt = get_the_excerpt( $bosa_job_portal_each_page[ 'ID' ] );
									$bosa_job_portal_result  = wp_trim_words( $bosa_job_portal_excerpt, 30, '' );
									echo esc_html( $bosa_job_portal_result );
									?>
								</div>
							<div class="review-content d-flex align-items-center justify-content-around flex-wrap mt-4">								
								<h3 class="review-title m-0">
									<a href="<?php echo esc_url( get_permalink( $bosa_job_portal_each_page[ 'ID' ] ) ); ?>">
										<?php echo esc_html( get_the_title( $bosa_job_portal_each_page[ 'ID' ] ) ); ?>
									</a>
								</h3>
								<div class="reviews-star-container">
									 <i class="fa-solid fa-star"></i>
									 <i class="fa-solid fa-star"></i>
									 <i class="fa-solid fa-star"></i>
									 <i class="fa-solid fa-star"></i>
									 <i class="fa-solid fa-star"></i>
								</div>												
							</div>
							<span class="review-quote-icon">
								<i class="fas fa-quote-left"></i>
							</span>
						</article>
					</div>
				<?php } ?>
			</div>
	</section>
<?php } 