<?php

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

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

<?php 
	$userOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions(User::find()->all(),'id','username');
	$ticketTypeOptions = ['' => 'Mind'] + HtmlHelper::mkTicketTypeOptions(TicketType::find()->all());
?>

<div class="transfer-search">

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

    
     <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])  ?>
				
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])  ?>
		</div>
	</div>
	 <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'enterStart')->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])->label("Belépések -tól")  ?>

		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'enterEnd') ->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])->label("Belépések -ig")  ?>
		</div>
	</div>
     <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions)->label("Bérlet típus")  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
		</div>
	</div>

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


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

</div>
