add reception customer search, fix reception ticket types, fix card number routing, timezone changes

This commit is contained in:
2016-01-06 21:20:21 +01:00
parent 39ae361505
commit 6d2e15cac7
15 changed files with 251 additions and 11 deletions

View File

@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model frontend\models\CollectionSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
?>
<div class="collection-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class='row'>
<div class="col-md-4">
<?php echo $form->field($model, 'customerName') ?>
</div>
<div class="col-md-4">
<?php echo $form->field($model, 'number') ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,70 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use common\components\AccountTotalWidget;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\CollectionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/collection', 'Vendégek');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="collection-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'card_number',
'label' => 'Kártyaszám',
],
[
'attribute' => 'customer_name',
'label' => 'Név',
],
[
'attribute' => 'customer_phone',
'label' => 'Tel',
],
[
'attribute' => 'customer_email',
'label' => 'E-mail',
],
// [
// 'attribute' => 'customer.name',
// 'value' => 'customer.name',
// ],
['class' => 'yii\grid\ActionColumn',
'template' => '{ticket} {ticket_history}',
'buttons' => [
'ticket' => function ($url, $model, $key) {
return Html::a('Új bérlet', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
},
'ticket_history' => function ($url, $model, $key) {
return Html::a('Befizetések', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
},
],
'urlCreator' => function ($action, $model, $key, $index){
$url = "";
if ( 'ticket' == $action ){
$url = Url::to(['ticket/create','number' => $model['card_number']]);
}else if ( 'ticket_history' == $action ){
$url = Url::to(['ticket/index','number' => $model['card_number']]);
}
return $url;
}
],
],
]); ?>
</div>

View File

@@ -6,6 +6,8 @@ use frontend\components\ReceptionCardNumberTicketsWidget;
use yii\base\Widget;
use frontend\components\ReceptionTicketWidget;
use frontend\components\ReceptionCustomerWidget;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
<div class='row'>
<div class='col-md-4'>
@@ -13,6 +15,19 @@ use frontend\components\ReceptionCustomerWidget;
Aktuális kassza: <?php echo $model->getDefaultAccountName();?>
</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-3'>
<?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<div class='row'>
<div class='col-md-3'>

View File

@@ -6,3 +6,9 @@ use frontend\components\ReceptionWidget;
?>
<h1>Recepció</h1>
<?php echo ReceptionWidget::widget( ['form' => $model, 'route' => ['customer/reception'] ] )?>
<?php
// echo "Timezone:" . date_default_timezone_get();
//echo date("Y-m-d H:i");
?>