<?php
/**
 * Banner Section
 * 
 * @package prime_cyber_security
 */

$prime_cyber_security_slider = get_theme_mod('prime_cyber_security_slider_setting', false);
?>

<?php if ($prime_cyber_security_slider) : ?>
  <div class="slider-back">
    <div class="banner-main">
      <?php if (get_theme_mod('prime_cyber_security_slider_background_image')) : ?>
        <img class="inner-banner" src="<?php echo esc_url(get_theme_mod('prime_cyber_security_slider_background_image')); ?>">
      <?php else : ?>
        <div class="inner-banner">
          <img src="<?php echo get_stylesheet_directory_uri() . '/images/slide.png'; ?>">
        </div>
      <?php endif; ?>
      <div class="test container">
        <?php
        $prime_cyber_security_slider_image = get_theme_mod('prime_cyber_security_slider_counter', '');
        for ($prime_cyber_security_i = 1; $prime_cyber_security_i <= $prime_cyber_security_slider_image; $prime_cyber_security_i++) : ?>
          <div class="slider-image-box" data-dot-img="<?php echo esc_url(get_theme_mod('prime_cyber_security_slider_image' . $prime_cyber_security_i)); ?>">
            <div class="slider-content">
              <div class="container">
                <div class="row">
                  <div class="col-lg-7 col-md-7 col-sm-7 align-self-center">
                    <h2><?php echo esc_html(get_theme_mod('prime_cyber_security_slider_sub_heading' . $prime_cyber_security_i)); ?></h2>
                    <h1 class="mt-md-3"><?php echo esc_html(get_theme_mod('prime_cyber_security_slider_main_heading' . $prime_cyber_security_i)); ?></h1>

                    <?php if (get_theme_mod('prime_cyber_security_search_box_enable', true)) : ?>
                      <div class="header-search text-center">
                        <form method="get" id="searchform" class="searchform" action="<?php echo esc_url(home_url('/')); ?>">
                          <input placeholder="<?php esc_attr_e('Search Here....', 'prime-cyber-security'); ?>" type="text" name="s" id="search" value="<?php the_search_query(); ?>" />
                          <button type="submit" value="" class="search-button"><i class="fas fa-search"></i></button>
                        </form>
                      </div>
                    <?php endif; ?>

                    <?php
                    $prime_cyber_security_slider_populer_search_count = absint( get_theme_mod( 'prime_cyber_security_slider_populer_search', 1 ) );
                    if ( $prime_cyber_security_slider_populer_search_count > 0 ) : ?>
                      <div class="populer_search">
                        <span class="search_one"><?php esc_html_e( 'POPULAR SEARCH', 'prime-cyber-security' ); ?></span>
                        <?php
                        for ( $prime_cyber_security_m = 1; $prime_cyber_security_m <= $prime_cyber_security_slider_populer_search_count; $prime_cyber_security_m++ ) :
                          $text = get_theme_mod( 'prime_cyber_security_slider_populer_search_text' . $prime_cyber_security_m );
                          if ( ! empty( $text ) ) : ?>
                            <span><?php echo esc_html( $text ); ?></span>
                          <?php endif;
                        endfor;
                        ?>
                      </div>
                    <?php endif; ?>
                  </div>

                <div class="col-lg-5 col-md-5 col-sm-5 align-self-center">
                  <img src="<?php echo esc_url(get_theme_mod('prime_cyber_security_slider_image' . $prime_cyber_security_i)); ?>" class="slide-image" />
                </div>
              </div>
              </div>
            </div>
          </div>
        <?php endfor; ?>
      </div>
    </div>
      <section id="brands">
        <div class="container">
          <div class="brand_images wow zoomIn">
            <?php $prime_cyber_security_brand_count = get_theme_mod('prime_cyber_security_brand_count'); 
              for ($i=1; $i <= $prime_cyber_security_brand_count; $i++) { ?>
              <?php if ( get_theme_mod('prime_cyber_security_brand_image'.$i) ) : ?>
                <img src="<?php echo esc_url(get_theme_mod('prime_cyber_security_brand_image'.$i)); ?>">      
              <?php endif; ?>
            <?php } ?>
          </div>
        </div>
      </section>
    <?php endif; ?>
  </div>