<?php 
use frontend\components\ReceptionCardNumberWidget;
use frontend\components\ReceptionMenuWidget;
use frontend\models\ReceptionForm;
use frontend\components\ReceptionCardNumberTicketsWidget;
use yii\base\Widget;
use frontend\components\ReceptionTicketWidget;
use frontend\components\ReceptionCustomerWidget;
use yii\widgets\ActiveForm;
use yii\helpers\Html;

/** @var $model frontend\models\ReceptionForm */
?>
<?php 
	$alertClass = "info";
	$cassaMessage = "Nyitva";
	if ( $model->isCassaClose() ){
		$alertClass = "danger";
		$cassaMessage = "Zárva";
	}else if ( !$model->hasCassa() ){
		$alertClass = "danger";
		$cassaMessage = "Nincs kassza kiválasztva";
	}
?>
<div class='row'>
		<div class='col-md-4'>
			<div class="alert alert-<?php echo $alertClass;?>">
				Aktuális kassza: <?php echo $model->getDefaultAccountName();?> - 
				<?php echo $cassaMessage;?>
			</div>
		</div>
		 <?php $form = ActiveForm::begin([
		        'action' => ['card/index'],
		        'method' => 'get',
		    ]); ?>
		<div class='col-md-3'>
			 <?php echo Html::textInput('CardSearch[customerName]','',['class'=>"form-control", 'placeholder' =>'Vendég neve']) ?>
		    
    	</div>
    	<div class='col-md-2'>
        <?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary btn-block']) ?>
    	</div>
     <?php ActiveForm::end(); ?>	
</div>
<?php /* ?>
<div class="row" style="margin-bottom: 6px;">
		<div class='col-md-4'>
		</div>	
		 <?php $form = ActiveForm::begin([
		        'action' => ['key/toggle', 'number' =>  $model->getCardNumber()],
		        'method' => 'post',
		    ]); ?>
		<div class='col-md-3'>
			<?php echo Html::hiddenInput('number', $model->getCardNumber())?>
			 <?php echo Html::textInput('KeyToggleForm[key]','',['class'=>"form-control", 'placeholder' =>'Kulcs']) ?>
		    
    	</div>
    	<div class='col-md-2'>
        <?= Html::submitButton(Yii::t('frontend/collection', 'Ki/Be'), ['class' => 'btn btn-primary btn-block']) ?>
    	</div>
     <?php ActiveForm::end(); ?>		
		
	</div>
<?php */ ?>
<div class='row'>
		<div class='col-md-3'>
			<?php echo ReceptionMenuWidget::widget( [  'model' => $model ] ) ?>
		</div>
		<div class='col-md-2'>
			<?php echo ReceptionCardNumberWidget::widget( [ 'model' => $model, 'route' => ['customer/reception'] ] )?>
		</div>
		<div class='col-md-4'>
			<?php echo ReceptionCustomerWidget::widget([  'model' => $model ] ) ?>
		</div>
		<div class='col-md-3'>
			<?php echo ReceptionTicketWidget::widget([  'model' => $model ] ) ?>
		</div>
	</div>
