<?php
$count = count($data);
$count = ($count > 3) ? 3 : $count;
$i = 1;
?>
<?php if($count): ?>
    <?php
        switch ($count ) {
                case 1:
                    $class = 'col-xs-12 banner';
                    break;
                case 2:
                    $class = 'col-sm-6 banner';
                    break;
                case 3:
                    $class = 'col-sm-4 banner';
                    break;
            }
    ?>

<div class="row banners-wrap">
<?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
 if($i > 3) {break;}
?>

<div class="<?php echo e($class); ?>">
    <?php if(!is_null($a['ad_link']) && trim($a['ad_link']) != ''): ?>
        <a href="<?php echo e(url($a['ad_link'])); ?>" title="<?php echo e($a['ad_title']); ?>">
        <img src="<?php echo e(asset($a['ad_src'])); ?>" alt="<?php echo e($a['ad_title']); ?>" title="<?php echo e($a['ad_title']); ?>" class="img-responsive">
        </a>
    <?php else: ?>
    <img src="<?php echo e(asset($a['ad_src'])); ?>" alt="<?php echo e($a['ad_title']); ?>" title="<?php echo e($a['ad_title']); ?>" class="img-responsive">
    <?php endif; ?>
</div>

<?php
    ++$i
?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>

<?php endif; ?>