<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DateTimePicker;
use frontend\components\HtmlHelper;
use common\models\AccountState;

/* @var $this yii\web\View */
/* @var $model frontend\models\AccountstateSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php 
$accountOptions =   ['' =>'Mind']+ HtmlHelper::mkAccountOptions(  $model->accounts );
$userOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions($model->users,'id','username');
$typeOptions =  ['' => 'Mind'] + AccountState::types();
?>
<div class="account-state-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>


    <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'id_account')->dropDownList($accountOptions)  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'type')->dropDownList($typeOptions)  ?>
		</div>
	</div>
    
    <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])->label('Időszak kezdete')  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])->label("Időszak vége")  ?>
		</div>
	</div>


    <div class="form-group">
        <?= Html::submitButton(Yii::t('frontend/account-state', 'Search'), ['class' => 'btn btn-primary']) ?>
    </div>

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

</div>
