<?php
/**
 * Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *
 */

/** @var $this \Zend\View\Renderer\PhpRenderer */

$this->headScript()
    ->appendFile('//cdnjs.cloudflare.com/ajax/libs/autosize.js/3.0.18/autosize.min.js')
    ->appendFile('/js/script-contacts.js')
;

$this->headLink()
    ->appendStylesheet('/css/styles-contacts.css');

/** @var \App\Entity\LayoutInfo $layoutInfo */
$layoutInfo = $this->layoutInfo;
?>
<section class="b-content__title">
    <div class="wrapp">
        <h1><?= _t('Контакты') ?></h1>
        <div class="row">
            <p class="lead col sm-offset-1 sm-10"><?= _t('Вы всегода можете задать интересующие вас вопросы через форму обратной связи. Наши специалисты свяжутся с вам в ближайшее время') ?></p>
        </div>
    </div>
</section>

<section class="b-content__form">
    <div class="wrapp row row-wrap">
        <div class="col sm-offset-2 sm-4 xs-6">
            <h2><?= _t('Свяжитесь с нами') ?></h2>
            <ul class="b-content__form-our-contacts">
                <?php foreach ($layoutInfo->getPhones() as $phone) :?>
                    <li class="tel"><a href="tel:<?= end(explode(' ', $phone)) ?>" title="<?= _t('Позвоните нам')?>" ><?= preg_replace('~\+~u', '&#177;', $phone)?></a></li>
                <?php endforeach; ?>
                <?php foreach ($layoutInfo->getMails() as $mail) : ?>
                    <li class="email"><a href="mailto:<?= $mail ?>?subject=feedback" title="<?= _t('Напишите нам') ?>" ><?= $mail ?></a></li>
                <?php endforeach; ?>
                <?php foreach ($layoutInfo->getSkypes() as $skype) : ?>
                    <li class="skype"><a href="skype:<?= $skype ?>" title="<?= _t('Скайп') ?>" ><?= $skype ?></a></li>
                <?php endforeach; ?>
            </ul>
        </div>
        <div class="b-content__form-container col sm-4 xs-6">
            <form data-url="<?= $this->url('contacts', ['lang' => $this->lang]) ?>" name="feedback">
                <h2><?= _t('Напишите нам!') ?></h2>
                <span class="input input--akira">
                <input class="input__field input__field--akira" type="text" id="name" name="name" />
                <label class="input__label input__label--akira" for="name">
                  <span class="input__label-content input__label-content--akira"><?= _t('Имя') ?></span>
                </label>
              </span>
                <span class="input input--akira">
                <input class="input__field input__field--akira" type="email" id="e-mail"  name="email" />
                <label class="input__label input__label--akira" for="e-mail">
                  <span class="input__label-content input__label-content--akira"><?= _t('E-mail') ?></span>
                </label>
              </span>
                <span class="textarea input--akira">
                <textarea class="input__field input__field--akira" name="message" /></textarea>
                    <label class="input__label input__label--akira" for="e-mail">
                  <span class="input__label-content input__label-content--akira"><?= _t('Текст сообщения') ?></span>
                </label>
              </span>
                <input type="submit" name="submit" value="<?= _t('Отправить') ?>">
            </form>

            <div class="b-content__form-finish">
                <div class="b-content__form-finish-inner">
                    <h2><?= _t('Сообщение отправлено!') ?></h2>
                    <p class="text"><?= _t('В ближайшее время мы дадим Вам ответ.') ?></p>
                </div>
            </div>
        </div>
    </div>
</section>

