<?php
/**
 * Template part for displaying page content in page.php
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Nymera
 */

?>
<?php
if (have_rows('content')):
    while (have_rows('content')) :
        the_row();
        if (get_row_layout() == 'hero_banner'): ?>
            <?php
            $hbgimg = get_sub_field('hb_img');
            ?>
            <section class="container-fluid with_triangle"
                     style="background: url(<?php echo $hbgimg['url']; ?>) center center / cover no-repeat">
                <div class="row">
                    <div class="container">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="banner_text wow fadeIn">
                                    <h4><?php the_sub_field('hb_title'); ?></h4>
                                    <h2><?php the_sub_field('hbs_title'); ?></h2>
                                    <p><?php the_sub_field('hb_text'); ?></p>
                                    <?php
                                    $btntext = get_sub_field('hb_btn_text');
                                    $btnlink = get_sub_field('hb_btn_link');
                                    if (!empty($btntext) && !empty($btnlink)):
                                        ?>
                                        <a href="<?php echo $btnlink; ?>"
                                           class="btn btn-gradient"><?php echo $btntext; ?></a>

                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'about'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <img src="<?= get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background"/>
                <div class="row">
                    <div class="container">
                        <div class="row m_t_60 m_b_90">
                            <div class="col-md-12 title_text text-center  wow fadeIn">
                                <h2><?php the_sub_field('ab_title'); ?></h2>
                                <p><?php the_sub_field('ab_content'); ?></p>
                            </div>
                            <div class="col-md-12 m_t_20">
                                <div class="about_flexes">
                                    <?php
                                    if (have_rows('img_title')):
                                        while (have_rows('img_title')) : the_row();
                                            ?>
                                            <div class="about_with_icons  wow fadeIn">
                                                <img src="<?php the_sub_field('it_img'); ?>">
                                                <h4><?php the_sub_field('it_title'); ?></h4>
                                            </div>
                                        <?php endwhile;
                                    endif;
                                    wp_reset_postdata();
                                    ?>
                                </div>
                            </div>
                            <div class="col-md-12 m_t_40 text-center same_width_btns  wow fadeIn">
                                <?php
                                $btntext1 = get_sub_field('ab_btn_text1');
                                $btnlink1 = get_sub_field('ab_btn_link1');
                                if (!empty($btnlink1) && !empty($btntext1)):
                                    ?>
                                    <a href="<?php echo $btnlink1; ?>"
                                       class="btn btn-gradient m_r_40"><?php echo $btntext1; ?></a>
                                <?php endif; ?>
                                <?php
                                $btntext2 = get_sub_field('ab_btn_text2');
                                $btnlink2 = get_sub_field('ab_btn_link2');
                                if (!empty($btnlink2) && !empty($btntext2)):
                                    ?>
                                    <a href="<?php echo $btnlink2; ?>"
                                       class="btn btn-gradient "><?php echo $btntext2; ?></a>
                                <?php endif; ?>

                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'testimonial'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <div class="row">
                    <div class="container">
                        <div class="row m_t_60 m_b_90">
                            <div class="col-md-10 col-md-offset-1 title_text text-center">
                                <h2><?php the_sub_field('titlets'); ?></h2>

                            </div>
                            <div class="col-md-12 m_t_40">
                                <div class="row flex_col align_center">
                                    <div class="col-md-5 col-sm-6 quote_body  wow fadeIn">
                                        <img src="<?= get_template_directory_uri(); ?>/images/quotes.png"
                                             class="quote_img"/>
                                        <p><?php the_sub_field('client_feedback'); ?></p>
                                        <div class="user_bg">
                                            <img src="<?php the_sub_field('client_image'); ?>"/>
                                            <div><h4><?php the_sub_field('client_name'); ?></h4>
                                                <p><?php the_sub_field('client_d'); ?></p></div>
                                        </div>
                                    </div>
                                    <div class="col-md-5 col-sm-6 col-md-offset-2  wow fadeIn">
                                        <img src="<?php the_sub_field('right_image'); ?>"
                                             class="img-responsive border_rad"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'inner_banner'): ?>
            <section class="container-fluid with_triangle  wow fadeIn"
                     style="background: url(<?php the_sub_field('bg_image'); ?>) bottom center / cover no-repeat">
                <div class="row">
                    <div class="container">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="banner_text sub_banner">
                                    <h4><?php the_sub_field('titlein'); ?></h4>
                                    <?php
                                    if (is_page('77')):
                                        ?>
                                        <div class="product_banner_list m_t_30">
                                            <?php
                                            $i = 0;
                                            if (have_rows('product_info')):
                                                while (have_rows('product_info')) :
                                                    the_row();
                                                    $i++; ?>
                                                    <a href="#sec<?php echo $i; ?>"><?php the_sub_field('titlep'); ?><i
                                                                class="fa fa-angle-right"></i></a>
                                                <?php endwhile;
                                            endif;
                                            wp_reset_postdata();
                                            ?>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'team'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <img src="<?= get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background"/>
                <div class="row  ">
                    <div class="container">
                        <div class="row m_t_90 m_b_90">
                            <div class="col-md-8 col-md-offset-2 title_text red_text text-center">
                                <h2><?php the_sub_field('titletm'); ?></h2>
                                <p><?php the_sub_field('contenttm'); ?></p>

                            </div>
                            <?php
                            $posts = get_sub_field('select_team_members');
                            $i = 0;
                            if ($posts):
                                foreach ($posts as $post):$i++;
                                    setup_postdata($post);
                                    $img = get_the_post_thumbnail_url(); ?>
                                    <?php if ($i % 2 == 1) : ?>
                                        <div class="col-md-12 m_t_60  ">
                                            <div class="row flex_col align_center">
                                            	<div class="col-sm-5 col-xs-12">
													<div class="mobile_show">
                                                    <img src="<?php echo $img; ?>" class="img-responsive center-block "/>
													</div>
                                                </div>
                                                <div class="col-sm-7 col-xs-12 about_text team_ct">
                                                    <h4><?php the_field('member_designation'); ?></h4>
                                                    <h5><?php the_title(); ?></h5>
                                                    <?php the_content(); ?>

                                                    <div class="m_t_10 about_social">
                                                        <?php
                                                        if (have_rows('social_media')):
                                                            while (have_rows('social_media')) : the_row(); ?>
                                                                <a href="<?php the_sub_field('social_media_link'); ?>"><img
                                                                            src="<?php the_sub_field('icon_image'); ?>"></a>                                            <?php endwhile;
                                                        endif;
                                                        wp_reset_postdata();
                                                        ?>
                                                    </div>
                                                </div>
                                                <div class="col-sm-5 col-xs-12">
													<div class="desktop_show">
                                                    <img src="<?php echo $img; ?>" class="img-responsive center-block "/>
													</div>
                                                </div>
                                            </div>
                                        </div>
                                    <?php else : ?>
                                        <div class="col-md-12 m_t_60  ">
                                            <div class="row flex_col align_center">
                                                <div class="col-sm-5 col-xs-12">
                                                    <img src="<?php echo $img; ?>" class="img-responsive center-block"/>

                                                </div>
                                                <div class="col-sm-7 col-xs-12 about_text team_ct">
                                                    <h4><?php the_field('member_designation'); ?></h4>
                                                    <h5><?php the_title(); ?></h5>
                                                    <?php the_content(); ?>

                                                    <div class="m_t_10 about_social">
                                                        <?php
                                                        if (have_rows('social_media')):
                                                            while (have_rows('social_media')) : the_row(); ?>
                                                                <a href="<?php the_sub_field('social_media_link'); ?>"><img
                                                                            src="<?php the_sub_field('icon_image'); ?>"></a>                                            <?php endwhile;
                                                        endif;
                                                        wp_reset_postdata();
                                                        ?>
                                                    </div>
                                                </div>

                                            </div>
                                        </div>
                                    <?php
                                    endif;
                                endforeach;
                                wp_reset_postdata();
                            endif; ?>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'product_section'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <img src="<?= get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background"/>
                <div class="row  ">
                    <div class="container">
                        <?php
                        $i = 0;
                        if (have_rows('product_info')):
                            while (have_rows('product_info')) :
                                the_row();
                                $i++; ?>
                                <div class="row m_t_90 m_b_90" id="sec<?php echo $i; ?>">
                                    <div class="col-md-8 col-md-offset-2 title_text red_text text-center">
                                        <h2><?php the_sub_field('titlep'); ?></h2>
                                        <p><?php the_sub_field('contentp'); ?></p>
                                    </div>
                                    <?php
                                    $posts = get_sub_field('select_products');
                                    if ($posts):
                                        foreach ($posts as $post):
                                            setup_postdata($post);
                                            $pimg = get_the_post_thumbnail_url();
                                            ?>
                                            <div class="col-md-12 m_t_60  ">
                                                <div class="row flex_col align_center">

                                                    <div class="col-sm-6 col-xs-12 about_text product_information">
                                                        <h4><?php the_title(); ?></h4>
                                                        <h5><?php the_field('sub_title'); ?></h5>
                                                        <?php the_content(); ?>
                                                        <div class="row m_t_20 list_a">
                                                            <div class="col-md-12">
                                                                <?php
                                                                if (have_rows('product_info')):
                                                                    while (have_rows('product_info')) : the_row(); ?>
                                                                        <div class="row">
                                                                            <div class="col-md-3">
                                                                                <h3><?php the_sub_field('title'); ?></h3>
                                                                            </div>
                                                                            <div class="col-md-9">
                                                                                <h6><?php the_sub_field('text'); ?></h6>
                                                                            </div>
                                                                        </div>
                                                                    <?php endwhile;
                                                                endif;
                                                                wp_reset_postdata();
                                                                ?>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="col-sm-6 col-xs-12">
                                                        <img src="<?php echo $pimg; ?>"
                                                             class="img-responsive center-block product_image"/>

                                                    </div>
                                                </div>
                                            </div>
                                        <?php endforeach;
                                        wp_reset_postdata();
                                    endif;
                                    ?>
                                </div>
                            <?php endwhile;
                        endif;
                        wp_reset_postdata();
                        ?>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'contact_section'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <img src="<?php echo get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background"/>
                <div class="row  ">
                    <div class="container">
                        <div class="row m_t_90 m_b_90">
                            <div class="col-md-8 col-md-offset-2 title_text red_text text-center contact_title">
                                <h2><?php the_sub_field('titlect'); ?></h2>
                                <p><?php the_sub_field('contentct'); ?></p>
                                <h4 class="m_t_80"><?php the_sub_field('sub_titlect'); ?></h4>
                            </div>
                            <div class="col-md-12 m_t_30 text-center">
                                <p class="contact_details">
                                    <a href="mailto:<?php the_field('email', 'options'); ?>"><?php the_field('email', 'options'); ?></a>
                                    <a href="tel:<?php the_field('phone_no', 'options'); ?>"><?php the_field('phone_no', 'options'); ?></a>
                                    <?php
                                    if (have_rows('social_icon', 'options')):
                                        while (have_rows('social_icon', 'options')) : the_row();
                                            $icon = get_sub_field('si_icon', 'options');
                                            $url = get_sub_field('si_url', 'options');
                                            if (!empty($icon) && !empty($url)): ?>
                                                <a href="<?php echo $url; ?>" class="social_icons"><i
                                                            class="fa fa-<?php echo $icon; ?>"></i></a>
                                            <?php endif;
                                        endwhile;
                                    endif;
                                    wp_reset_postdata();
                                    ?>
                                </p>
                            </div>
                            <div class="col-md-8 col-md-offset-2 m_t_50  contact_form ">
                                <?php
                                $form = get_sub_field('form_shortcodect');
                                echo do_shortcode($form);
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'career_section'): ?>
            <section class="container-fluid relative_pos  wow fadeIn">
                <img src="<?php echo get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background"/>
                <img src="<?php echo get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
                     class="nymera_background22"/>
                <div class="row  ">
                    <div class="container">
                        <div class="row m_t_90 m_b_90">
                            <div class="col-md-8 col-md-offset-2 title_text red_text text-center">
                                <h2><?php the_sub_field('titlecr'); ?></h2>
                                <p><?php the_sub_field('contentcr'); ?></p>
                            </div>
                            <div class="col-md-10 col-md-offset-1 m_t_30  ">
                                <?php
                                $posts = get_sub_field('select_jobs');
                                if ($posts):
                                    foreach ($posts as $post):
                                        setup_postdata($post); ?>
                                        <div class="careers_box">
                                            <h2><?php the_title(); ?></h2>
                                            <h4><?php the_field('sub_title'); ?></h4>
                                            <?php the_content(); ?>
                                            <div class="row">
                                                <?php
                                                if (have_rows('product_info')):
                                                    while (have_rows('product_info')) : the_row(); ?>
                                                        <div class="col-sm-6">
                                                            <div class="row">
                                                                <div class="col-md-7">
                                                                    <h5><?php the_sub_field('title'); ?></h5>
                                                                </div>
                                                                <div class="col-md-5">
                                                                    <h6><?php the_sub_field('text'); ?></h6></div>
                                                            </div>
                                                        </div>
                                                    <?php endwhile;
                                                endif;
                                                wp_reset_postdata();
                                                ?>
                                            </div>
                                            <a href="#apply_now" class="btn btn-gradient m_t_20">Apply Now</a>
                                        </div>
                                    <?php endforeach;
                                    wp_reset_postdata();
                                endif; ?>
                            </div>
                            <div class="col-md-12 notes text-center">
                                <h2><?php the_sub_field('titleap'); ?></h2>
                                <h4><?php the_sub_field('sub_titleap'); ?></h4>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php elseif (get_row_layout() == 'apply_now'): ?>
            <section class="container-fluid relative_pos  wow fadeIn" id="apply_now">
                <div class="row  ">
                    <div class="container">
                        <div class="row    m_b_90">
                            <div class="col-md-8 col-md-offset-2 title_text red_text text-center">
                                <h4 class="koib"><?php the_sub_field('section_title'); ?></h4>
                            </div>
                            <div class="col-md-12 m_t_30 text-center">
                                <p class="contact_details">
                                    <a href="mailto:<?php the_field('email', 'options'); ?>"><?php the_field('email', 'options'); ?></a>
                                    <a href="tel:<?php the_field('phone_no', 'options'); ?>"><?php the_field('phone_no', 'options'); ?></a>
                                    <?php
                                    if (have_rows('social_icon', 'options')):
                                        while (have_rows('social_icon', 'options')) : the_row();
                                            $icon = get_sub_field('si_icon', 'options');
                                            $url = get_sub_field('si_url', 'options');
                                            if (!empty($icon) && !empty($url)): ?>
                                                <a href="<?php echo $url; ?>" class="social_icons"><i
                                                            class="fa fa-<?php echo $icon; ?>"></i></a>
                                            <?php endif;
                                        endwhile;
                                    endif;
                                    wp_reset_postdata();
                                    ?>
                                </p>
                            </div>
                            <div class="col-md-8 col-md-offset-2 m_t_50  contact_form ">
                                <?php
                                $form = get_sub_field('form_shortcode');
                                echo do_shortcode($form);
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
<?php elseif
(get_row_layout() == 'title_content'): ?>
<section class="container-fluid relative_pos  wow fadeIn">
    <img src="<?php echo get_template_directory_uri(); ?>/images/NYMERA_TRANSPARENT_LOGO_1.png"
         class="nymera_background"/>
    <div class="row  ">
        <div class="container">
            <div class="row m_t_90 ">
                <div class="col-md-10 col-md-offset-1 title_text red_text text-center">
                    <h2><?php the_sub_field('tc_title'); ?></h2>
                    <?php the_sub_field('tc_content'); ?>
                </div>
            </div>
        </div>
    </div>
