add backand ticket/index changes, add backand\ticket\index export pdf, xls
This commit is contained in:
@@ -12,23 +12,36 @@ use yii\data\ArrayDataProvider;
|
||||
$this->title = Yii::t('common/ticket', 'Tickets');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="ticket-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="clearfix" style="margin-bottom: 6px;">
|
||||
<span class="pull-left">
|
||||
Exportálás:
|
||||
</span>
|
||||
<?php
|
||||
echo Html::a(
|
||||
"PDF",\yii\helpers\Url::current( [ Html::getInputName($searchModel,'output') => 'pdf' ]),
|
||||
['class' => 'btn btn-primary pull-left','style'=> 'margin-left: 12px;']
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
echo Html::a(
|
||||
"XLS",\yii\helpers\Url::current( [ Html::getInputName($searchModel,'output') => 'xls' ]),
|
||||
['class' => 'btn btn-primary pull-left','style'=> 'margin-left: 12px;']
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Bérlet statisztika</div>
|
||||
<div class="panel-body">
|
||||
<p>Bérlet statisztika a kiválasztott időszakra</p>
|
||||
<?php
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => new ArrayDataProvider([
|
||||
'allModels' => $searchModel->statistics,
|
||||
@@ -71,51 +84,71 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'ticket_id_ticket',
|
||||
'label' => 'B. Azonosító'
|
||||
],
|
||||
[
|
||||
'attribute' => 'customer_name',
|
||||
'label' => 'Vendég'
|
||||
],
|
||||
[
|
||||
'attribute' => 'card_number',
|
||||
'label' => 'Kártya'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_start',
|
||||
'label' => 'Érvényes -tól',
|
||||
'format' => 'date'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_end',
|
||||
'label' => 'Érvényes -ig',
|
||||
'format' => 'date'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_type_name',
|
||||
'label' => 'Bérlet típus',
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_created_at',
|
||||
'label' => 'Létrehozva',
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'attribute' => 'user_username',
|
||||
'label' => 'Felhasználó',
|
||||
],
|
||||
[
|
||||
'attribute' => 'account_name',
|
||||
'label' => 'Kassza',
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_status',
|
||||
'label' => 'Státusz',
|
||||
'value' => function ($model, $key, $index, $column){
|
||||
return \common\models\Ticket::toStatusName($model['ticket_status']);
|
||||
}
|
||||
],
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}',
|
||||
'urlCreator' => function($action, $model, $key, $index){
|
||||
$result = "";
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'id_ticket',
|
||||
'value' => 'id_ticket',
|
||||
'label' => 'B. Azonosító'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'value' => 'customerName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_card',
|
||||
'value' => 'cardNumber'
|
||||
],
|
||||
'start:date',
|
||||
'end:date',
|
||||
'created_at:date',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => 'userName'
|
||||
if ( $action == 'view'){
|
||||
$result = \yii\helpers\Url::toRoute(['ticket/view','id' => $model['ticket_id_ticket']]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => 'ticketTypeName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => 'accountName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'status',
|
||||
'value' => 'statusName'
|
||||
],
|
||||
// 'max_usage_count',
|
||||
// 'usage_count',
|
||||
]
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}'
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user