add default account to frontend
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Customer */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
$customername = "";
|
||||
$number = "";
|
||||
if ( isset($card)){
|
||||
$number = $card->number;
|
||||
}
|
||||
if ( isset($customer) ){
|
||||
$customername = $customer->name;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'enableAjaxValidation' => false,
|
||||
'method' => 'get',
|
||||
'action' => $route
|
||||
]); ?>
|
||||
<div class="row" >
|
||||
<div class='col-md-12'>
|
||||
<?php echo Html::textInput("number", $number )?>
|
||||
</div>
|
||||
<div class='col-md-12'>
|
||||
<?php echo $customername; ?>
|
||||
</div>
|
||||
<div class='col-md-12'>
|
||||
<?php echo Html::submitButton( Yii::t('frontend/card', "Search"),[ 'class' => 'btn btn-primary']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use frontend\components\HtmlHelper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $card common\models\Card */
|
||||
/* @var $customer common\models\Customer */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<style >
|
||||
.btn.btn-reception{
|
||||
width:100%;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$customername = "";
|
||||
if ( isset($customer ) ){
|
||||
$customername = $customer->name;
|
||||
}
|
||||
|
||||
/*
|
||||
function mkCustomerBtn($card, $label,$route = null ){
|
||||
|
||||
$url = null;
|
||||
$classes = 'btn btn-primary btn-reception';
|
||||
if ( $card == null ){
|
||||
$classes .= ' disabled';
|
||||
}
|
||||
if ( isset($route)){
|
||||
$url = [$route, 'number' => ( isset( $card ) ? $card->number : '' )];
|
||||
}
|
||||
return Html::a( $label , $url, ['class' => $classes ] );
|
||||
}
|
||||
function mkBtn($card, $label,$route = null ){
|
||||
|
||||
$url = null;
|
||||
$classes = 'btn btn-primary btn-reception';
|
||||
|
||||
if ( isset($route)){
|
||||
$url = [$route, 'number' => ( isset( $card ) ? $card->number : '' )];
|
||||
}
|
||||
|
||||
return Html::a( $label , $url, ['class' => $classes ] );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
?>
|
||||
<div class='row'>
|
||||
<div class='col-md-8'>
|
||||
<?php echo HtmlHelper::mkReceptionCardBtn( $card, Yii::t( 'frontend/customer' , 'Adatlap') , 'customer/update' ); ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , Url::toRoute('customer/create') , ['class' => 'btn btn-primary btn-reception'] )?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-8'>
|
||||
<?php echo HtmlHelper::mkReceptionCardBtn( $card, Yii::t( 'frontend/customer' , 'Befizetések') , 'ticket/index'); ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo HtmlHelper::mkReceptionCardBtn( $card, Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , 'ticket/create' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<?php echo HtmlHelper::mkReceptionBtn($card, Yii::t( 'frontend/transfer', 'Termékeladás'), 'product/sale')?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -4,15 +4,20 @@ use frontend\components\ReceptionMenuWidget;
|
||||
use frontend\models\ReceptionForm;
|
||||
use frontend\components\ReceptionCardNumberTicketsWidget;
|
||||
use yii\base\Widget;
|
||||
use frontend\components\ReceptionTicketWidget;
|
||||
use frontend\components\ReceptionCustomerWidget;
|
||||
?>
|
||||
<div class='row'>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
|
||||
<?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 ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['customer/reception'] ] )?>
|
||||
<?php echo ReceptionCustomerWidget::widget([ 'model' => $model ] ) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo ReceptionCardNumberTicketsWidget::widget([ 'tickets' => $tickets, 'customer' => $customer, 'card' =>$card, 'route' => ['customer/reception'] ] ) ?>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionTicketWidget::widget([ 'model' => $model ] ) ?>
|
||||
</div>
|
||||
</div>
|
||||
45
frontend/views/common/_reception_customer.php
Normal file
45
frontend/views/common/_reception_customer.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
use common\models\Ticket;
|
||||
use frontend\model\ReceptionForm;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use yii\base\Widget;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\model\ReceptionForm */
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( $model->isCardWithCustomer() ){
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
echo DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' =>[
|
||||
[
|
||||
'label' => 'Kártyaszám',
|
||||
'value' => $model->card->number
|
||||
],
|
||||
[
|
||||
'label' => 'Vendég',
|
||||
'value' => $model->customer->name
|
||||
],
|
||||
[
|
||||
'label' => 'E-Mail',
|
||||
'value' => $model->customer->email
|
||||
],
|
||||
[
|
||||
'label' => 'Telefon',
|
||||
'value' => $model->customer->phone
|
||||
],
|
||||
]
|
||||
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
50
frontend/views/common/_reception_form_card_number.php
Normal file
50
frontend/views/common/_reception_form_card_number.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Customer */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
||||
.form-card-number input, .form-card-number button{
|
||||
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$number = "";
|
||||
if ( isset($model->card)){
|
||||
$number = $model->card->number;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="form-card-number">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'enableAjaxValidation' => false,
|
||||
'method' => 'get',
|
||||
'action' => $route
|
||||
]); ?>
|
||||
<div class="row" >
|
||||
<div class='col-md-12'>
|
||||
<?php echo Html::textInput("number", $number ,['class' => 'form-control'])?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" >
|
||||
<div class='col-md-12'>
|
||||
<?php echo Html::submitButton( Yii::t('frontend/card', "Search"),[ 'class' => 'btn btn-primary btn-block']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
59
frontend/views/common/_reception_menu.php
Normal file
59
frontend/views/common/_reception_menu.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use frontend\components\HtmlHelper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $card common\models\Card */
|
||||
/* @var $customer common\models\Customer */
|
||||
/* @var $model frontend\models\ReceptionForm */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<style >
|
||||
.btn.btn-reception{
|
||||
width:100%;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$customername = "";
|
||||
if ( isset($model->customer ) ){
|
||||
$customername = $model->customer->name;
|
||||
}
|
||||
|
||||
$card = $model->card;
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<div class='row'>
|
||||
<div class='col-md-8'>
|
||||
<?php echo HtmlHelper::mkReceptionCustomerBtn( $model, Yii::t( 'frontend/customer' , 'Adatlap') , 'customer/update' ); ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , Url::toRoute('customer/create') , ['class' => 'btn btn-primary btn-reception'] )?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-8'>
|
||||
<?php echo HtmlHelper::mkReceptionCustomerBtn( $model, Yii::t( 'frontend/customer' , 'Befizetések') , 'ticket/index'); ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo HtmlHelper::mkReceptionCustomerBtn( $model, Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , 'ticket/create' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<?php echo HtmlHelper::mkReceptionBtn($model, Yii::t( 'frontend/transfer', 'Termékeladás'), 'product/sale')?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
60
frontend/views/common/_reception_ticket.php
Normal file
60
frontend/views/common/_reception_ticket.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
use yii\base\Object;
|
||||
use common\models\Ticket;
|
||||
use frontend\model\ReceptionForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\model\ReceptionForm */
|
||||
?>
|
||||
<style>
|
||||
</style>
|
||||
<?php
|
||||
$ticket = null;
|
||||
if ( count($model->tickets) > 0 ){
|
||||
$ticket = $model->tickets[0];
|
||||
}
|
||||
|
||||
if ( isset($model->card)){
|
||||
if ( isset($model->customer)){
|
||||
if ( isset($ticket)){
|
||||
echo Html::beginTag("div",['class'=>"alert alert-success" , "role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Érvényes bérlet!" ;
|
||||
echo Html::endTag("strong");
|
||||
echo Html::tag("br");
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Típus: " ;
|
||||
echo Html::endTag("strong");
|
||||
echo $ticket->ticketTypeName ;
|
||||
echo Html::tag("br");
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Érvényes: " ;
|
||||
echo Html::endTag("strong");
|
||||
echo Yii::$app->formatter->asDate($ticket->start);
|
||||
echo " - ";
|
||||
echo Yii::$app->formatter->asDate($ticket->end);
|
||||
echo Html::endTag("div");
|
||||
}else{
|
||||
echo Html::beginTag("div",['class'=>"alert alert-danger", "role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Bérlet lejárt vagy nem érvényes!";
|
||||
echo Html::endTag("strong");
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
}else{
|
||||
echo Html::beginTag("div",['class'=>"alert alert-info" ,"role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Üres bérlet!";
|
||||
echo Html::endTag("strong");
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
}else{
|
||||
echo Html::beginTag("div",['class'=>"alert alert-warning" ,"role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Nincs bérlet megadva!";
|
||||
echo Html::endTag("strong");
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user