

<main class="main">
    <nav aria-label="breadcrumb" class="breadcrumb-nav border-0 mb-0">
        <div class="container">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="/"><?= $this->Get_Lang->gl("home_page", $langId) ?></a></li>
                <li class="breadcrumb-item active" aria-current="page"><?= $this->Get_Lang->gl("contact_us", $langId) ?></li>
            </ol>
        </div><!-- End .container -->
    </nav><!-- End .breadcrumb-nav -->
    <div class="container">
        <?php if(isset($photo[0]->thePhoto)){ ?>
        <div class="page-header page-header-big text-center" style="background-image: url('/public/uploads/php/files/aboutUs/<?= $photo[0]->thePhoto?>')">
            <h1 class="page-title text-white"><?= $this->Get_Lang->gl("contact_us", $langId) ?><span class="text-white"><?= $this->Get_Lang->gl("keep_in_touch_with_us", $langId) ?></span></h1>
        </div>
        <?php } ?>
    </div><!-- End .container -->

    <div class="page-content pb-0">
        <div class="container">
            <div class="row">
                <div class="col-lg-6 mb-2 mb-lg-0">
                    <h2 class="title mb-1"><?= $this->Get_Lang->gl("Contact_Information", $langId) ?></h2><!-- End .title mb-2 -->
                    <p class="mb-3"> <?php if(isset($contact[0]->companyName)) { if($contact[0]->companyName) { echo $contact[0]->companyName; }}?></p>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="contact-info">
                                <h3><?= $this->Get_Lang->gl("The_Office", $langId) ?></h3>

                                <ul class="contact-list">
                                    <?php if(isset($contact[0]->theText)) { if($contact[0]->theText) { ?>
                                    <li>
                                        <i class="icon-map-marker"></i>
                                        <?=$contact[0]->theText?>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[0]->phoneNumber)) {  if($contact[0]->phoneNumber) { ?>
                                    <li>
                                        <i class="icon-phone"></i>
                                        <a href="tel:<?=$contact[0]->phoneNumber?>"><?=$contact[0]->phoneNumber?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[0]->phoneNumber2)) { if($contact[0]->phoneNumber2) {?>
                                    <li>
                                        <i class="icon-phone"></i>
                                        <a href="tel:<?=$contact[0]->phoneNumber2?>"><?=$contact[0]->phoneNumber2?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[0]->emailAddress)) { if($contact[0]->emailAddress) { ?>
                                    <li>
                                        <i class="icon-envelope"></i>
                                        <a href="mailto:<?=$contact[0]->emailAddress?>"><?=$contact[0]->emailAddress?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[0]->emailAddress2)) { if($contact[0]->emailAddress2) { ?>
                                    <li>
                                        <i class="icon-envelope"></i>
                                        <a href="mailto:<?=$contact[0]->emailAddress2?>"><?=$contact[0]->emailAddress2?></a>
                                    </li>
                                    <?php } } ?>
                                </ul>
                            </div>
                        </div>

                        <div class="col-sm-6">
                            <div class="contact-info">
                                <h3><?= $this->Get_Lang->gl("The_Office", $langId) ?> 2</h3>

                                 <ul class="contact-list">
                                    <?php if(isset($contact[1]->theText)) { if($contact[1]->theText) { ?>
                                    <li>
                                        <i class="icon-map-marker"></i>
                                        <?=$contact[1]->theText?>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[1]->phoneNumber)) {  if($contact[1]->phoneNumber) { ?>
                                    <li>
                                        <i class="icon-phone"></i>
                                        <a href="tel:<?=$contact[1]->phoneNumber?>"><?=$contact[1]->phoneNumber?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[1]->phoneNumber2)) { if($contact[1]->phoneNumber2) {?>
                                    <li>
                                        <i class="icon-phone"></i>
                                        <a href="tel:<?=$contact[1]->phoneNumber2?>"><?=$contact[1]->phoneNumber2?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[1]->emailAddress)) { if($contact[1]->emailAddress) { ?>
                                    <li>
                                        <i class="icon-envelope"></i>
                                        <a href="mailto:<?=$contact[1]->emailAddress?>"><?=$contact[1]->emailAddress?></a>
                                    </li>
                                    <?php } } ?>
                                    <?php if(isset($contact[1]->emailAddress2)) { if($contact[1]->emailAddress2) { ?>
                                    <li>
                                        <i class="icon-envelope"></i>
                                        <a href="mailto:<?=$contact[1]->emailAddress2?>"><?=$contact[1]->emailAddress2?></a>
                                    </li>
                                    <?php } } ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <h2 class="title mb-1"><?= $this->Get_Lang->gl("Got_Any_Questions", $langId) ?></h2><!-- End .title mb-2 -->
                    <p class="mb-2"><?= $this->Get_Lang->gl("Use_the_form_below", $langId) ?></p>

                    <form id="ajax-contact" class="contact-form mb-3" method="post" action="/site/ajax/contactUs" accept-charset="UTF-8">

                        <div class="col-md-12 col-xs-12 pull-left">
                            <div class="sendingSuccess alert alert-success alert-dismissible" role="alert" style="display: none;">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                                <?= $this->Get_Lang->gl("alertSuccessfully", $langId) ?>
                            </div>
                            <div class="sendingError alert alert-danger alert-dismissible" role="alert" style="display: none;">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                                <?= $this->Get_Lang->gl("alertError", $langId) ?>
                            </div> 
                        </div>

                        <div class="row">
                            <div class="col-sm-6">
                                <label for="contact_name" class="sr-only"><?= $this->Get_Lang->gl("name", $langId) ?></label>
                                <input type="text" class="form-control" id="contact_name" name="contact_name" placeholder="<?= $this->Get_Lang->gl("name", $langId) ?> *" required>
                            </div><!-- End .col-sm-6 -->

                            <div class="col-sm-6">
                                <label for="contact_email" class="sr-only"><?= $this->Get_Lang->gl("email_address", $langId) ?></label>
                                <input type="email" class="form-control" id="contact_email" name="contact_email" placeholder="<?= $this->Get_Lang->gl("email_address", $langId) ?> *" required>
                            </div><!-- End .col-sm-6 -->
                        </div><!-- End .row -->

                        <div class="row">
                            <div class="col-sm-6">
                                <label for="contact_phone" class="sr-only"><?= $this->Get_Lang->gl("phone_number", $langId) ?></label>
                                <input type="tel" class="form-control" id="contact_phone" name="contact_phone" placeholder="<?= $this->Get_Lang->gl("phone_number", $langId) ?>">
                            </div><!-- End .col-sm-6 -->

                            <div class="col-sm-6">
                                <label for="contact_subject" class="sr-only"><?= $this->Get_Lang->gl("Subject", $langId) ?></label>
                                <input type="text" class="form-control" id="contact_subject" name="contact_subject" placeholder="<?= $this->Get_Lang->gl("Subject", $langId) ?>">
                            </div><!-- End .col-sm-6 -->
                        </div><!-- End .row -->

                        <label for="contact_message" class="sr-only"><?= $this->Get_Lang->gl("message", $langId) ?></label>
                        <textarea class="form-control" cols="30" rows="4" id="contact_message" name="contact_message" required placeholder="<?= $this->Get_Lang->gl("message", $langId) ?> *"></textarea>
                        
                        <div class="col-md-12 col-xs-12 pull-left">
                            <button type="submit" class="btn btn-outline-primary-2 btn-minwidth-sm btn-sumbit">
                                <span><?= $this->Get_Lang->gl("SUBMIT", $langId) ?></span>
                                <?php if($langId == 1){ ?>
                            <i class="icon-long-arrow-left"></i>
                            <?php }else{ ?>
                            <i class="icon-long-arrow-right"></i>
                            <?php } ?>
                            </button> 
                        </div>

                    </form><!-- End .contact-form -->
                </div><!-- End .col-lg-6 -->
            </div><!-- End .row -->

            <hr class="mt-4 mb-5">

