<?php

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

/* @var $this yii\web\View */
/* @var $model backend\models\AccountStateSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<?php 

$accountOptions = ['' => 'Mind'] +  HtmlHelper::mkAccountOptions($accounts);
$userOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions($users,'id','username')
?>

<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_user')->dropDownList($userOptions) ?>
		</div>
		<div class='col-md-4'>
		    <?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
		</div>
		<div class='col-md-4'>
		    <?= $form->field($model, 'type')->dropDownList(['' => 'Mind']+AccountState::types()) ?>
		</div>
	</div>



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


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

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

</div>
