<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use backend\models\DoorLogSearch;
use kartik\widgets\DateTimePicker;
use common\models\Account;
use common\components\Helper;
use frontend\components\HtmlHelper;

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

<?php 

	 $accountOptions =   ['' =>'Mind']+ HtmlHelper::mkAccountOptions(   Account::read() );

?>

<div class="door-log-search">

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>
<div class="row">
		<div class="col-md-3">

    <?= $form->field($model, 'searchCardNumber') ?>
		</div>
		<div class="col-md-3">

    <?= $form->field($model, 'searchCustomerName') ?>

		</div>
		<div class="col-md-3">

	    <?= $form->field($model, 'id_customer')->label("Vendég azon.") ?>

		</div>
		<div class="col-md-3">
    <?= $form->field($model, 'searchKeyName') ?>

		</div>
		</div>

    <?php // echo $form->field($model, 'type') ?>

    <?php // echo $form->field($model, 'created_at') ?>

	<div class="row">
			<div class="col-md-3">
			    <?= $form->field($model, 'direction')->dropDownList(['' => 'Mind' ] +  DoorLogSearch::getAllDoorLog() ) ?>
			</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 class="col-md-3">
			    <?= $form->field($model, 'id_account')->dropDownList( $accountOptions )->label("Kassza") ?>
			</div>
		 
	</div>

    <div class="form-group">
        <?= Html::submitButton(Yii::t('common/door_log', 'Keresés'), ['class' => 'btn btn-primary']) ?>
    </div>

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

</div>