<!--            <div class="stores mb-4 mb-lg-5">
                <h2 class="title text-center mb-3"><?= $this->Get_Lang->gl("Our_Stores", $langId) ?></h2> End .title text-center mb-2 

                <div class="row">
                    <div class="col-lg-6">
                        <div class="store">
                            <div class="row">
                                <div class="col-sm-5 col-xl-6">
                                    <figure class="store-media mb-2 mb-lg-0">
                                        <img src="/public/front/assets/images/stores/img-1.jpg" alt="image">
                                    </figure>
                                </div>
                                <div class="col-sm-7 col-xl-6">
                                    <div class="store-content">
                                        <h3 class="store-title">Wall Street Plaza</h3>
                                        <address>88 Pine St, New York, NY 10005, USA</address>
                                        <div><a href="tel:#">+1 987-876-6543</a></div>

                                        <h4 class="store-subtitle">Store Hours:</h4>
                                        <div>Monday - Saturday 11am to 7pm</div>
                                        <div>Sunday 11am to 6pm</div>

                                        <a href="#" class="btn btn-link" target="_blank"><span>View Map</span><i class="icon-long-arrow-right"></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-lg-6">
                        <div class="store">
                            <div class="row">
                                <div class="col-sm-5 col-xl-6">
                                    <figure class="store-media mb-2 mb-lg-0">
                                        <img src="/public/front/assets/images/stores/img-2.jpg" alt="image">
                                    </figure> End .store-media 
                                </div> End .col-xl-6 

                                <div class="col-sm-7 col-xl-6">
                                    <div class="store-content">
                                        <h3 class="store-title">One New York Plaza</h3>
                                        <address>88 Pine St, New York, NY 10005, USA</address>
                                        <div><a href="tel:#">+1 987-876-6543</a></div>

                                        <h4 class="store-subtitle">Store Hours:</h4>
                                        <div>Monday - Friday 9am to 8pm</div>
                                        <div>Saturday - 9am to 2pm</div>
                                        <div>Sunday - Closed</div>

                                        <a href="#" class="btn btn-link" target="_blank"><span>View Map</span><i class="icon-long-arrow-right"></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->
            
            
        </div>
            <?php $count = 0; if(isset($contact[0]->latitude)){ if($contact[0]->latitude){ if(isset($contact[0]->longitude)){ if($contact[0]->longitude){ ?>        
        <div id="map" class="iq-map">
            <script>
                <?php if(isset($contact[1]->latitude)){ if($contact[1]->latitude){ if(isset($contact[1]->longitude)){ if($contact[1]->longitude){ $count = 1;?> 
                  $('.iq-map').html('<iframe src="https://maps.google.com/maps?q=<?= $contact[0]->latitude?>,<?=$contact[0]->longitude?>&hl=en;z=14&amp;output=embed" width="50%" height="500" frameborder="0" style="border:groove" allowfullscreen=""></iframe>');
                  $('.iq-map').append('<iframe src="https://maps.google.com/maps?q=<?= $contact[1]->latitude?>,<?=$contact[1]->longitude?>&hl=en;z=14&amp;output=embed" width="50%" height="500" frameborder="0" style="border:groove" allowfullscreen=""></iframe>');
                <?php }}}} if($count == 0){?>
                  $('.iq-map').html('<iframe src="https://maps.google.com/maps?q=<?= $contact[0]->latitude?>,<?=$contact[0]->longitude?>&hl=en;z=14&amp;output=embed" width="100%" height="500" frameborder="0" style="border:0" allowfullscreen=""></iframe>');
                <?php } ?>
    
            </script>
<!--            <iframe width="100%" height="100%" frameborder="0" style="border:0" src="https://maps.google.com/maps?q=41.047590,28.812041&hl=es;z=14&amp;output=embed"></iframe>-->
        </div>
            <?php } }  } } ?>
        
    </div><!-- End .page-content -->
