<?php
$bosa_education_zone_partner_image_one_ID 		= get_theme_mod( 'bosa_education_zone_partner_image_one','');
$bosa_education_zone_partner_image_two_ID 		= get_theme_mod( 'bosa_education_zone_partner_image_two','');       
$bosa_education_zone_partner_image_three_ID 	= get_theme_mod( 'bosa_education_zone_partner_image_three','');
$bosa_education_zone_partner_one_ID 			= get_theme_mod( 'bosa_education_zone_partner_one','');
$bosa_education_zone_partner_two_ID 			= get_theme_mod( 'bosa_education_zone_partner_two','');
$bosa_education_zone_partner_three_ID 			= get_theme_mod( 'bosa_education_zone_partner_three','');
 
$bosa_education_zone_partners_array = array();
$bosa_education_zone_has_partner_img = false;
$bosa_education_zone_has_partner_txt = false;
if( !empty( $bosa_education_zone_partner_image_one_ID ) ){
	$bosa_education_zone_partner_one  = wp_get_attachment_image_src( $bosa_education_zone_partner_image_one_ID,'bosa-education-zone-420-300');
 	if ( is_array(  $bosa_education_zone_partner_one ) ){
 		$bosa_education_zone_has_partner_img = true;
 		$bosa_education_zone_has_partner_txt = true;
   	 	$bosa_education_zone_partners_one = $bosa_education_zone_partner_one[0];
   	 	$bosa_education_zone_partners_array['image_one'] = array(
			'ID' => $bosa_education_zone_partners_one,
			'txt' => $bosa_education_zone_partner_one_ID,
		);	
  	}
}
if( !empty( $bosa_education_zone_partner_image_two_ID ) ){
	$bosa_education_zone_partner_two = wp_get_attachment_image_src( $bosa_education_zone_partner_image_two_ID,'bosa-education-zone-420-300');
	if ( is_array(  $bosa_education_zone_partner_two ) ){
		$bosa_education_zone_has_partner_img = true;
		$bosa_education_zone_has_partner_txt = true;	
        $bosa_education_zone_partners_two = $bosa_education_zone_partner_two[0];
        $bosa_education_zone_partners_array['image_two'] = array(
			'ID' => $bosa_education_zone_partners_two,
			'txt' => $bosa_education_zone_partner_two_ID,
		);	
  	}
}
if( !empty( $bosa_education_zone_partner_image_three_ID ) ){	
	$bosa_education_zone_partner_three = wp_get_attachment_image_src( $bosa_education_zone_partner_image_three_ID,'bosa-education-zone-420-300');
	if ( is_array(  $bosa_education_zone_partner_three ) ){
		$bosa_education_zone_has_partner_img = true;
		$bosa_education_zone_has_partner_txt = true;
      	$bosa_education_zone_partners_three = $bosa_education_zone_partner_three[0];
      	$bosa_education_zone_partners_array['image_three'] = array(
			'ID' => $bosa_education_zone_partners_three,
			'txt' => $bosa_education_zone_partner_three_ID,
		);	
  	}
}

if( !get_theme_mod( 'bosa_education_zone_disable_partners_section', true ) && $bosa_education_zone_has_partner_img && $bosa_education_zone_has_partner_txt ){ ?>
	<section class="partners-section">
		<div class="row">
			<?php foreach( $bosa_education_zone_partners_array as $bosa_education_zone_each_partners ){ ?>
				<div class="col-md-4 col-sm-6">
					<article class="partners-content-wrap">
						<figure class= "featured-image">
							<img src="<?php echo esc_url( $bosa_education_zone_each_partners['ID'] ); ?>">
						</figure>
						<?php if( !empty( $bosa_education_zone_each_partners['txt'] ) ) { ?>
							<div class="partners-txt">
								<?php
									echo esc_html( $bosa_education_zone_each_partners['txt'] );
								?>
							</div>
						<?php } ?>
					</article>
				</div>
			<?php } ?>
		</div>	
	</section>
<?php } 