<?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;
use kartik\widgets\DateTimePicker;

/* @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' => ['index'],
        'method' => 'get',
    ]); ?>
    
    <div class='row'>
		<div class='col-md-3'>
	    	<?= $form->field($model, 'id_account')->dropDownList( ['' => Yii::t('common/transfer', 'All')]  +HtmlHelper::mkAccountOptions($accounts) ) ?>
		</div>
		<div class='col-md-3'>
	    	 <?php  echo $form->field($model, 'types')->checkboxList( Transfer::types())  ?>
		</div>
		<div class='col-md-3'>
	    	<?= $form->field($model, 'id_user')->dropDownList( ['' => Yii::t('common/transfer', 'All')]  +ArrayHelper::map($users,'id' , 'username') ) ?> 
		</div>
		<div class='col-md-3'>
	    	<?= $form->field($model, 'status')->dropDownList( ['' => "Mind"]  + Transfer::statuses() ) ?> 
		</div>
	</div>
    
    <div class="row">
		<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 class='col-md-3'>
	    	<?= $form->field($model, 'payment_method')->dropDownList( ['' => "Mind"]  + Transfer::paymentMethods() ) ?> 
		</div>
		<div class='col-md-3'>
	    	<?= $form->field($model, 'customer_name')->label("Vendég")  ?> 
		</div>
	</div>

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

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

</div>
