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

use common\modules\bids\models\Bid;

use frontend\assets\FileUploadBundle;

FileUploadBundle::register($this);
?>

<footer>
    <div class="container">
        <div class="row">
            <div class="col-md-12 col-sm-12">
                <div class="calk_form">
                    <span class="calk_form__title"><?=\Yii::t('index', 'Have a project or idea - send us');?></span>
                    <span class="calk_form_subtitle"><?=\Yii::t('index', 'We are ready to talk about any idea or can prepare an offer for your project');?></span>


                    <?php 
                    $model = new Bid;
                    $model->scenario = Bid::SCENARIO_PROJECT;
                    $model->form = Bid::FORM_PROJECT;

                    $form = ActiveForm::begin([
                        'id' => 'form_foot',
                        'action' => '/bids/bid/add',
                        
                        'enableClientValidation' => false,
                        'options' => [
                            'class' => 'footer_form bids-form',
                            'data-title' => 'Рассчитать проект',
                            'data-form' => 'Рассчитать проект',
                            'enctype' => 'multipart/form-data',
                            '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' => 'footer_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', 'Telephone'),
                                'class' => 'footer_form__input'
                            ]); ?>
                            
                            <?php echo $form->field($model, 'email', [
                                'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
                                'errorOptions' => []
                            ])->textInput([
                                'placeholder' => 'E-mail*',
                                'class' => 'footer_form__input'
                            ]); ?>
                            
                            <?php echo $form->field($model, 'text')->textArea([
                                'placeholder' => \Yii::t('form', 'Short text about your project or idea'),
                                'class' => 'footer_form__textarea'
                            ])->label(false); ?>
                            
                            <div class="file-upload_block dropzone" id="block_upload">
                                <div class="file_upload_bt">
                                    <div class="file-upload">
                                        <label>
                                            <span><?=\Yii::t('form', 'Choose file')?></span>
                                        </label>
                                    </div>
                                    <!--<input type="text" id="filename" class="filename" disabled>-->
                                    <div class="file_drop"><?=\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('index', 'Submit'), ['class' => 'btn-default save-button']); ?>

                        </div>

                    <?php ActiveForm::end(); ?>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 col-xs-4 col-sm-12">
                <a href="mailto:info@task-on.com" class="foot_mail">info@task-on.com</a>
            </div>
            <div class="col-md-4 col-xs-4 col-sm-12"><a href="#zvonok_form" class="zvonok_bt popup-form"><span><?=\Yii::t('form', 'Call me')?></span></a></div>
            <div class="col-md-4 col-xs-4 col-sm-12">
                <!-- <div class="phone_hover_foot">Стоимость звонка 0 руб,<br/> в том числе с мобильного</div> -->
                <span class="foot_phone"><?=\common\models\Settings::getValue('content-phone');?></span>
            </div>
        </div>
        <div class="footbottom_line">
            <div class="row">
                <div class="col-md-3 col-xs-3 col-sm-12">
                    <div class="foot_logo">
                        <img src="/images/foot_logo.png" height="51" width="192" alt="">
                    </div>
                </div>
                <div class="col-md-6  col-xs-6 col-sm-12">

                    <?php echo $this->render('block/social'); ?>
                    
                </div>
                <div class="col-md-3 col-xs-3 col-sm-12">
                    <div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
                    <div class="copyring"><?=\Yii::t('footer', 'Powered by Taskon')?></div>
                </div>
            </div>
        </div>
    </div>
</footer>

<div class="up-button-container">
    <div class="up-button"></div>
</div>

<?php echo $this->render('block/callback'); ?>