
<div id="files-section" class="flex-section">
<bookmark id="fsec-<?php echo $count_l; ?>"></bookmark>
	<div class="container">
    
  		<?php if (get_sub_field('sec_title')) {?>
        	<h2 class="title"><?php the_sub_field('sec_title') ?></h2>
        <?php } ?>
        
        
        <?php if (get_sub_field('before_buttons')) {?>
        	<div class="before-buttons entry"><?php the_sub_field('before_buttons') ?></div>
        <?php } ?>
        


<div class="row">
  		
  
  		<?php  if( have_rows('buttons') ): while ( have_rows('buttons') ) : the_row(); 
	
	if (get_sub_field('external_link' )) {
	//$url = get_field('external_link');
	$target = 'target="_blank" rel="nofollow"';
	} else {
		$target = '';
	}  					

?>
		
		<div class="col-lg-3 col-md-6">
        <div class="files-box flexbox hvr-shrink mht">
        <?php if(get_sub_field ('btn_link')) { ?>
 		<a href="<?php the_sub_field ('btn_link'); ?>" <?php echo $target; ?>>
        <i class="flaticon-download"></i>
		<span><?php the_sub_field ('button'); ?></span>
       
      
         </a>
        <?php } elseif (get_sub_field ('file_attachment')){?>
        <a href="<?php the_sub_field ('file_attachment'); ?>" target="_blank" >
          <i class="flaticon-download"></i>
		<span><?php the_sub_field ('button'); ?></span>
             </a> 
        <?php } ?>
        </div><!--box-->
        </div><!--col--> 
   
		 <?php
		endwhile;
		endif; ?>
        
        </div><!--row-->
          
        
        </div><!--container-->
</div><!--section-->   
		
   