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

    <?php
    if (have_posts()){
        the_post();
            $contactPageId = get_ID_by_slug('pars-patent-contact');
            $contactPage = get_post($contactPageId);

            
            $title = $contactPage->post_title;
            $content = $contactPage->post_content;
            if(get_field('icon_page', $contactPageId)) $icon = get_field('icon_page', $contactPageId);

            if(get_field('map_lat1', $contactPageId)) $map_lat1 = get_field('map_lat1', $contactPageId);
            if(get_field('map_lng1', $contactPageId)) $map_lng1 = get_field('map_lng1', $contactPageId);

            if(get_field('map_lat2', $contactPageId)) $map_lat2 = get_field('map_lat2', $contactPageId);
            if(get_field('map_lng2', $contactPageId)) $map_lng2 = get_field('map_lng2', $contactPageId);

            if(get_field('map_lat3', $contactPageId)) $map_lat3 = get_field('map_lat3', $contactPageId);
            if(get_field('map_lng3', $contactPageId)) $map_lng3 = get_field('map_lng3', $contactPageId);

            if(get_field('map_lat4', $contactPageId)) $map_lat4 = get_field('map_lat4', $contactPageId);
            if(get_field('map_lng4', $contactPageId)) $map_lng4 = get_field('map_lng4', $contactPageId);

            if(get_field('map_zoom', $contactPageId)) $map_zoom = get_field('map_zoom', $contactPageId);

    }
    ?>
    


    <!-- Map : Begin -->
    <div class="row no-margin">
        <div class="topslidercontainer">
            <div class="holo-google-map googlemap" id="google-map" data-center1="<?php echo $map_lat1; ?>, <?php echo $map_lng1; ?>" data-center2="<?php echo $map_lat2; ?>, <?php echo $map_lng2; ?>" data-center3="<?php echo $map_lat3; ?>, <?php echo $map_lng3; ?>" data-center4="<?php echo $map_lat4; ?>, <?php echo $map_lng4; ?>" data-zoom="<?php echo $map_zoom; ?>"></div>
                    
            <div class="all-container row no-margin clr-0">
                <div class="container">
                    <span><img  src="<?php echo $icon; ?>" alt=""/></span>
                    <h3><?php echo $title; ?></h3>
                </div>
            </div>
        </div>
    </div>
    <!-- / Map : End -->


    <!-- About : Begin -->
   
    <!-- Contact Us -->
        <div class="row no-margin">
            <div class="container margin_T_80 theme-padding"> 
                
                <!-- Contact Form : Begin -->
                <div class="">
                    <div class="contact-form">
                        <div class="col-xs-12">
                            <h3>Contact Us</h3>
                            <input type="text" class="form-control" placeholder="Name" value="" />
                            <span class="required">* required</span>
                        </div>
                        <div class="col-xs-12">
                            <input type="text" class="form-control" placeholder="Email" value="" />
                            <span class="required">* required</span>
                        </div>
                        <div class="col-xs-12">
                            <textarea placeholder="Message" class="form-control fb" rows="8"></textarea>
                            <span class="required">* required</span>
                        </div>
                        <div class="col-xs-12" style="direction:rtl">
                            <input type="submit" class="form-btn" value="Submit Message">
                        </div>
                    </div>
                </div>
                <!-- Contact Form : End -->

           		<?php /**  Loop through Office information  **/

		        if(get_field('office_information', $contactPageId))
		        {
                    $counter = 1;
	                while(has_sub_field('office_information', $contactPageId) )
	                {
                        if(get_sub_field('office_name')) $office_name = get_sub_field('office_name');
	                    if(get_sub_field('office_address')) $office_address = get_sub_field('office_address');
                        if(get_sub_field('office_pobox')) $office_pobox = get_sub_field('office_pobox');
	                    if(get_sub_field('office_phones')) $office_phones = get_sub_field('office_phones');
                        if(get_sub_field('office_fax')) $office_fax = get_sub_field('office_fax');
	                    if(get_sub_field('office_emails')) $office_emails = get_sub_field('office_emails');
		        ?>
                <div class="<?php if($counter%2==0){echo 'col-md-5 col-sm-5';}else{echo 'col-md-6 col-sm-6';} ?> contact-text <?php if($counter%2==0) echo 'col-md-offset-1 col-sm-offset-1'; ?>">
                    <div>

                        <?php if(isset($office_name)){?>
                            <strong><?php echo $office_name; ?></strong>
                            <hr/>
                        <?php } //end if ?>
                        
                        <?php if(isset($office_address)){?>
                            <b>Address</b>
                            <p><?php echo $office_address; ?></p>
                        <?php } //end if ?>
                        
                        <?php if(isset($office_pobox)){?>
                            <b>P.O. Box</b>
                            <p><?php echo $office_pobox; ?></p>
                        <?php } //end if ?>
                        
                        <?php if(isset($office_phones)){?>
                            <b>Phone</b>
                            <p><?php echo $office_phones; ?></p>
                        <?php } //end if ?>
                        
                        <?php if(isset($office_fax)){?>
                            <b>Fax</b>
                            <p><?php echo $office_fax; ?></p>
                        <?php } //end if ?>
                        
                        <?php if(isset($office_emails)){?>
                            <b>Email</b>
                            <p><?php if(isset($office_emails)) echo $office_emails; ?></p>
                        <?php } //end if ?>

                    </div>
                </div>
                <?php $counter++;} //end while ?>
                <?php } //end if ?>

                <div class="clear"></div>

            </div>
        </div>
        <!-- /Contact Us -->


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