<?php

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

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

?>
<div class="transfer-search">

    <?php $form = ActiveForm::begin([
        'action' => ['summary'],
        'method' => 'get',
    ]); ?>
    
    <div class='row'>
		<div class='col-md-4'>
	    	<?= $form->field($model, 'id_account')->dropDownList( ['' => Yii::t('common/transfer', 'All')]  +HtmlHelper::mkAccountOptions($accounts) ) ?>
		</div>
		<div class='col-md-4'>
	    	<?= $form->field($model, 'id_user')->dropDownList( ['' => Yii::t('common/transfer', 'All')]  +ArrayHelper::map($users,'id' , 'username') ) ?> 
		</div>
	</div>
    
    <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'start')->widget(DatePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd'
				    ]
				])  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd'
				    ]
				])  ?>
		</div>
	</div>

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

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

</div>
