<?php

use yii\widgets\ActiveForm;
use yii\helpers\Html;

use common\modules\bids\models\Bid;

?>

<div class="hidden">
    <div id="article" class="popup popup_2 blog_form">
        <div class="txtbtnclose"><?=\Yii::t('blog', 'Close')?></div>
        <span class="popup__title"><?=\Yii::t('blog', 'Suggest an article for the blog')?></span>

        <?php 
        $model = \Yii::$app->controller->getModel();
        $model->form = 'article';

        $form = ActiveForm::begin([
            'action' => '/blog/post/send-article',
            'enableClientValidation' => false,
            'options' => [
                'class' => 'valid_form bids-form blog-form',
                'data-title' => 'Предложить статью для блога',
                'data-form' => 'Предложить статью для блога',
                'data-tag' => Bid::TAG_TREATMENT
            ],
        ]); ?>

            <div class="message-box send_secce">Заявка на статью отправлена. Мы обязательно ее рассмотрим.</div>

            <div class="content">

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

                <div class="blog_form_left form_resp">

                    <div>

                        <?php echo $form->field($model, 'name')->textInput([
                            'placeholder' => \Yii::t('form', 'Your name'),
                            'class' => 'input_st'
                        ])->label(false); ?>

                        <?php echo $form->field($model, 'email')->textInput([
                            'placeholder' => 'E-mail',
                            'class' => 'input_st'
                        ])->label(false); ?>

                    </div>

                </div>

                <div class="blog_form_right form_resp">
                    <p><strong><?=\Yii::t('blog', 'You can offer an article for publication or write to us about what is interesting to read.')?></strong></p>
                    <p><strong><?=\Yii::t('blog', 'We are happy to share our experience and write an interesting article.')?></strong></p>
                </div>

                <div class="blog_lmg">
                    <img src="/images/blog_form_img.png" height="123" width="118" alt="">
                </div>

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

                <br>
               
                <?php echo $form->field($model, 'message')->textArea([
                    'placeholder' => \Yii::t('form', 'Write here summary of your article or send a short offer.'),
                    'class' => 'sect_cont_form__textarea'
                ])->label(false); ?>        

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

                <?php echo Html::submitButton(\Yii::t('blog', 'Submit'), ['class' => 'save-button btn-default button-lg']); ?>

            </div>

        <?php ActiveForm::end(); ?>

    </div>


    <div id="feedback" class="popup popup_2 blog_form_2">
        <div class="txtbtnclose"><?=\Yii::t('blog', 'Close')?></div>
        <span class="popup__title"><?=\Yii::t('blog', 'Offer a subject')?></span>
        <p><strong><?=\Yii::t('blog', "We are ready to share our experience, let us know what a topic you're interested in.")?></strong></p>
        <br>

        <?php 
        $model = \Yii::$app->controller->getModel();
        $model->form = 'theme';

        $form = ActiveForm::begin([
            'action' => '/blog/post/send-article',
            'enableClientValidation' => false,
            'options' => [
                'class' => 'valid_form bids-form blog-form',
                'data-title' => 'Предложить тему для блога',
                'data-form' => 'Предложить тему для блога',
                'data-tag' => Bid::TAG_TREATMENT
            ],
        ]); ?>

            <div class="message-box send_secce">Заявка на статью по предложенной теме отправлена. Мы обязательно ее рассмотрим.</div>

            <div class="content">

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

                <div class="blog_form_left50 form_resp">

                    <div>

                        <?php echo $form->field($model, 'name')->textInput([
                            'placeholder' => \Yii::t('form', 'Your name'),
                            'class' => 'input_st'
                        ])->label(false); ?>                
                    </div>

                </div>

                <div class="blog_form_right50 form_resp">

                    <?php echo $form->field($model, 'email')->textInput([
                            'placeholder' => 'E-mail',
                            'class' => 'input_st'
                        ])->label(false); ?>

                </div>
                
                <div class="clear"></div>
                
                <?php echo $form->field($model, 'message')->textArea([
                    'placeholder' => \Yii::t('blog', "What a subject you're interested in?
For example: write about CRM"),
                    'class' => 'sect_cont_form__textarea'
                ])->label(false); ?>  
                

                <div class="clear"></div>
               
                <?php echo Html::submitButton(\Yii::t('blog', ' Submit '), ['class' => 'save-button btn-default button-lg']); ?>

            </div>

        <?php ActiveForm::end(); ?>

    </div>
</div>

<style>
    .blog-form input,
    .blog-form textarea {
        margin-bottom: 10px !important;
    }
</style>