<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\widgets\ActiveForm;
use kartik\typeahead\TypeaheadBasic;

$field_template = "{label} <span class='required-field'>*</span>\n<div>{input}</div>\n{hint}\n{error}";

?>

<div class="training-request-form">

    <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>

    <?= $form->field($model, 'full_name')->textInput(['maxlength' => true, 'readonly' => $readonly_essential_info]) ?>

    <?= $form->field($model, 'full_name_english')->textInput(['maxlength' => true, 'readonly' => $readonly_essential_info]) ?>

    <?= $form->field($model, 'mother_name')->textInput(['maxlength' => true, 'readonly' => $readonly_essential_info]) ?>

    <?= $form->field($model, 'gender')->dropDownList([ 'Male' => Yii::t('app', 'Male'), 'Female' => Yii::t('app', 'Female')], ['prompt' => Yii::t('app', 'Select Gender'), 'disabled' => $readonly_essential_info]) ?>

    <?= $form->field($model, 'residence_place')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'phone')->textInput() ?>

    <?= $form->field($model, 'mobile')->textInput() ?>

    <?= $form->field($model, 'alternative_phone_number')->textInput() ?>

    <?= $form->field($model, 'educational_degree')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'university_name')->widget(TypeaheadBasic::class, [
            'data' => ArrayHelper::map($universities_names, 'university_name', 'university_name'),
            'pluginOptions' => ['highlight' => true],
        ]); ?>

    <?= $form->field($model, 'faculty')->widget(TypeaheadBasic::class, [
            'data' => ArrayHelper::map($faculties_names, 'faculty', 'faculty'),
            'pluginOptions' => ['highlight' => true],
        ]); ?>

    <?= $form->field($model, 'year_of_study')->dropDownList([
        'First' => Yii::t('app', 'First'),
        'Second' => Yii::t('app', 'Second'),
        'Third' => Yii::t('app', 'Third'),
        'Fourth' => Yii::t('app', 'Fourth'),
        'Fifth' => Yii::t('app', 'Fifth'),
        'Sixth' => Yii::t('app', 'Sixth'),
        'Graduated' => Yii::t('app', 'Graduated'),
    ], ['prompt' => Yii::t('app', 'Select Year Of Study')]) ?>

    <?= $form->field($model, 'university_training_request')->fileInput() ?>

    <?= $form->field($model, 'personal_photo')->fileInput() ?>

    <?= $form->field($model, 'identity')->fileInput() ?>

    <div class="form-group">
        <?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success']) ?>
    </div>

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

</div>
