add change card, add customer tab

This commit is contained in:
2016-01-25 23:09:43 +01:00
parent 8d29f47d49
commit 9fb349ee64
19 changed files with 241 additions and 38 deletions

View File

@@ -0,0 +1,51 @@
<?php
use yii\helpers\Url;
?>
<?php
$route = \Yii::$app->controller->id .'/'. \Yii::$app->controller->action->id;
$items = [
[ 'Recepció', ['customer/reception', 'number' => $card->number ]],
[ 'Termék eladás', ['product/sale', 'number' => $card->number ]],
[ 'Adatlap', ['customer/update', 'number' => $card->number ]],
[ 'Befizetések', ['ticket/index', 'number' => $card->number] ],
[ 'Kulcsok', ['key/index', 'id_card' => $card->id_card] ],
[ 'Szerződések', ['contract/index', 'id_card' => $card->id_card ]],
];
?>
<ul class="nav nav-tabs">
<?php foreach ($items as $item){?>
<?php
if ( empty($title)){
if ( $item[1][0] == $route) {
$title = $item[0];
}
}
?>
<li role="presentation" class="<?php echo $item[1][0] == $route ? 'active' : '' ?>"><a href="<?php echo Url::toRoute($item[1])?>"><?php echo $item[0] ?></a></li>
<?php }?>
</ul>
<?php if ( !empty($title)) {?>
<h1><?php echo $title?></h1>
<p>Vendég: <?php echo $card->customer->name ?></p>
<p>Kártyaszám: <?php echo $card->number ?></p>
<?php }?>

View File

@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\ContractSearch */
@@ -11,9 +12,11 @@ use yii\helpers\Url;
$this->title = $searchModel->customer->name . " szerződései";
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo CustomerTabWidget::widget(['card' => $searchModel->card])?>
<div class="contract-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>

View File

@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\TicketInstallmentRequest;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $model common\models\Contract */
@@ -11,11 +12,10 @@ $this->title = "Szerződés részletek" ;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/contract', 'Szerződések'), 'url' => ['index', 'id_card' => $card->id_card]];
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo CustomerTabWidget::widget(['card' => $model->customer->card,'title' => 'Szerződés részletek'])?>
<div class="contract-view">
<h1><?= Html::encode($this->title) ?></h1>
<?= DetailView::widget([
'model' => $model,
'attributes' => [

View File

@@ -18,7 +18,7 @@ $this->registerJs ( 'new Customer( '. json_encode($options).');' );
}
</style>
<div class="row">
<div class="row" style='margin-top: 12px;' >
<div class="col-md-4">
<div id="my_camera" class='photo pull-left' style="width: 160px; height: 120px; margin-right: 12px;"></div>
<div id="my_result" class='photo pull-left' style="width: 160px; height: 120px;"></div>
@@ -26,4 +26,4 @@ $this->registerJs ( 'new Customer( '. json_encode($options).');' );
<div class="col-md-4">
</div>
</div>
<a id="snap" class="btn btn-primary">Fénykép</a>
<a id="snap" class="btn btn-primary" style="margin-top: 6px;" >Fénykép</a>

View File

@@ -19,6 +19,7 @@ use yii\base\Widget;
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'photo_data')->hiddenInput()->label(false) ?>
<div class='row'>
<div class='col-md-3'>
<?php //echo $form->field($model, 'cardNumber')->widget(CardNumberTypeahead::className(),[]) ?>
@@ -28,7 +29,7 @@ use yii\base\Widget;
</div>
</div>
<div class='col-md-3'>
<?php //echo $form->field($model, 'partnerCardNumber')->textInput() ?>
<?php echo $form->field($model, 'replacementCardNumber')->textInput()->label("Csere új kártyára") ?>
</div>
</div>

View File

@@ -1,45 +1,41 @@
<?php
use yii\helpers\Html;
use frontend\components\ReceptionMenuWidget;
use frontend\components\ReceptionCardNumberWidget;
use frontend\components\ReceptionWidget;
use common\assets\WebcamjsAsset;
use frontend\assets\CustomerAsset;
use common\components\Image;
use yii\helpers\Url;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
$this->title = Yii::t('common/customer', 'Update customer:' ) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_customer]];
$this->params['breadcrumbs'][] = Yii::t('common/customer', 'Update');
$customer = $model;
$card = $customer->card;
$this->title = Yii::t('common/customer', 'Update customer:' ) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => "Recepció", 'url' => ['customer/reception' ,'number' => $card->number]];
$this->params['breadcrumbs'][] = Yii::t('common/customer', 'Update');
?>
<div class="customer-update">
<?php // echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
<?php echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
<?php echo CustomerTabWidget::widget(['card' => $card])?>
<?php echo $this->render('_camera',['model' => $model]); ?>
<h1><?= Html::encode($this->title) ?></h1>
<div style='margin-top: 12px'>
<?php if ( $model->image1 ){
echo Html::img( Url::base( ) . Image::thumb( $model->image1->path,160,120 ));
}
?>
</div>
<?= $this->render('_form_update', [
'model' => $model,
]) ?>

View File

@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\KeySearch */
@@ -11,13 +12,13 @@ use yii\helpers\Url;
$this->title = Yii::t('frontend/key', 'Vendéghez rendelt kulcsok');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php echo CustomerTabWidget::widget(['card' => $searchModel->card])?>
<div class="key-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<h2>Vendég: <?php echo $searchModel->card->customer->name ;?></h2>
<h2>Kártyaszám: <?php echo $searchModel->card->number ;?></h2>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [

View File

@@ -7,6 +7,7 @@ use frontend\components\ReceptionCardNumberWidget;
use frontend\components\ReceptionWidget;
use yii\base\Widget;
use common\models\Ticket;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\TicketSearch */
@@ -22,10 +23,11 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="ticket-index">
<?php echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
<?php // echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
<h1><?= Html::encode($this->title) ?></h1>
<?php echo CustomerTabWidget::widget(['card' => $receptionForm->card])?>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>

View File

@@ -1,18 +1,19 @@
<?php
use yii\helpers\Html;
use frontend\components\CustomerTabWidget;
/* @var $this yii\web\View */
/* @var $model common\models\Ticket */
$this->title = "Bérlet módosítása:" . ' ' . $model->id_ticket;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket', 'Tickets'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_ticket, 'url' => ['view', 'id' => $model->id_ticket]];
$this->params['breadcrumbs'][] = ['label' =>'Befizetések', 'url' => ['index', 'number' =>$model->card->number]];
$this->params['breadcrumbs'][] = Yii::t('common/ticket', 'Update');
?>
<?php echo CustomerTabWidget::widget(['card' => $model->card,'title' => 'Bérlet módosítása'])?>
<p><?php echo "Bérlet azonosító: " . $model->id_ticket ?></p>
<div class="ticket-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_update', [
'model' => $model,