<?php
$bosa_job_portal_blog_top_companies_one_ID 		= get_theme_mod( 'bosa_job_portal_blog_top_companies_one','' );
$bosa_job_portal_blog_top_companies_two_ID 		= get_theme_mod( 'bosa_job_portal_blog_top_companies_two','' );       
$bosa_job_portal_blog_top_companies_three_ID 	= get_theme_mod( 'bosa_job_portal_blog_top_companies_three','' );
$bosa_job_portal_blog_top_companies_four_ID 	= get_theme_mod( 'bosa_job_portal_blog_top_companies_four','' );
$bosa_job_portal_blog_top_companies_five_ID 	= get_theme_mod( 'bosa_job_portal_blog_top_companies_five','' );
$bosa_job_portal_blog_top_companies_six_ID 		= get_theme_mod( 'bosa_job_portal_blog_top_companies_six','' );

$bosa_job_portal_top_companies_array = array();
$bosa_job_portal_has_top_companies = false;
if( !empty( $bosa_job_portal_blog_top_companies_one_ID ) ){
	$bosa_job_portal_blog_top_companies_one  = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_one_ID,'bosa-job-portal-420-300');
 	if ( is_array(  $bosa_job_portal_blog_top_companies_one ) ){
 		$bosa_job_portal_has_top_companies = true;
   	 	$bosa_job_portal_blog_top_companies_one = $bosa_job_portal_blog_top_companies_one[0];
   	 	$bosa_job_portal_top_companies_array['image_one'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_one,
		);	
  	}
}
if( !empty( $bosa_job_portal_blog_top_companies_two_ID ) ){
	$bosa_job_portal_blog_top_companies_two = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_two_ID,'bosa-job-portal-420-300');
	if ( is_array(  $bosa_job_portal_blog_top_companies_two ) ){
		$bosa_job_portal_has_top_companies = true;	
        $bosa_job_portal_blog_top_companies_two = $bosa_job_portal_blog_top_companies_two[0];
        $bosa_job_portal_top_companies_array['image_two'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_two,
		);	
  	}
}
if( !empty( $bosa_job_portal_blog_top_companies_three_ID ) ){	
	$bosa_job_portal_blog_top_companies_three = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_three_ID,'bosa-job-portal-420-300');
	if ( is_array(  $bosa_job_portal_blog_top_companies_three ) ){
		$bosa_job_portal_has_top_companies = true;
      	$bosa_job_portal_blog_top_companies_three = $bosa_job_portal_blog_top_companies_three[0];
      	$bosa_job_portal_top_companies_array['image_three'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_three,
		);	
  	}
}
if( !empty( $bosa_job_portal_blog_top_companies_four_ID ) ){	
	$bosa_job_portal_blog_top_companies_four = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_four_ID,'bosa-job-portal-420-300');
	if ( is_array(  $bosa_job_portal_blog_top_companies_four ) ){
		$bosa_job_portal_has_top_companies = true;
      	$bosa_job_portal_blog_top_companies_four = $bosa_job_portal_blog_top_companies_four[0];
      	$bosa_job_portal_top_companies_array['image_four'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_four,
		);	
  	}
}
if( !empty( $bosa_job_portal_blog_top_companies_five_ID ) ){	
	$bosa_job_portal_blog_top_companies_five = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_five_ID,'bosa-job-portal-420-300');
	if ( is_array(  $bosa_job_portal_blog_top_companies_five ) ){
		$bosa_job_portal_has_top_companies = true;
      	$bosa_job_portal_blog_top_companies_five = $bosa_job_portal_blog_top_companies_five[0];
      	$bosa_job_portal_top_companies_array['image_five'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_five,
		);	
  	}
}
if( !empty( $bosa_job_portal_blog_top_companies_six_ID ) ){	
	$bosa_job_portal_blog_top_companies_six = wp_get_attachment_image_src( $bosa_job_portal_blog_top_companies_six_ID,'bosa-job-portal-420-300');
	if ( is_array(  $bosa_job_portal_blog_top_companies_six ) ){
		$bosa_job_portal_has_top_companies = true;
      	$bosa_job_portal_blog_top_companies_six = $bosa_job_portal_blog_top_companies_six[0];
      	$bosa_job_portal_top_companies_array['image_six'] = array(
			'ID' => $bosa_job_portal_blog_top_companies_six,
		);	
  	}
}

if( !get_theme_mod( 'bosa_job_portal_disable_top_companies_section', true ) && $bosa_job_portal_has_top_companies ) { ?>
	<section class="section-top-companies-area">
		<?php if ( !empty( get_theme_mod( 'bosa_job_portal_top_companies_title', '' ) ) ) { ?>
		<h2 class="top-companies-title">
			<?php echo esc_html( get_theme_mod( 'bosa_job_portal_top_companies_title', '' ) ); ?>
		</h2>

		<?php } ?>
		<div class="tio-companies-content-wrap">
			<div class="row justify-content-center top-companies-row">
				<?php foreach( $bosa_job_portal_top_companies_array as $bosa_job_portal_each_top_companies ){ ?>
					<div class="col-sm-6 col-md-4 top-companies-column">
						<figure class= "featured-image">
							<img src="<?php echo esc_url( $bosa_job_portal_each_top_companies['ID'] ); ?>">
						</figure>
					</div>
				<?php } ?>
			</div>	
		</div>	
	</section>
<?php }