add contract
This commit is contained in:
58
frontend/views/contract/index.php
Normal file
58
frontend/views/contract/index.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\ContractSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = $searchModel->customer->name . " szerződései";
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="contract-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
'id_contract',
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'value' => 'customerName'
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'value' => 'userName'
|
||||
],
|
||||
// 'part_paid',
|
||||
// 'part_count',
|
||||
// 'part_required',
|
||||
'expired_at:datetime',
|
||||
'created_at:datetime',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{details}',
|
||||
'buttons' => [
|
||||
'details' => function ($url, $model, $key) {
|
||||
return Html::a('Fizetési részletek', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||
},
|
||||
],
|
||||
'urlCreator' => function ($action, $model, $key, $index){
|
||||
$url = "";
|
||||
if ( 'details' == $action ){
|
||||
$url = Url::to(['contract/view','id' => $model->id_contract]);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user