<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;

use \common\models\Settings;
use \common\modules\bids\models\Bid;
use \common\modules\languages\models\Languages;

use frontend\assets\FileUploadBundle;

FileUploadBundle::register($this);

$lang = Languages::getCurrent();
?>

<script type="text/javascript">
    $(document).delegate('.show-scheme', 'click', function(e) {
        e.preventDefault();
        $('.tab_' + $(this).data('tab')).click();
    });
</script>

<section class="section1_cont">
    <div class="container">
        <div class="row">
            <duv class="col-md-5 col-xs-12 col-sm-12">
                <h1><?=\Yii::t('contacts', 'Contacts')?></h1>
            </duv>
        </div>
        <div class="row">
            <div class="col-md-6 col-xs-6 col-sm 12">
                <div class="cont_block">
                    <div class="cont_block__city"><?=\Yii::t('contacts', 'Moscow')?></div>
                    <div class="cont_block__phone"><strong><?=\Yii::t('contacts', 'Phone')?>:</strong> <?=Settings::getValue('contacts-phone-moscow')?></div>
                    <div class="cont_block__link_pp"><a href="#zvonok_form" class="popup-form"><?=\Yii::t('contacts', 'Call me')?></a></div>
                    <div class="cont_block__email"><strong>E-mail:</strong> <?=Settings::getValue('contacts-email-moscow')?></div>
                    <div class="cont_block__adr"><strong><?=\Yii::t('contacts', 'Address')?>:</strong> <?=Settings::getValue('contacts-address-moscow'.(!$lang->default?'-'.$lang->url:''))?></div>
                </div>
                <a href="#tabmap" class="view_sheme_link scrollto show-scheme" data-tab="moscow">Смотреть схему</a>
            </div>
            <div class="col-md-6 col-xs-6 col-sm 12">
                <div class="cont_block">
                    <div class="cont_block__city"><?=\Yii::t('contacts', 'Kazan')?></div>
                    <div class="cont_block__phone"><strong><?=\Yii::t('contacts', 'Phone')?>:</strong> <?=Settings::getValue('contacts-phone-kazan')?></div>
                    <div class="cont_block__link_pp"><a href="#zvonok_form" class="popup-form"><?=\Yii::t('contacts', 'Call me')?></a></div>
                    <div class="cont_block__email"><strong>E-mail:</strong> <?=Settings::getValue('contacts-email-kazan')?></div>
                    <div class="cont_block__adr"><strong><?=\Yii::t('contacts', 'Address')?>:</strong> <?=Settings::getValue('contacts-address-kazan'.(!$lang->default?'-'.$lang->url:''))?></div>
                </div>
                <a href="#tabmap" class="view_sheme_link scrollto show-scheme" data-tab="kazan">Смотреть схему</a>
            </div>
        </div>
    </div>
</section>
<section class="sect_support_cont">
    <div class="container">
        <div class="row">
            <duv class="col-md-5 col-xs-12 col-sm-12">
                <h1><?=\Yii::t('contacts', 'Technical support')?></h1>
            </duv>
        </div>
        <div class="row">
            <div class="col-md-7 col-xs-6 col-sm 12">
                <div class="support_block">
                    <div class="support_block__phones"><?=\Yii::t('contacts', 'Phones')?>:</div>
                    <div class="support_block__phones_itm">+7 (495) 749 29 69</div>
                    <div class="support_block__phones_itm">+7 (495) 961 42 29</div>
                    <div class="support_block__link_pp"><a href="#zvonok_form" class="popup-form"><?=\Yii::t('contacts', 'Call me')?></a></div>
                </div>
            </div>
            <div class="col-md-5 col-xs-6 col-sm 12">
                <div class="support_block">
                    <div class="support_block__txt"><?=Yii::t('contacts', 'We prepared a video for you, to show how customers setting a task to our support')?></div>
                    <div class="support_block__link_pv"><a href="#" class=""><?=\Yii::t('contacts', 'Watch a video')?></a></div>
                </div>
            </div>
        </div>
    </div>
