registration_for_company.php 2.63 KB
<?php
use yii\widgets\ActiveForm;
use \common\models\AccountsForm;
use \common\models\DicCities;
use \yii\helpers\ArrayHelper;
use \common\models\Deliveries;
use yii\captcha\Captcha;
?>
<div class="registration_for_company">
    <?php $form = ActiveForm::begin(['options' => ['enctype'=> 'multipart/form-data'], 'method'=>'post','action' => 'site/signup']); ?>
    <?= $form->field(new AccountsForm(), 'is_firm')->hiddenInput(['value'=>'1'])->label(false) ?>
    <?= $form->field(new AccountsForm(), 'company')->textInput(['maxlength' => 45,'placeholder'=>'Компания'])->label(false) ?>
    <?= $form->field(new AccountsForm(), 'name')->textInput(['maxlength' => 45,'placeholder'=>'Имя'])->label(false) ?>
    <?= $form->field(new AccountsForm(), 'surname')->textInput(['maxlength' => 45,'placeholder'=>'Фамилия'])->label(false) ?>
    <?= $form->field(new AccountsForm(), 'phones')->textInput(['maxlength' => 45,'placeholder'=>'Телефон'])->label(false) ?>

    <?= $form->field(new AccountsForm(), 'email')->textInput(['maxlength' => 45,'placeholder'=>'E-mail','class'=>'form-control telephone_registration'])->label(false) ?>

    <?= $form->field(new AccountsForm(), 'pass')->passwordInput(['maxlength' => 45,'placeholder'=>'Пароль','class'=>'form-control telephone_registration'])->label(false) ?>

    <?= $form->field(new AccountsForm(), 're_pass')->passwordInput(['maxlength' => 45,'placeholder'=>'Пароль','class'=>'form-control telephone_registration'])->label(false) ?>

    <?= $form->field(new AccountsForm(), 'country',['options'=>['class'=>'selectize_item2' ]])->dropDownList(
        ArrayHelper::map(DicCities::find()->where(['parent' => 0])->all(), 'id', 'name'),
        ['prompt' => 'Выберите область']
    )->label(false);
    ?>

    <?= $form->field(new AccountsForm(), 'city',['options'=>['class'=>'selectize_item2' ]])->dropDownList(
        [],
        ['prompt' => 'Выберите город']
    )->label(false);
    ?>

    <?= $form->field(new AccountsForm(), 'deliveries',['options'=>['class'=>'selectize_item2' ]])->dropDownList(
        ArrayHelper::map(Deliveries::find()->all(), 'id', 'name'),
        ['prompt' => 'Выберите тип перевозки']
    )->label(false);
    ?>

    <?= $form->field(new AccountsForm(), 'verifyCode')->widget(Captcha::className(), [
        'options'=>['placeholder'=>'Введите код' ],
        'template' => '<div>{input}</div><div class="row"><div class="col-lg-3">{image}</div></div>',
    ])->label(false); ?>

    <button class="purple" type="submit" value="Submit">Зарегистрироваться</button>
    <?php ActiveForm::end(); ?>
</div>