add indexes, add messagedetsta
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\Card;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\CardSearch */
|
||||
@@ -10,6 +12,13 @@ use yii\grid\GridView;
|
||||
$this->title = Yii::t('common/card', 'Cards');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<style>
|
||||
.grid-view a{
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="card-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
@@ -23,33 +32,63 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
[
|
||||
'attribute' => 'number',
|
||||
'value' => 'number'
|
||||
'attribute' => 'card_number',
|
||||
'label' => 'Kártyaszám'
|
||||
],
|
||||
[
|
||||
'attribute' => 'rfid_key',
|
||||
'value' => 'rfid_key'
|
||||
'attribute' => 'card_rfid_key',
|
||||
'label' => 'RFID szám'
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => 'statusHuman'
|
||||
'attribute' => 'card_status',
|
||||
'label' => 'Státusz',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
return Card::toStatusName($model['card_status'],'-');
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'value' => 'typeHuman'
|
||||
],
|
||||
[
|
||||
'attribute' => 'customerName',
|
||||
'value' => 'customerName'
|
||||
],
|
||||
'updated_at:datetime',
|
||||
[
|
||||
'attribute' => 'card_type',
|
||||
'label' => 'Típus',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
return Card::toTypeName($model['card_type'],'-');
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'customer_id_customer',
|
||||
'label' => 'Vendég azonosító'
|
||||
],
|
||||
[
|
||||
'attribute' => 'customer_name',
|
||||
'label' => 'Vendég név'
|
||||
],
|
||||
[
|
||||
'attribute' => 'key_number',
|
||||
'label' => 'Kulcs száma'
|
||||
],
|
||||
|
||||
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}{update}'
|
||||
],
|
||||
'template' => '{view}{update}',
|
||||
'urlCreator' => function ($action, $model, $key, $index){
|
||||
$result = "";
|
||||
if ( 'view' == $action ){
|
||||
$result = Url::toRoute(['card/view' , 'id' => $model['card_id_card'] ]);
|
||||
}else if ( 'update' == $action ){
|
||||
$result = Url::toRoute(['card/update' , 'id' => $model['card_id_card'] ]);
|
||||
}
|
||||
return $result;
|
||||
},
|
||||
'buttons' =>[
|
||||
'view' => function ($url, $model, $key) {
|
||||
return Html::a("Nézet" ,$url,['class' =>'btn btn-primary btn-xs']);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
return Html::a("Módosít" ,$url,['class' =>'btn btn-primary btn-xs']);
|
||||
},
|
||||
]
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user