add reception changes
This commit is contained in:
parent
8e235a8d3c
commit
2b57f95b1e
30
composer.lock
generated
30
composer.lock
generated
@ -318,16 +318,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/bootstrap-fileinput",
|
"name": "kartik-v/bootstrap-fileinput",
|
||||||
"version": "v4.2.6",
|
"version": "v4.2.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/kartik-v/bootstrap-fileinput.git",
|
"url": "https://github.com/kartik-v/bootstrap-fileinput.git",
|
||||||
"reference": "e4906dd5ee852a5333d3ce4d19f69ee855efe844"
|
"reference": "0468bbba9c28c1250aca83eba9b33e32ec135f78"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/kartik-v/bootstrap-fileinput/zipball/e4906dd5ee852a5333d3ce4d19f69ee855efe844",
|
"url": "https://api.github.com/repos/kartik-v/bootstrap-fileinput/zipball/0468bbba9c28c1250aca83eba9b33e32ec135f78",
|
||||||
"reference": "e4906dd5ee852a5333d3ce4d19f69ee855efe844",
|
"reference": "0468bbba9c28c1250aca83eba9b33e32ec135f78",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@ -362,20 +362,20 @@
|
|||||||
"progress",
|
"progress",
|
||||||
"upload"
|
"upload"
|
||||||
],
|
],
|
||||||
"time": "2015-08-26 18:42:44"
|
"time": "2015-09-13 17:39:44"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/bootstrap-star-rating",
|
"name": "kartik-v/bootstrap-star-rating",
|
||||||
"version": "v3.5.3",
|
"version": "v3.5.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/kartik-v/bootstrap-star-rating.git",
|
"url": "https://github.com/kartik-v/bootstrap-star-rating.git",
|
||||||
"reference": "bd9c52db6ac71cb270620c1aee601d142ab2cc00"
|
"reference": "987777ee21a599bebbc545c743063fcee9833842"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/kartik-v/bootstrap-star-rating/zipball/bd9c52db6ac71cb270620c1aee601d142ab2cc00",
|
"url": "https://api.github.com/repos/kartik-v/bootstrap-star-rating/zipball/987777ee21a599bebbc545c743063fcee9833842",
|
||||||
"reference": "bd9c52db6ac71cb270620c1aee601d142ab2cc00",
|
"reference": "987777ee21a599bebbc545c743063fcee9833842",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@ -403,7 +403,7 @@
|
|||||||
"jquery",
|
"jquery",
|
||||||
"star"
|
"star"
|
||||||
],
|
],
|
||||||
"time": "2015-06-18 14:42:46"
|
"time": "2015-09-21 09:06:33"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/dependent-dropdown",
|
"name": "kartik-v/dependent-dropdown",
|
||||||
@ -1036,16 +1036,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/yii2-widget-select2",
|
"name": "kartik-v/yii2-widget-select2",
|
||||||
"version": "v2.0.2",
|
"version": "v2.0.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/kartik-v/yii2-widget-select2.git",
|
"url": "https://github.com/kartik-v/yii2-widget-select2.git",
|
||||||
"reference": "585e8797d7982e0c9d09370b98b451a028a59439"
|
"reference": "e72880e7e8dfc845c112ed7df275bf1c929be6db"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/kartik-v/yii2-widget-select2/zipball/585e8797d7982e0c9d09370b98b451a028a59439",
|
"url": "https://api.github.com/repos/kartik-v/yii2-widget-select2/zipball/e72880e7e8dfc845c112ed7df275bf1c929be6db",
|
||||||
"reference": "585e8797d7982e0c9d09370b98b451a028a59439",
|
"reference": "e72880e7e8dfc845c112ed7df275bf1c929be6db",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1080,7 +1080,7 @@
|
|||||||
"widget",
|
"widget",
|
||||||
"yii2"
|
"yii2"
|
||||||
],
|
],
|
||||||
"time": "2015-07-01 15:20:59"
|
"time": "2015-09-12 19:56:48"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kartik-v/yii2-widget-sidenav",
|
"name": "kartik-v/yii2-widget-sidenav",
|
||||||
|
|||||||
@ -10,6 +10,7 @@ use yii\web\Controller;
|
|||||||
use yii\web\NotFoundHttpException;
|
use yii\web\NotFoundHttpException;
|
||||||
use yii\filters\VerbFilter;
|
use yii\filters\VerbFilter;
|
||||||
use yii\base\Object;
|
use yii\base\Object;
|
||||||
|
use common\models\Card;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CustomerController implements the CRUD actions for Customer model.
|
* CustomerController implements the CRUD actions for Customer model.
|
||||||
@ -32,12 +33,10 @@ class CustomerController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function actionReception(){
|
public function actionReception(){
|
||||||
|
|
||||||
$model = new ReceptionForm();
|
$model = new ReceptionForm();
|
||||||
|
|
||||||
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
|
if ($model->load(Yii::$app->request->get()) && $model->validate()) {
|
||||||
|
$model->readCard();
|
||||||
// return $this->redirect(['view', 'id' => $model->id_customer]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,8 @@ namespace frontend\models;
|
|||||||
|
|
||||||
use Yii;
|
use Yii;
|
||||||
use yii\base\Model;
|
use yii\base\Model;
|
||||||
|
use common\models\Card;
|
||||||
|
use common\models\Customer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ContactForm is the model behind the contact form.
|
* ContactForm is the model behind the contact form.
|
||||||
@ -11,6 +13,8 @@ use yii\base\Model;
|
|||||||
class ReceptionForm extends Model
|
class ReceptionForm extends Model
|
||||||
{
|
{
|
||||||
public $number;
|
public $number;
|
||||||
|
public $card;
|
||||||
|
public $customer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,6 +27,7 @@ class ReceptionForm extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
@ -33,4 +38,11 @@ class ReceptionForm extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function readCard(){
|
||||||
|
$this->card = Card::findOne(['number' => $this->number]);
|
||||||
|
if ( $this->card != null ){
|
||||||
|
$this->customer = $this->card->customer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,46 +17,77 @@ use yii\widgets\ActiveForm;
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$card = $model->card;
|
||||||
|
$customer = $model->customer;
|
||||||
|
$customername = "";
|
||||||
|
if ( $customer != null ){
|
||||||
|
$customername = $customer->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function mkCustomerBtn($card, $label,$url = null ){
|
||||||
|
|
||||||
|
$classes = 'btn btn-primary btn-reception';
|
||||||
|
if ( $card == null ){
|
||||||
|
$classes .= ' disabled';
|
||||||
|
}
|
||||||
|
|
||||||
|
return Html::a( $label , null, ['class' => $classes ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<div class="reception-form">
|
<div class="reception-form">
|
||||||
|
|
||||||
<?php $form = ActiveForm::begin(); ?>
|
<?php $form = ActiveForm::begin([
|
||||||
|
'enableAjaxValidation' => false,
|
||||||
|
'method' => 'get'
|
||||||
|
]); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class='col-md-3'>
|
<div class='col-md-3'>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-8'>
|
<div class='col-md-8'>
|
||||||
<?php echo Html::a(Yii::t( 'frontend/customer', 'Adatlap') , null, ['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo mkCustomerBtn( $card, Yii::t( 'frontend/customer' , 'Adatlap') ); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-8'>
|
<div class='col-md-8'>
|
||||||
<?php echo Html::a(Yii::t( 'frontend/customer', 'Befizetések') ,null,['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo mkCustomerBtn( $card, Yii::t( 'frontend/customer' , 'Befizetések') ); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo Html::a(Html::tag("i","", [ 'class' => 'glyphicon glyphicon-plus' ] ) , null, ['class' => 'btn btn-primary btn-reception'] )?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-12'>
|
<div class='col-md-12'>
|
||||||
<?php echo Html::a(Yii::t( 'frontend/customer', 'Jelentkezések') , null,['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo Html::a(Yii::t( 'frontend/customer', 'Jelentkezések') , null,['class' => 'btn btn-primary btn-reception'] )?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-12'>
|
<div class='col-md-12'>
|
||||||
<?php echo Html::a(Yii::t( 'frontend/customer', 'Egyenleg') , null,['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo mkCustomerBtn( $card, Yii::t( 'frontend/customer' , 'Egyenleg') ); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-12'>
|
<div class='col-md-12'>
|
||||||
<?php echo Html::a(Yii::t( 'frontend/customer', 'Termékeladás') , null,['class' => 'btn btn-primary btn-reception'] )?>
|
<?php echo Html::a(Yii::t( 'frontend/customer', 'Termékeladás') , null,['class' => 'btn btn-primary btn-reception'] )?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-md-2'>
|
<div class='col-md-2'>
|
||||||
<?php echo $form->field($model, 'number')->textInput()?>
|
<div class="row" >
|
||||||
|
<div class='col-md-12'>
|
||||||
|
<?php echo $form->field($model, 'number')->textInput()?>
|
||||||
|
</div>
|
||||||
|
<div class='col-md-12'>
|
||||||
|
<?php echo $customername; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user