<?php

use yii\helpers\Html;

use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use backend\modules\bhsx\models\User;
use backend\modules\bhsx\models\BiayaToefl;
/* @var $this yii\web\View */
/* @var $model backend\modules\bhsx\models\PesertaToefl */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="peserta-toefl-form">
    <div class="col-lg-6">

    <?php $form = ActiveForm::begin(); ?>

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

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

   <!-- <?= $form->field($model, 'tanggal_lahir')->textInput() ?>-->
    <?php // echo '<label>Check Issue Date</label>';
    /*  echo DatePicker::widget([
        'name' => 'check_issue_date', 
        'value' => date('d-M-Y', strtotime('+2 days')),
        'options' => ['placeholder' => 'Select issue date ...'],
        'pluginOptions' => [
            'format' => 'dd-M-yyyy',
            'todayHighlight' => true
        ]
    ]); */
        
            echo $form->field($model, 'tanggal_lahir')->widget(DatePicker::classname(), [
            'options' => ['placeholder' => 'Enter birth date ...'],
            'pluginOptions' => [
                'autoclose'=>true,
                'todayHighlight' => true,
                    'todayBtn' => true,
                    'dateFormat' => 'yyyy-MM-dd',
            ]
        ]);
            ?>

    <?= $form->field($model, 'alamat')->textarea(['rows' => 6]) ?>

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

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

    <?=
         $form->field($model, 'biaya_id')->widget(Select2::classname(), [
            'data' => ArrayHelper::map(BiayaToefl::find()->all(), 'biaya_id','biaya_test', 'membership'),
            'options' => ['placeholder' => 'Select a state ...'],
            'pluginOptions' => [
                'allowClear' => false
            ],
        ]);
      
        ?> 

  
    <?php
        $a= ['friends' => 'Friends', 'workplace' => 'Workplace','parents' => 'Parents', 'website' => 'IT Del Website','facebook' => 'IT Del Facebook', 'twitter' => 'IT Del Twitter','institut' => 'Educational Institution', 'others' => 'Others'];
        echo $form->field($model, 'sumber_informasi')->dropDownList($a,['prompt'=>'Select Option']);
    ?>


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

    <?php
        $tujuan= ['beasiswa' => 'Scholarship Application', 'persiapan toefl' => 'Toefl Preparation','wisuda' => 'Graduation', 'admisi' => ' Admission to University','kerja' => 'Admission to Workplace', 'others' => 'Others',];
        echo $form->field($model, 'tujuan_toefl')->dropDownList($tujuan,['prompt'=>'Select Option']);
    ?>

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

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

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

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

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

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

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

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


    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

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

</div>