</section>
<section class="sect_cont_forma">
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-xs-12 col-sm-12">
                <h1><?=\Yii::t('form', 'Contact us')?></h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12 col-xs-12 col-sm-12">
                <div class="sect_cont_block">
                    <?php 
                    $model = new Bid;
                    $model->scenario = Bid::SCENARIO_CALLBACK;
                    $model->form = Bid::FORM_MESSAGE;

                    $form = ActiveForm::begin([
                        'id' => 'form_foot',
                        'action' => '/bids/bid/add',
                        'enableClientValidation' => false,
                        'options' => [
                            'class' => 'sect_cont_form bids-form',
                            'data-title' => 'Отправить сообщение с сайта',
                            'data-form' => 'Отправить сообщение с сайта',
                            'data-tag' => Bid::TAG_TREATMENT
                        ],
                    ]); ?>

                        <div class="message-box send_secce">Ваша заявка отправлена, мы вам перезвоним.</div>

                        <div class="content">

                            <?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>

                            <?php echo $form->field($model, 'form', ['template' => '{input}'])->hiddenInput(['class' => 'not_clear']); ?>

                            <?php echo $form->field($model, 'name', [
                                'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
                                'errorOptions' => []
                            ])->textInput([
                                'placeholder' => \Yii::t('form', 'Your name'),
                                'class' => 'sect_cont_form__input'
                            ]); ?>

                            <?php echo $form->field($model, 'phone', [
                                'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
                                'errorOptions' => []
                            ])->textInput([
                                'placeholder' => \Yii::t('form', 'Phone').'*',
                                'class' => 'sect_cont_form__input'
                            ]); ?>

                            <?php echo $form->field($model, 'text')->textArea([
                                'placeholder' => \Yii::t('form', 'Write a message'),
                                'class' => 'sect_cont_form__textarea'
                            ])->label(false); ?>

                            <div class="file-upload_block_cs dropzone" id="block_upload">
                                <div class="file_upload_bt_cs">
                                    <div class="file-upload_cs">
                                        <label>
                                            <span><?=\Yii::t('form', 'Choose file')?></span>
                                        </label>
                                    </div>
                                    <div class="file_drop_cs"><?=\Yii::t('form', 'Drag any files here or choose in folder')?></div>
                                </div>
                            </div>
                            <div id="files-zone">
                                
                            </div>
                            
                            <?php echo Html::submitButton(\Yii::t('form', 'Submit'), ['class' => 'btn-default save-button']); ?>

                        </div>

                    <?php ActiveForm::end(); ?>
                </div>
            </div>
        </div>
    </div>
</section>
<section class="sect_map">
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-xs-12 col-sm-12">
                <h1>Как добраться</h1>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-xs-12 col-sm-12">
                <div class="tabs">
                    <span class="tab_map tab_moscow" id="tabmap">Офис в Москве</span>
                    <span class="tab_map tab_kaz tab_kazan" id="tabmap">Офис в Казани</span>
                </div>        
            </div>
        </div>
    </div>
    <div class="tab_content">
        <div class="tab_item">
            <script type="text/javascript" charset="utf-8" src="https://api-maps.yandex.ru/services/constructor/1.0/js/?sid=jveK6t8L7J1BKM3o0k5YmCnIWydO3XlL&width=100%&height=748&lang=ru_RU&sourceType=constructor"></script>
        </div>
        <div class="tab_item">
            <script type="text/javascript" charset="utf-8" src="https://api-maps.yandex.ru/services/constructor/1.0/js/?sid=51Gk2ZrvMjLJwxMtXmutdv6NEuVUlztK&width=100%&height=748&lang=ru_RU&sourceType=constructor"></script>
        </div>
    </div>
</section>

<?php echo $this->render('@app/views/layouts/footer'); ?>