<?php if ( true == get_theme_mod( 'coupon_flash_deals_slide_on_off', 'on' ) ) : ?>

<?php $coupon_flash_deals_slide_count = get_theme_mod('coupon_flash_deals_slide_count'); ?>

<section id="home_slider">
	<div class="slider-section">
		<div class="container">
			<div class="owl-carousel">
				<?php for ($i=1; $i <= $coupon_flash_deals_slide_count; $i++) {
					$coupon_flash_deals_slider_image = get_theme_mod('coupon_flash_deals_slider_image'.$i);
					$coupon_flash_deals_slider_sub_heading = get_theme_mod('coupon_flash_deals_slider_sub_heading'.$i);
					$coupon_flash_deals_slider_heading = get_theme_mod('coupon_flash_deals_slider_heading'.$i);
					$coupon_flash_deals_slider_content = get_theme_mod('coupon_flash_deals_slider_content'.$i); 
					?>
					<div class="slider_main_box">
						<div class="row">
							<div class="col-lg-6">
								<div class="slider_content_box">
									<?php if ( ! empty( $coupon_flash_deals_slider_sub_heading ) ) : ?>
										<h3><?php echo esc_html( $coupon_flash_deals_slider_sub_heading ); ?></h3>
									<?php endif; ?>
									<?php if ( ! empty( $coupon_flash_deals_slider_heading ) ) : ?>
										<h2><?php echo esc_html( $coupon_flash_deals_slider_heading ); ?></h2>
									<?php endif; ?>
									<?php if ( ! empty( $coupon_flash_deals_slider_content ) ) : ?>
										<p><?php echo esc_html( $coupon_flash_deals_slider_content ); ?></p>
									<?php endif; ?>
								</div>
							</div>
							<div class="col-lg-6 slider-image">
								<?php if ( ! empty( $coupon_flash_deals_slider_image ) ) : ?>
									<img src="<?php echo esc_url( $coupon_flash_deals_slider_image ); ?>">
								<?php endif; ?>
							</div>
						</div>
					</div>
				<?php } ?>
			</div>
		</div>
	</div>
</section>
	<div class="search-box">
		<div class="container">
		    <?php
			$coupon_flash_deals_search_page_id = coupon_flash_deals_get_page_id_by_title( 'Advance Search' );

			if ( $coupon_flash_deals_search_page_id && $coupon_flash_deals_search_page_id != '1' ) : ?>
			    <form id="search-form" class="advanced-search-form" action="<?php echo esc_url( get_permalink( $coupon_flash_deals_search_page_id ) ); ?>" method="POST">

			        <label for="coupon_input" class="screen-reader-text"><?php esc_html_e( 'Search by title', 'coupon-flash-deals' ); ?></label>
			        <input type="text" id="coupon_input" name="coupon_input" placeholder="<?php esc_attr_e( 'I’m Searching for…', 'coupon-flash-deals' ); ?>" class="search-input">

			        <label for="category_dropdown" class="screen-reader-text"><?php esc_html_e( 'Select Category', 'coupon-flash-deals' ); ?></label>
			        <select id="category_dropdown" name="category_dropdown" class="category-select">
			            <option value=""><?php esc_html_e( 'Category', 'coupon-flash-deals' ); ?></option>
			            <?php
			            $coupon_flash_deals_terms = get_terms( array(
			                'taxonomy'   => 'couponcategory',
			                'hide_empty' => false,
			            ) );

			            if ( ! is_wp_error( $coupon_flash_deals_terms ) ) {
			                foreach ( $coupon_flash_deals_terms as $coupon_flash_deals_term ) {
			                    echo '<option value="' . esc_attr( $coupon_flash_deals_term->slug ) . '">' . esc_html( $coupon_flash_deals_term->name ) . '</option>';
			                }
			            }
			            ?>
			        </select>

			        <input type="submit" value="<?php esc_attr_e( 'Search', 'coupon-flash-deals' ); ?>" class="search-button">
			    </form>
			<?php endif; ?>
		</div>
	</div>
<?php endif; ?>