104 lines
2.5 KiB
PHP
104 lines
2.5 KiB
PHP
<?php
|
|
|
|
use yii\helpers\Html;
|
|
use yii\grid\GridView;
|
|
use yii\widgets\DetailView;
|
|
use yii\helpers\Url;
|
|
|
|
/* @var $this yii\web\View */
|
|
/* @var $searchModel backend\models\InventoryItemSearch */
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
|
|
|
$this->title = Yii::t('common/inventory-item', 'Leltár részletei');
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
?>
|
|
<div class="inventory-item-index">
|
|
|
|
<h1><?= Html::encode($this->title) ?></h1>
|
|
|
|
<?= DetailView::widget([
|
|
'model' => $model,
|
|
'attributes' => [
|
|
'id_inventory',
|
|
['attribute'=>'id_user',
|
|
'value'=>$model->userName
|
|
],
|
|
'created_at:datetime',
|
|
],
|
|
]) ?>
|
|
|
|
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
|
|
|
|
|
<p>
|
|
<?= Html::a(Yii::t('common/inventory', 'Új termék'), ['inventory-item/create','id' =>$model->id_inventory], ['class' => 'btn btn-success']) ?>
|
|
</p>
|
|
|
|
<?php
|
|
echo GridView::widget( [
|
|
'dataProvider' => $dataProvider,
|
|
'columns' =>[
|
|
[
|
|
'attribute' => 'item_created_at',
|
|
'label' => 'Létrehozva',
|
|
'format' => 'datetime'
|
|
],
|
|
[
|
|
'attribute' => 'item_name',
|
|
'label' => 'Név',
|
|
|
|
],
|
|
[
|
|
'attribute' => 'user_username',
|
|
'label' => 'Felhasználó',
|
|
|
|
],
|
|
[
|
|
'attribute' => 'item_count_prev',
|
|
'label' => 'Előzö leltár (db)'
|
|
|
|
],
|
|
[
|
|
'attribute' => 'item_count_in',
|
|
'label' => 'Beszerzett mennyiség (db)'
|
|
|
|
],
|
|
[
|
|
'attribute' => 'item_count_sold',
|
|
'label' => 'Eladott mennyiség (db)',
|
|
|
|
],
|
|
[
|
|
'attribute' => 'item_count',
|
|
'label' => 'Leltározott mennyiség (db)',
|
|
|
|
],
|
|
[
|
|
'attribute' => 'item_difference',
|
|
'label' => 'Különbség (db)',
|
|
|
|
],
|
|
['class' => 'yii\grid\ActionColumn',
|
|
'template' => '{delete}',
|
|
'urlCreator' => function ($action, $model, $key, $index){
|
|
return Url::to(['inventory-item/delete', 'id' => $model['item_id_inventory_item' ] ]) ;
|
|
},
|
|
'buttons' =>[
|
|
'delete' =>function ($url, $model, $key) {
|
|
return Html::a('Törlés', $url,['class' => 'btn btn-xs btn-danger',
|
|
'data' => [
|
|
'confirm' => Yii::t('common/inventory-item', 'Biztosan törlöd ezt az elemet?'),
|
|
'method' => 'post',
|
|
],
|
|
]) ;
|
|
}
|
|
]
|
|
|
|
]
|
|
]
|
|
|
|
]);
|
|
?>
|
|
|
|
</div>
|