<?php
/*
* Template Name: Why DLF
*
* */

get_header();
?>
<?php
if( get_field('why_dlf') ):
    while ( has_sub_field('why_dlf') ) :
        if( get_row_layout() == 'two_column_about' ): ?>
            <section class="about_section container-fluid">
                <div class="row">
                    <div class="container m_t_20 m_b_20">
                        <div class="row m_t_100 m_b_100">
                            <div class="tablee">
                                <div class="tablee_cell col-md-6">
                                    <div class="row ">
                                        <div class="col-md-12 m_t_30 m_b_30">
                                            <div class="content_text content_2">
                                                <h2><?php the_sub_field('tab_title'); ?></h2>
                                                <?php the_sub_field('tab_text'); ?>
                                                <?php
                                                $abri_btn_nm=get_sub_field('tab_button_name');
                                                $abribtnURL=get_sub_field('tab_button_url');
                                                if (!empty($abri_btn_nm)&&!empty($abribtnURL)): ?>
                                                    <a class="btn btn-primary m_t_30" href="<?= $abribtnURL; ?>"><?= $abri_btn_nm; ?></a>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php $contentImage = get_sub_field('tab_image'); ?>
                                <div class="tablee_cell col-md-6 wow fadeInRight p_t_100 p_b_100" style="background:url(<?= $contentImage['url']; ?>) center center / cover no-repeat;"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
        if( get_row_layout() == 'ab_testimonial' ): ?>
            <?php $testBG = get_sub_field('wt_bg_img',6); ?>
            <section class="container-fluid" style="background:#00395d url(<?= $testBG['url']; ?>) left center / auto no-repeat;">
                <div class="row  m_t_50 m_b_60">
                    <div class="container">
                        <div class="row">
                            <div class="col-md-12 title_text text_white text-center m_b_30">
                                <h2><?php the_sub_field('wt_title',6); ?></h2>
                            </div>
                            <div class="col-md-12 text-center">
                                <div class="owl-carousel" id="customer_reviews">
                                    <?php
                                    if( have_rows('wt_testimonial') ):
                                        while ( have_rows('wt_testimonial') ) : the_row(); ?>
                                            <div class="item">
                                                <div class="review_box">
                                                    <p><?php the_sub_field('wt_author_text'); ?></p>
                                                    <div class="review_details">
                                                        <?php $authorImage = get_sub_field('wt_author_image'); ?>
                                                        <img src="<?= $authorImage['url']; ?>" alt="<?= $authorImage['alt']; ?>" class="review_img"/> <h3><?php the_sub_field('wt_author_name'); ?></h3>
                                                    </div>
                                                </div>
                                            </div>
                                        <?php endwhile;
                                    endif;
                                    wp_reset_postdata();
                                    ?>
                                </div>
                            </div>
                            <div class="col-md-12 m_t_60 text-center text_underline font_test">
                                <?php
                                $testBtnName=get_sub_field('wt_button_name');
                                $testBtnURL=get_sub_field('wt_button_url');
                                if (!empty($testBtnName)&&!empty($testBtnURL)):
                                    echo "<a href=\"$testBtnURL\" class=\"text_white text-center text-uppercase\">$testBtnName</a>";
                                endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
        if( get_row_layout() == 'two_column_left_image' ): ?>
            <section class="about_section container-fluid">
                <div class="row">
                    <?php $abImage1 = get_sub_field('ab_page_image'); ?>
                    <img src="<?= $abImage1['url']; ?>" class="about_left_img"  />
                    <div class="container">
                        <div class="row">
                            <div class="col-md-5  col-md-offset-7 col-sm-5 col-sm-offset-7 ">
                                <div class="content_text m_t_100 m_b_100 p_t_60 p_b_60">
                                    <h2><?php the_sub_field('ab_li_title'); ?></h2>
                                    <?php the_sub_field('ab_li_text'); ?>
                                    <h4><?php the_sub_field('ab_lisubtitle'); ?></h4>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
        if( get_row_layout() == 'two_column_right_image' ): ?>
            <section class="about_section container-fluid" style="background:#f3f7fa">
                <div class="row">
                    <?php $abImage2 = get_sub_field('abri_image'); ?>
                    <img src="<?= $abImage2['url']; ?>" class="about_right_img" />
                    <div class="container">
                        <div class="row">
                            <div class="col-md-5 col-sm-5">
                                <div class="content_text m_t_100 m_b_100    ">
                                    <h2><?php the_sub_field('ab_ri_title'); ?></h2>
                                    <?php the_sub_field('ab_ri_text'); ?>
                                    <h4><?php the_sub_field('ab_ri_subtitle'); ?></h4>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
        if( get_row_layout() == 'wt_call_us' ): ?>
            <section class="dark_section">
                <div class="row">
                    <div class="container">
                        <div class="row text-center">
                            <?php the_sub_field('wt_call_text'); ?>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
        if( get_row_layout() == 'wt_contact_form' ): ?>
            <section class="container-fluid" style="background:#9fb4bf  url(<?= site_url(); ?>/wp-content/uploads/2019/03/apply_now_bg_white22.png) center right / auto no-repeat;">
                <div class="row  m_t_60 m_b_70">
                    <div class="container">
                        <div class="row">
                            <div class="title_text text-center text_white col-md-12 ">
                                <h2><?php the_sub_field('wt_cn_title'); ?></h2>
                            </div>
                            <div class="col-md-12 m_t_50 apply_form form_2">
                                <?php $contactpageForm = get_sub_field('wt_contact_form'); ?>
                                <?= do_shortcode($contactpageForm); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php endif;
    endwhile;
endif;
get_footer();