</main><!-- End .main -->



<script>


    $("#ajax-contact").each(function () {
        $(this).validate({
            highlight: function (element) {
                $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
            },
            unhighlight: function (element) {
                $(element).closest('.form-group').removeClass('has-error').addClass('has-success');
            },
            ignore: [],
            rules: {
                contact_name: {
                    required: true
                },
                contact_email: {
                    required: true,
                    email: true
                },
                contact_phone: {
                    minlength: 10,
                    digits: true
                },
                contact_message: {
                    required: true
                }

            },
            errorPlacement: function (error, element) {
                error.insertAfter(element);
            }
        });
    });

    $("#ajax-contact").ajaxForm({
        beforeSubmit: function (arr, $form, options) {
            $activeForm = $form;
            if (!$form.valid())
                return false;
        },
        complete: function (xhr) {
            var response = xhr.responseText;
            if (response == 1) {

                $('#contact_name').val('');
                $('#contact_email').val('');
                $('#contact_phone').val('');
                $('#contact_subject').val('');
                $('#contact_message').val('');
                $("#ajax-contact .btn-sumbit").prop('disabled', true);
                setTimeout(function () {
                    $("#ajax-contact .btn-sumbit").prop('disabled', false);
                }, 3000);

                $("#ajax-contact .sendingSuccess").show();
                setTimeout(function () {
                    $("#ajax-contact .sendingSuccess").hide();
                }, 2000);
                location.reload();
            } else {
                $("#ajax-contact .sendingError").empty();
                $("#ajax-contact .sendingError").text(response);
                $("#ajax-contact .sendingError").show();
                setTimeout(function () {
                    $("#ajax-contact .sendingError").hide();
                }, 2000);
            }
        }
    });
</script>
<script>
    $(".menu li").removeClass("active");
    $(".menu li.contact_link").addClass("active");
</script>