<?php
/**
 * Template Name: Home Page
 */

get_header();
?>

<main id="primary">

    <?php 
    $business_revolution_main_slider_wrap = absint(get_theme_mod('business_revolution_enable_slider', 0));
    if($business_revolution_main_slider_wrap == 1){ 
    ?>

    <section id="main-slider-wrap">
        <div class="owl-carousel">
            <?php for ($business_revolution_i=1; $business_revolution_i <= 3; $business_revolution_i++) { ?>
                <?php if ( get_theme_mod('business_revolution_slider_image'.$business_revolution_i) || get_theme_mod('business_revolution_slider_heading'.$business_revolution_i) || get_theme_mod('business_revolution_slider_text'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button1_text'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button1_link'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button2_link'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button2_text'.$business_revolution_i) ) : ?>
                    <div class="main-slider-inner-box">
                        <?php if ( get_theme_mod('business_revolution_slider_image'.$business_revolution_i) ) : ?>
                            <img src="<?php echo esc_url( get_theme_mod('business_revolution_slider_image'.$business_revolution_i) ); ?>">
                        <?php else : ?>
                            <div class="image-box"></div>
                        <?php endif; ?>
                        <?php if ( get_theme_mod('business_revolution_slider_heading'.$business_revolution_i) || get_theme_mod('business_revolution_slider_text'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button1_text'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button1_link'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button2_link'.$business_revolution_i) || get_theme_mod('business_revolution_slider_button2_text'.$business_revolution_i) ) : ?>
                            <div class="main-slider-content-box">
                                <?php if ( get_theme_mod('business_revolution_slider_heading'.$business_revolution_i) ) : ?><h3><?php echo esc_html( get_theme_mod('business_revolution_slider_heading'.$business_revolution_i) ); ?></h3><?php endif; ?>
                                <?php if ( get_theme_mod('business_revolution_slider_text'.$business_revolution_i) ) : ?><p><?php echo esc_html( get_theme_mod('business_revolution_slider_text'.$business_revolution_i) ); ?></p><?php endif; ?>
                                <div class="main-slider-button">
                                    <?php if ( get_theme_mod('business_revolution_slider_button1_link'.$business_revolution_i) ||  get_theme_mod('business_revolution_slider_button1_text'.$business_revolution_i )) : ?><a href="<?php echo esc_url( get_theme_mod('business_revolution_slider_button1_link'.$business_revolution_i) ); ?>"><?php echo esc_html( get_theme_mod('business_revolution_slider_button1_text'.$business_revolution_i) ); ?></a><?php endif; ?>
                                    <?php if ( get_theme_mod('business_revolution_slider_button2_link'.$business_revolution_i) ||  get_theme_mod('business_revolution_slider_button2_text'.$business_revolution_i )) : ?><a class="slide-btn-2" href="<?php echo esc_url( get_theme_mod('business_revolution_slider_button2_link'.$business_revolution_i) ); ?>"><?php echo esc_html( get_theme_mod('business_revolution_slider_button2_text'.$business_revolution_i) ); ?></a><?php endif; ?>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
                <?php endif; ?>
            <?php } ?>
        </div>
    </section>

    <?php } ?>

    <?php 
    $business_revolution_main_expert_wrap = absint(get_theme_mod('business_revolution_enable_event', 0));
    if($business_revolution_main_expert_wrap == 1){ 
    ?>

    <section id="main-expert-wrap">
        <div class="container">
            <div class="heading-expert-wrap">
                <?php if ( get_theme_mod('business_revolution_event_heading') ) : ?><h3><?php echo esc_html( get_theme_mod('business_revolution_event_heading') ); ?></h3><?php endif; ?>
                <?php if ( get_theme_mod('business_revolution_event_text') ) : ?><p><?php echo esc_html( get_theme_mod('business_revolution_event_text') ); ?></p><?php endif; ?>
            </div>
            <div class="grid-container">
                <?php for ($business_revolution_i=1; $business_revolution_i <= 4; $business_revolution_i++) { ?>
                    <div class="grid-item">
                        <div class="top-expert-wrap">
                            <div class="flex-row">
                                <div class="box">
                                    <div class="box-image">
                                        <?php if ( get_theme_mod('business_revolution_category_image'.$business_revolution_i) ) : ?><img src="<?php echo esc_url( get_theme_mod('business_revolution_category_image'.$business_revolution_i) ); ?>"><?php endif; ?>
                                    </div>
                                    <div class="box-content">
                                        <?php if ( get_theme_mod('business_revolution_category_heading'.$business_revolution_i) ) : ?><h4 class="title"><?php echo esc_html( get_theme_mod('business_revolution_category_heading'.$business_revolution_i) ); ?></h4><?php endif; ?>
                                        <?php if ( get_theme_mod('business_revolution_category_text'.$business_revolution_i) ) : ?><p class="post"><?php echo esc_html( get_theme_mod('business_revolution_category_text'.$business_revolution_i) ); ?></p><?php endif; ?>
                                        <div class="box-info">
                                            <div class="date-box">
                                                <?php if ( get_theme_mod('business_revolution_category_date_text'.$business_revolution_i) ) : ?><span><i class="fas fa-stopwatch"></i> <?php echo esc_html( get_theme_mod('business_revolution_category_date_text'.$business_revolution_i) ); ?></span><?php endif; ?>
                                                <?php if ( get_theme_mod('business_revolution_category_time'.$business_revolution_i) ) : ?><span><?php echo esc_html( get_theme_mod('business_revolution_category_time'.$business_revolution_i) ); ?></span><?php endif; ?>
                                            </div>
                                            <?php if ( get_theme_mod('business_revolution_category_location_text'.$business_revolution_i) ) : ?><div class="loaction"><i class="fas fa-map-marker-alt"></i> <?php echo esc_html( get_theme_mod('business_revolution_category_location_text'.$business_revolution_i) ); ?></div><?php endif; ?>
                                            <div class="category-btn">
                                                <?php if ( get_theme_mod('business_revolution_category_button1_link'.$business_revolution_i) ||  get_theme_mod('business_revolution_category_button1_text'.$business_revolution_i )) : ?><a class="slide-btn-2" href="<?php echo esc_url( get_theme_mod('business_revolution_category_button1_link'.$business_revolution_i) ); ?>"><?php echo esc_html( get_theme_mod('business_revolution_category_button1_text'.$business_revolution_i) ); ?></a><?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php } ?>
            </div>
            <div class="category-main-btn">
                <?php if ( get_theme_mod('business_revolution_category_main_button_link') ||  get_theme_mod('business_revolution_category_main_button_text' )) : ?><a class="slide-btn" href="<?php echo esc_url( get_theme_mod('business_revolution_category_main_button_link') ); ?>"><?php echo esc_html( get_theme_mod('business_revolution_category_main_button_text') ); ?></a><?php endif; ?>
            </div>
        </div>
    </section>

    <?php } ?>
    
</main>

<?php
get_footer();