<?php get_header('insidepages'); ?>

    <?php
    if (have_posts()){
        the_post();
            $aboutPageId = get_ID_by_slug('about_company');
            $aboutPage = get_post($aboutPageId);

            if(get_field('icon_page', $aboutPageId)) $icon = get_field('icon_page', $aboutPageId);
            $title = $aboutPage->post_title;
            $content = $aboutPage->post_content;
            if(get_field('vision_mission', $aboutPageId)) $vision = get_field('vision_mission', $aboutPageId);

    }
    ?>

    <!-- Banner : Begin -->
    <div class="row no-margin slider">
        <div class="rounded">
            <div class="bannercontainer">
                <div class="banner" style="visibility:hidden">
                    <ul>
                        <!-- Slides : Begin -->
                        <?php
                        /*
                        *  Loop through Slider Repeater fields (From another $post ID)
                        */

                        if(get_field('sliders', $aboutPageId) )
                        {
                            
                            while(has_sub_field('sliders', $aboutPageId) )
                            {
                                if(get_sub_field('image_banner')) $image = get_sub_field('image_banner');

                        ?>
                                
                        <li data-transition="fade">
                            <img src="<?php echo $image; ?>" alt="" />
                            <div class="all-container row no-margin clr-0">
                                    <div class="container">
                                        <span class="caption sfl" data-speed="600" data-start="500" data-easing="easeIn"><img  src="<?php echo $icon; ?>" alt=""/></span>
                                        <h3 class="caption fade sfr" data-speed="600" data-start="600" data-easing="easeIn"><?php echo $title; ?></h3>
                                    </div>
                            </div>
                        </li>
                        
                        <?php
                            }
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--  Banner : End -->



    <!-- About : Begin -->
   
    <!-- Intro -->
    <div class="row no-margin">
        <div class="container margin_T_80 theme-padding"> 
            <p class="txt_al_j">
            <?php echo $content; ?><br/><br/>
            </p>
        </div>
    </div>
    <!-- /Intro -->

    <p>&nbsp;</p>

    <!-- Tab -->
    <div class="row no-margin">
        <div class="container  theme-padding tab-warpper">
            <div class="col-md-4 col-sm-5 no-padding">
                
                <!-- Tab : Begin -->
                
                <?php /**  Loop through Tab  **/

                if(get_field('tabs_inormation', $aboutPageId) )
                {
                ?>

                <ul class="department-detail-ul clr-1">
                    <?php
                    $counter = 0;
                    $content_array = array();
                    
                    while(has_sub_field('tabs_inormation', $aboutPageId) )
                    {
                        if(get_sub_field('title')) $title = get_sub_field('title');
                        if(get_sub_field('content')) $content_array[$counter] = get_sub_field('content');

                ?>
                    <li class="cat<?php echo $counter+1; if($counter==0) echo ' active'; ?>"><i></i><h3><?php echo $title; ?></h3><span></span></li>        
                    <?php 
                    $counter++;
                    } ?>

                </ul>
                <?php } ?>
            </div>

            <?php
            for($i=0; $i<$counter; $i++)
            {
            ?>

            <div class="col-md-8 col-sm-7 tab-item tab<?php echo $i+1; ?> clr-1 <?php if($i==0) echo ' active'; ?>">
                <?php echo $content_array[$i]; ?>
            </div>
            <?php } ?>
        </div>
    </div>
    <!-- Tab : End -->
    
    <p>&nbsp;</p>
    
    <!-- Vision & Mission -->
    <div class="row no-margin about-image-div">
        <div class="container theme-padding">
            <h4 style="font-size:28px">VISION & MISSION</h4>
            <p><?php echo $vision; ?></p>
        </div>
    </div>
    <!-- /Vision & Mission -->
    

    <!-- About : End -->


                    
<?php get_footer('insidepages'); ?>