</section>
<?php elseif (get_row_layout() == 'left_img_content'): ?>
<section class="container-fluid relative_pos">
    <div class="row  ">
        <div class="container">
            <div class="row   ">
                <div class="col-md-12 m_t_60  ">
                    <div class="row flex_col align_center">
						<div class="col-sm-6 about_text">
                            <div class="about_box  ">
								<?php the_sub_field('lic_content'); ?>
                            </div>
                            <div class="about_box m_t_60">
								<?php the_sub_field('lic_content2'); ?>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <img src="<?php the_sub_field('lic_img'); ?>" class="img-responsive rounded_images"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<?php elseif (get_row_layout() == 'right_img_content'): ?>
<section class="container-fluid relative_pos  wow fadeIn">
    <div class="row m_b_90 ">
        <div class="container">
            <div class="row   ">
                <div class="col-md-12 m_t_60  ">
                    <div class="row flex_col align_center">
                        <div class="col-sm-6">
                            <img src="<?php the_sub_field('ric_img'); ?>" class="img-responsive rounded_images"/>
                        </div>
                        <div class="col-sm-6 about_text">
                            <div class="about_box  ">
                                <?php the_sub_field('ric_content'); ?>
                            </div>
                            <div class="about_box m_t_60">
                                <?php the_sub_field('ric_content2'); ?>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
        <?php
        endif;
    endwhile;
endif;
?>
