<?php 
$section_status = get_theme_mod( 'advance_education_pro_course_categories_enable_disable' );
if ( 'Disable' == $section_status ) {
  return;
}
if( get_theme_mod('advance_education_pro_course_categories_bgcolor') ) {
  $section_backg = 'background-color:'.esc_attr(get_theme_mod('advance_education_pro_course_categories_bgcolor')).';';
}elseif( get_theme_mod('advance_education_pro_course_categories_bgimage') ){
  $section_backg = 'background-image:url(\''.esc_url(get_theme_mod('advance_education_pro_course_categories_bgimage')).'\')';
}else{
  $section_backg = '';
}
$att_style="";
  $image_att = get_theme_mod( 'advance_education_pro_course_categories_bgimage_attachment',true );
  if ( 'Scroll' == $image_att ) {
    $att_style="section_bg_scroll";
  }else{
    $att_style="section_bg_fixed";
  }  
?>
<section id="course_categories" style="<?php echo esc_attr($section_backg); ?>" class="<?php echo esc_attr($att_style)?>">
  <div class="container">
    <?php if(get_theme_mod('advance_education_pro_course_categories_title') != '' || get_theme_mod('advance_education_pro_course_categories_subtitle') != ''){?>
        <div class="section-heading">
          <h3>
            <?php if(get_theme_mod('advance_education_pro_title_icon')){
              ?> <i class="<?php echo esc_html(get_theme_mod('advance_education_pro_title_icon')) ?>"></i><?php
            }?>
            <?php echo esc_html(get_theme_mod('advance_education_pro_course_categories_title')); ?></h3>
          <p><?php echo esc_html(get_theme_mod('advance_education_pro_course_categories_subtitle'))?></p>
        </div>
    <?php } ?>
    <div class="row">
      <?php $num = get_theme_mod('advance_education_pro_course_categories_number');
       for ($i=1,$j=1; $i<=$num; $i++,$j++){
        if($j==8){ $j=1; }
         if(get_theme_mod('advance_education_pro_course_categories_number',true) != '') { ?>
          <div class="course_categories col-lg-3 col-md-4 col-sm-6 col-12" id="courses<?php echo esc_attr($i); ?>">
            <div class="image-box media">
              <?php if(get_theme_mod('advance_education_pro_course_categories_image'.$i, true) != '') {?>
                <img class="feature-img" src="<?php echo esc_url(get_theme_mod('advance_education_pro_course_categories_image'.$i)); ?>" alt="Image"/>
              <?php } ?>
              <div class="overlay">
                <?php if(get_theme_mod('advance_education_pro_course_categories_name'.$i,true) != '') { ?>
                  <div class="title-section">
                    <div class="title-div">
                      <a class="title" href="<?php echo esc_html(get_theme_mod('advance_education_pro_course_category_link'.$i))?>"><?php echo esc_html(get_theme_mod('advance_education_pro_course_categories_name'.$i))?></a>
                    </div>
                  </div>
                <?php } ?>
              </div>
           </div>
          </div> 
        <?php }
       } ?>
    </div>
  </div>
</section>