<?php
/**
 * The template for displaying home page.
 * @package Party Planner Bell
 */

if ( 'posts' == get_option( 'show_on_front' )  || 'posts' != get_option( 'show_on_front' )){ 
    get_header(); ?>
    <?php 
    $enabled_sections = party_planner_bell_get_sections();
    $homepage_design_layout     = party_planner_bell_get_option( 'homepage_design_layout_options' );
    if( is_array( $enabled_sections ) &&  $homepage_design_layout== 'home-corporate') { 
        foreach( $enabled_sections as $section ) { ?>
            <?php if( ( $section['id'] == 'featured-slider' ) ){ ?>
                <?php $disable_featured_slider = party_planner_bell_get_option( 'disable_featured-slider_section' );
                if( true == $disable_featured_slider): ?>
                    <section id="<?php echo esc_attr( $section['id'] ); ?>">
                        
                        <?php $slider_layout = party_planner_bell_get_option( 'slider_layout_option'); ?>
                        <?php if ($slider_layout=='default-slider'){ ?>
                            <div class="wrapper">
                                <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                            </div>
                        <?php } else {
                            get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); 
                        } ?>                       
                    </section>
                <?php endif; ?>
            <?php } elseif( $section['id'] == 'services' ) { ?>
                <?php $disable_services_section = party_planner_bell_get_option( 'disable_services_section' );
                 $services_background_image = party_planner_bell_get_option( 'services_background_image' );
                 $disable_services_background=party_planner_bell_get_option( 'disable_services_background' );
                if( true ==$disable_services_section): ?>
                
                    <section id="<?php echo esc_attr( $section['id'] ); ?>" class="page-section">

                        <div class="wrapper">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                        </div>

                    </section> 
            <?php endif; ?>
            <?php } elseif( $section['id'] == 'message' ) { ?>
                <?php $disable_message_section = party_planner_bell_get_option( 'disable_message_section' );
                $background_information_section     = party_planner_bell_get_option( 'background_information_section' );
                if( true ==$disable_message_section): ?>
                    <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section " >
                        <div class="wrapper">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                        </div>

                    </section>                    
                <?php endif; ?>            
            <?php } elseif( $section['id'] == 'features' ) { ?>
                <?php $disable_features_section = party_planner_bell_get_option( 'disable_features_section' );
                if( true ==$disable_features_section): ?>
                    <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                    </section>
            <?php endif; ?>   
            <?php } elseif( $section['id'] == 'team' ) { ?>
                <?php $disable_team_section = party_planner_bell_get_option( 'disable_team_section' );
                if( true ==$disable_team_section): ?>
                    <section id="<?php echo esc_attr( $section['id'] );  ?>" class="relative page-section" >
                        <div class="wrapper">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                        </div>
                    </section>
            <?php endif; ?> 
            <?php } elseif( $section['id'] == 'testimonial' ) { ?>
                <?php $disable_testimonial_section = party_planner_bell_get_option( 'disable_testimonial_section' );
                if( true ==$disable_testimonial_section): ?>
                   <?php $background_testimonial_section     = party_planner_bell_get_option( 'testimonial_side_image' ); ?>
                    <section id="<?php echo esc_attr( $section['id'] ); ?>" class="relative page-section" style="background-image: url('<?php echo esc_url( $background_testimonial_section );?>');">
                        <div class="wrapper">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                        </div>
                    </section> 
            <?php endif; ?> 
            <?php } elseif( $section['id'] == 'mustread' ) { ?>
                <?php $disable_mustread_section = party_planner_bell_get_option( 'disable_mustread_section' );
                if( true ==$disable_mustread_section): 
                     $background_contact_section = party_planner_bell_get_option( 'background_contact_section' );?>
                    <section id="<?php echo esc_attr( $section['id'] );  ?>" class="relative page-section">
                        <div class="wrapper">
                            <?php get_template_part( 'inc/sections/section', esc_attr( $section['id'] ) ); ?>
                        </div>
                    </section>
            <?php endif; ?> 
            <?php } ?>
        <?php } ?>
    <?php } ?>
    <?php $disable_homepage_content_section = party_planner_bell_get_option( 'disable_homepage_content_section' );
    if('posts' == get_option( 'show_on_front' )){ ?>
       <?php include( get_home_template() ); ?>
    <?php } elseif(($disable_homepage_content_section == true ) && ('posts' != get_option( 'show_on_front' ))) { ?>
        <div class="wrapper">
           <?php include( get_page_template() ); ?>
        </div>
     <?php  }
    get_footer();
} ?>