<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;
use kartik\widgets\DateTimePicker;
use yii\helpers\ArrayHelper;

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

<?php 

$accountOptions =  ['' =>Yii::t('frontend/collection','All')]+ HtmlHelper::mkAccountOptions($model->accounts);
$userOptions =  ['' =>Yii::t('frontend/collection','All')]+ ArrayHelper::map($model->users,'id','username');

?>

<div class="collection-search">

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


	<div class='row'>
		<div class='col-md-3'>
		    <?= $form->field($model, 'id_account')->dropDownList( $accountOptions ) ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'id_user')->dropDownList( $userOptions ) ?>
		</div>
		<div class="col-md-3">
		    <?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])  ?>
		</div>
		<div class="col-md-3">
		    <?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
			])  ?>
		</div>
		
	</div>

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

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

</div>
