add product sale changes
This commit is contained in:
@@ -8,12 +8,19 @@ use frontend\models\ProductSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use frontend\models\ProductSaleForm;
|
||||
use common\models\Card;
|
||||
use common\models\Customer;
|
||||
|
||||
/**
|
||||
* ProductController implements the CRUD actions for Product model.
|
||||
*/
|
||||
class ProductController extends Controller
|
||||
{
|
||||
|
||||
protected $card;
|
||||
protected $customer;
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
@@ -26,6 +33,21 @@ class ProductController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function actionSale( $number = null){
|
||||
|
||||
$this->findByNumber($number);
|
||||
|
||||
$model = new ProductSaleForm();
|
||||
|
||||
return $this->render("sale",[
|
||||
'customer' => $this->customer,
|
||||
'card' => $this->card
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Product models.
|
||||
* @return mixed
|
||||
@@ -118,4 +140,18 @@ class ProductController extends Controller
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
|
||||
protected function findByNumber($number){
|
||||
$this->card = null;
|
||||
$this->customer = null;
|
||||
if ( $number != null ){
|
||||
$this->card = Card::readCard($number);
|
||||
if ( $this->card != null ){
|
||||
$this->customer = Customer::find()->innerJoin(Card::tableName(), "customer.id_customer_card = card.id_card")->andWhere( [ 'customer.id_customer_card' => $this->card->id_card ])->one();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
121
frontend/controllers/TransferController.php
Normal file
121
frontend/controllers/TransferController.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\controllers;
|
||||
|
||||
use Yii;
|
||||
use common\models\Transfer;
|
||||
use frontend\models\TransferSearch;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* TransferController implements the CRUD actions for Transfer model.
|
||||
*/
|
||||
class TransferController extends Controller
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['post'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Transfer models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new TransferSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single Transfer model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Transfer model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new Transfer();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_transfer]);
|
||||
} else {
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing Transfer model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id_transfer]);
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Transfer model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the Transfer model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return Transfer the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = Transfer::findOne($id)) !== null) {
|
||||
return $model;
|
||||
} else {
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
46
frontend/models/ProductSaleForm.php
Normal file
46
frontend/models/ProductSaleForm.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use common\models\Card;
|
||||
use common\models\Customer;
|
||||
|
||||
/**
|
||||
* ContactForm is the model behind the contact form.
|
||||
*/
|
||||
class ProductSaleForm extends Model
|
||||
{
|
||||
|
||||
public $productNumber;
|
||||
public $productBarcode;
|
||||
public $count;
|
||||
public $currency;
|
||||
public $account;
|
||||
public $comment;
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['number'], 'required'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'verifyCode' => 'Verification Code',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
79
frontend/models/TransferSearch.php
Normal file
79
frontend/models/TransferSearch.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\models;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Transfer;
|
||||
|
||||
/**
|
||||
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
|
||||
*/
|
||||
class TransferSearch extends Transfer
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_transfer', 'id_discount', 'id_currency', 'id_object', 'status', 'type', 'item_price', 'count', 'money', 'money_currency', 'rate', 'id_user'], 'integer'],
|
||||
[['comment', 'created_at', 'updated_at'], 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function scenarios()
|
||||
{
|
||||
// bypass scenarios() implementation in the parent class
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return ActiveDataProvider
|
||||
*/
|
||||
public function search($params)
|
||||
{
|
||||
$query = Transfer::find();
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
// uncomment the following line if you do not want to return any records when validation fails
|
||||
// $query->where('0=1');
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_transfer' => $this->id_transfer,
|
||||
'id_discount' => $this->id_discount,
|
||||
'id_currency' => $this->id_currency,
|
||||
'id_object' => $this->id_object,
|
||||
'status' => $this->status,
|
||||
'type' => $this->type,
|
||||
'item_price' => $this->item_price,
|
||||
'count' => $this->count,
|
||||
'money' => $this->money,
|
||||
'money_currency' => $this->money_currency,
|
||||
'rate' => $this->rate,
|
||||
'id_user' => $this->id_user,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'comment', $this->comment]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ function mkBtn($card, $label,$route = null ){
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<?php //echo Html::a(Yii::t( 'frontend/customer', 'Termékeladás') , 'product/index' , ['class' => 'btn btn-primary btn-reception'] )?>
|
||||
<?php echo mkBtn($card, Yii::t( 'frontend/customer', 'Termékeladás'), 'product/index')?>
|
||||
<?php echo mkBtn($card, Yii::t( 'frontend/transfer', 'Termékeladás'), 'product/sale')?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
180
frontend/views/product/sale.php
Normal file
180
frontend/views/product/sale.php
Normal file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
|
||||
use frontend\components\ReceptionMenuWidget;
|
||||
use frontend\components\ReceptionCardNumberWidget;
|
||||
use yii\helpers\Html;
|
||||
?>
|
||||
|
||||
<style>
|
||||
.product-form input, .product-form select, .product-form textarea{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['product/sale'] ] )?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1><?php echo Yii::t('frontend/product','Sell product')?></h1>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Product'))?>
|
||||
<?php echo Html::textInput('filter_text')?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='row product-form'>
|
||||
<div class='col-md-6'>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Product name'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::tag('span','',[ 'class' => 'product product-name']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Product price'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::tag('span','',[ 'class' => 'product product-price']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Product number'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::tag('span','',[ 'class' => 'product product-number']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Barcode'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::tag('span','',[ 'class' => 'product barcode']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Count'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::textInput('count') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Currency'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::dropDownList('currency',null,[],[]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Account'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::dropDownList('account',null,[],[]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Discount'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::dropDownList('discount',null,[],[]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Comment'))?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-10'>
|
||||
<?php echo Html::textarea('comment', ''); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<div class="row">
|
||||
<div class='col-md-10'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Bill'))?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::label(Yii::t('frontend/product', 'Debit'))?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php echo Html::tag("span",'0,00',['sale', 'sale-debit']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-12'>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo Yii::t('frontend/product', 'Product name')?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo Yii::t('frontend/product', 'Count')?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo Yii::t('frontend/product', 'Currency')?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo Yii::t('frontend/product', 'Item Price')?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo Yii::t('frontend/product', 'Total Price')?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
45
frontend/views/transfer/_form.php
Normal file
45
frontend/views/transfer/_form.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Transfer */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="transfer-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'id_discount')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'id_currency')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'id_object')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'status')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'type')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'item_price')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'count')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'money')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'money_currency')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'rate')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'id_user')->textInput() ?>
|
||||
|
||||
<?= $form->field($model, 'comment')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/transfer', 'Create') : Yii::t('frontend/transfer', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
55
frontend/views/transfer/_search.php
Normal file
55
frontend/views/transfer/_search.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\TransferSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="transfer-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_transfer') ?>
|
||||
|
||||
<?= $form->field($model, 'id_discount') ?>
|
||||
|
||||
<?= $form->field($model, 'id_currency') ?>
|
||||
|
||||
<?= $form->field($model, 'id_object') ?>
|
||||
|
||||
<?= $form->field($model, 'status') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'type') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'item_price') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'count') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'money') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'money_currency') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'rate') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'id_user') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'comment') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('frontend/transfer', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
21
frontend/views/transfer/create.php
Normal file
21
frontend/views/transfer/create.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
$this->title = Yii::t('frontend/transfer', 'Create Transfer');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="transfer-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
48
frontend/views/transfer/index.php
Normal file
48
frontend/views/transfer/index.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel common\models\TransferSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('frontend/transfer', 'Transfers');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="transfer-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Create Transfer'), ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id_transfer',
|
||||
'id_discount',
|
||||
'id_currency',
|
||||
'id_object',
|
||||
'status',
|
||||
// 'type',
|
||||
// 'item_price',
|
||||
// 'count',
|
||||
// 'money',
|
||||
// 'money_currency',
|
||||
// 'rate',
|
||||
// 'id_user',
|
||||
// 'comment',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
23
frontend/views/transfer/update.php
Normal file
23
frontend/views/transfer/update.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
$this->title = Yii::t('frontend/transfer', 'Update {modelClass}: ', [
|
||||
'modelClass' => 'Transfer',
|
||||
]) . ' ' . $model->id_transfer;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->id_transfer, 'url' => ['view', 'id' => $model->id_transfer]];
|
||||
$this->params['breadcrumbs'][] = Yii::t('frontend/transfer', 'Update');
|
||||
?>
|
||||
<div class="transfer-update">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
49
frontend/views/transfer/view.php
Normal file
49
frontend/views/transfer/view.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
$this->title = $model->id_transfer;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="transfer-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Update'), ['update', 'id' => $model->id_transfer], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('frontend/transfer', 'Delete'), ['delete', 'id' => $model->id_transfer], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('frontend/transfer', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_transfer',
|
||||
'id_discount',
|
||||
'id_currency',
|
||||
'id_object',
|
||||
'status',
|
||||
'type',
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'money_currency',
|
||||
'rate',
|
||||
'id_user',
|
||||
'comment',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user