<?php
/**
 * Template Name: Custom Home Page
 */
get_header();

?>
<!-- banner section -->
<main id="maincontent" role="main">
  <?php do_action( 'laundry_business_above_banner' ); ?>
  <?php if (get_theme_mod('laundry_business_hide_show_banner_section', false)) { ?>
    <section id="banner-sec" class="d-flex align-items-end pt-5 position-relative">
      <?php
        $laundry_business_custom_banner = get_theme_mod('laundry_business_banner_background_img');
        $laundry_business_default_banner = get_template_directory_uri() . '/assets/images/banner-img.png';
        $laundry_business_banner_img = ! empty( $laundry_business_custom_banner ) ? $laundry_business_custom_banner : $laundry_business_default_banner;
      ?>
      <img src="<?php echo esc_url( $laundry_business_banner_img ); ?>" class="banner-bg-img position-absolute" alt="<?php esc_attr_e('Banner Image', 'laundry-business'); ?>">
      <div class="container">
        <div class="banner-box text-center position-relative wow zoomIn">
          <?php if (get_theme_mod('laundry_business_banner_title') != '') { ?>
            <h1 class="banner-title text-capitalize mb-0"><?php echo esc_html(get_theme_mod('laundry_business_banner_title')); ?></h1>
          <?php } ?>
          <?php if (get_theme_mod('laundry_business_banner_text') != '') { ?>
            <p class="banner-text mt-3 mb-4"><?php echo esc_html(get_theme_mod('laundry_business_banner_text')); ?></p>
          <?php } ?>
          <?php if ( get_theme_mod('laundry_business_banner_first_button_label') != '') {?>
            <div class ="bnr-btn mt-4">
              <a href="<?php echo esc_url(get_theme_mod('laundry_business_banner_first_button_url'));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('laundry_business_banner_first_button_label'));?>
              </a>
            </div>
          <?php }?>
          <div class="banner-bottom position-relative pt-5">
            <div class="row">
              <div class="col-xl-3 col-lg-3 col-md-3 col-12 banner-left mt-5 pt-5">
                    <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>                
                      <?php dynamic_sidebar('social-widget-sidemenu'); ?>
                    <?php else : ?>
                      <div class="custom-social-icons">
                        <h6 class="social-heading"><?php echo esc_html('Follow On Social Media','laundry-business') ?></h6>
                          <div class="social-icons" >
                            <a href="https://facebook.com" target="_blank"><i class="fa-brands fa-facebook-f"></i></a>
                            <a href="https://twitter.com" target="_blank"><i class="fa-brands fa-x-twitter"></i></a>
                            <a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a>
                            <a href="https://youtube.com" target="_blank"><i class="fa-brands fa-youtube"></i></a>   
                            <a href="https://dribbble.com" target="_blank"><i class="fa-brands fa-dribbble"></i></a>          
                          </div>
                     </div>
                    <?php endif; ?>
              </div>
              <div class="col-xl-6 col-lg-6 col-md-6 col-12 banner-center align-self-end">
                <?php if (get_theme_mod('laundry_business_banner_bottom_img') != "") { ?>
                  <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_bottom_img')); ?>" class="banner-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                <?php }?>
              </div>
              <div class="col-xl-3 col-lg-3 col-md-3 col-12 banner-right align-self-end pb-5 mb-5">
                <div class="review-box d-inline-flex align-items-center gap-lg-3 p-3">
                  <div class="review-images">
                    <?php if (get_theme_mod('laundry_business_banner_review_img1') != "") { ?>
                      <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_review_img1')); ?>" class="review-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                    <?php }?>
                    <?php if (get_theme_mod('laundry_business_banner_review_img2') != "") { ?>
                      <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_review_img2')); ?>" class="review-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                    <?php }?>
                    <?php if (get_theme_mod('laundry_business_banner_review_img3') != "") { ?>
                      <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_review_img3')); ?>" class="review-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                    <?php }?>
                    <?php if (get_theme_mod('laundry_business_banner_review_img4') != "") { ?>
                      <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_review_img4')); ?>" class="review-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                    <?php }?>
                    <?php if (get_theme_mod('laundry_business_banner_review_img5') != "") { ?>
                      <img src="<?php echo esc_url(get_theme_mod('laundry_business_banner_review_img5')); ?>" class="review-img" alt="<?php echo esc_attr('banner image', 'laundry-business'); ?>">
                    <?php }?>
                  </div>
                  <div class="review-content">
                    <?php if (get_theme_mod('laundry_business_banner_review_count') != '') { ?>
                      <p class="review-count mb-0 text-start"><?php echo esc_html(get_theme_mod('laundry_business_banner_review_count')); ?></p>
                    <?php } ?>
                    <?php if (get_theme_mod('laundry_business_banner_review_text') != '') { ?>
                      <p class="review-text text-capitalize mb-0 text-start"><?php echo esc_html(get_theme_mod('laundry_business_banner_review_text')); ?></p>
                    <?php } ?>
                  </div>
                </div>
              </div>
              <div class="banner-circle1 position-absolute"></div>
              <div class="banner-circle2 position-absolute"></div>
              <div class="banner-circle3 position-absolute"></div>
              <div class="first-icon position-absolute">
                <i class='<?php echo esc_attr(get_theme_mod('laundry_business_banner_first_icon','fa-solid fa-hands-bubbles')); ?>'></i>
              </div>
              <div class="second-icon position-absolute">
                <i class='<?php echo esc_attr(get_theme_mod('laundry_business_banner_second_icon','fa-solid fa-shirt')); ?>'></i>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  <?php }?>
  <?php do_action( 'laundry_business_below_banner' ); ?>

  <!-- Category Section -->
  <?php if (get_theme_mod('laundry_business_services_section_hide_show', false)){ ?>
    <section id="services-section" class="my-5 position-relative">
      <div class="container">
        <div class="services-sec-content mb-4 wow fadeInDown">
          <div class="row">
            <div class="col-xl-6 col-lg-6 col-md-6 col-12 align-self-center mb-3 text-lg-start text-md-start text-center">
              <?php if(get_theme_mod('laundry_business_services_section_title') != '') {?>
                <h2 class="section-title mt-4 text-capitalize"><?php echo esc_html(get_theme_mod('laundry_business_services_section_title')) ?></h2>
              <?php }?>
              <?php if(get_theme_mod('laundry_business_services_section_text') != '') {?>
                <div class="small-text-box d-inline-flex align-items-center gap-3">
                  <p class="small-text mb-0 text-capitalize d-inline-block"><?php echo esc_html(get_theme_mod('laundry_business_services_section_text')) ?></p>
                </div>
              <?php }?>
            </div>
            <div class="col-xl-6 col-lg-6 col-md-6 col-12 align-self-center tab-section">
              <div class="tab align-self-center d-flex gap-2 justify-content-lg-end justify-content-md-end justify-content-center">
                <?php
                $laundry_business_featured_post = get_theme_mod('laundry_business_services_number', '');
                for ($laundry_business_j = 1; $laundry_business_j <= $laundry_business_featured_post; $laundry_business_j++) { ?>
                  <div class="tab-button">
                    <button class="tablinks" onclick="laundry_business_services_tab(event, '<?php $laundry_business_main_id = get_theme_mod('laundry_business_services_text' .$laundry_business_j);
                        $laundry_business_tab_id = str_replace(' ', '-', $laundry_business_main_id);
                          echo $laundry_business_tab_id; ?> ')">
                        <span><?php echo esc_html(get_theme_mod('laundry_business_services_text'.$laundry_business_j)); ?></span>
                    </button>
                  </div>
                <?php } ?>
              </div>
            </div>
          </div>
        </div>
        <?php for ($laundry_business_j = 1; $laundry_business_j <= $laundry_business_featured_post; $laundry_business_j++) { ?>
          <div id="<?php $laundry_business_main_id = get_theme_mod('laundry_business_services_text'.$laundry_business_j);
            $laundry_business_tab_id = str_replace(' ', '-', $laundry_business_main_id);
            echo $laundry_business_tab_id; ?>" class="tabcontent">
            <div class="owl-carousel">
              <?php
              $laundry_business_services_post_count = get_theme_mod('laundry_business_services_post_count'.$laundry_business_j, '');
              for ($laundry_business_i=1; $laundry_business_i <= $laundry_business_services_post_count; $laundry_business_i++) { 
                $laundry_business_postData=  get_theme_mod('laundry_business_services_category'.$laundry_business_i.$laundry_business_j);
                if($laundry_business_postData){ ?>
                  <div class="service-box p-2 m-1 wow rollIn">
                    <?php 
                      $laundry_business_args = array( 
                        'p' => esc_html($laundry_business_postData ,'laundry-business'),
                        'post_type' => 'post'
                      );
                      $laundry_business_query = new WP_Query( $laundry_business_args );
                      if ( $laundry_business_query->have_posts() ) :
                        while ( $laundry_business_query->have_posts() ) : $laundry_business_query->the_post(); ?>
                          <div class="box position-relative mb-3">
                            <?php if(has_post_thumbnail()){ ?>
                              <?php the_post_thumbnail(); ?>
                            <?php } else {?>
                              <img src="<?php echo esc_url(get_template_directory_uri()) ?>/assets/images/post-image.png" alt="<?php echo esc_attr('Post Image', 'laundry-business'); ?>">
                            <?php }?>
                            <div class="icon position-absolute">
                              <a href="<?php the_permalink(); ?>"><i class="<?php echo esc_attr(get_theme_mod('laundry_business_single_icon'.$laundry_business_i.$laundry_business_j,'fa-solid fa-shirt')); ?>"></i></a>
                            </div>
                          </div>
                          <div class="post-innter-content service-box-content text-center px-4 pb-3">
                            <h4 class="service-box-title mx-3 pb-2 mb-2 text-capitalize"><a href="<?php the_permalink(); ?>"><?php the_title(); ?><span class="screen-reader-text"><?php the_title(); ?></span></a></h4>
                            <p class="service-box-desc mb-4"><?php $laundry_business_excerpt = get_the_excerpt(); echo esc_html( laundry_business_string_limit_words( $laundry_business_excerpt, esc_attr(get_theme_mod('laundry_business_feature_courses_number_post','15')))); ?> <?php echo esc_html(get_theme_mod('laundry_business_blog_excerpt_suffix1'));?>
                            </p>
                            <div class="service-btn">
                              <a href="<?php the_permalink();?>"><?php esc_html_e('Read More','laundry-business'); ?><span class="screen-reader-text"><?php esc_html_e('Read More','laundry-business'); ?></span></a>
                            </div>
                          </div>
                        <?php endwhile;
                          wp_reset_postdata();
                      endif; ?> 
                    </div>
                <?php }
              } ?>   
            </div>
          </div>
        <?php }?>
      </div>
    </section>
  <?php }?>
  <?php do_action( 'laundry_business_after_service' ); ?>

  <div id="content-vw" class="entry-content">
    <div class="container">
      <?php while (have_posts()) : the_post(); ?>
        <?php the_content(); ?>
      <?php endwhile; // end of the loop. 
      ?>
    </div>
  </div>
</main>

<?php get_footer(); ?> 