Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use yii\helpers\Html;
- use kartik\grid\GridView;
- use backend\models\Client;
- /* @var $this yii\web\View */
- /* @var $searchModel backend\models\DealsSearch */
- /* @var $dataProvider yii\data\ActiveDataProvider */
- $this->title = 'Сделки';
- $this->params['breadcrumbs'][] = $this->title;
- ?>
- <div class="deals-index">
- <p>
- <?= Html::a('Создать сделку', ['create'], ['class' => 'btn btn-success']) ?>
- </p>
- <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
- <?= GridView::widget([
- 'rowOptions' => function ($model, $key, $index, $grid)
- {
- if($model->statussdel->id == 1) {
- return ['style' => 'background-color:#00a65a9e;'];
- }
- if($model->statussdel->id == 2) {
- return ['style' => 'background-color:#dd4b39b3;'];
- }
- },
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- 'columns' => [
- 'id',
- [
- 'attribute' => 'client_id',
- 'value' => function ($model)
- {
- return $model->client ? $model->client->company . ' , ' . $model->client->firstname . ' ' . $model->client->lastname : '' ;
- }
- ],
- //'budget',
- [
- 'attribute' => 'budget',
- 'format' => ['decimal', 2],
- 'value' => 'budget',
- ],
- //'tz',
- [
- 'attribute' => 'user_id',
- 'format' => 'raw',
- 'value' => 'manadger.username',
- ],
- 'date',
- 'finch_date',
- //'due_date',
- //'notes',
- //'doc',
- //'payment',
- //'paymentdate',
- [
- 'attribute' => 'staussdelki_id',
- 'format' => 'raw',
- 'value' => 'statussdel.staussdelkiname',
- ],
- [
- 'attribute' => 'sum',
- 'format' => ['decimal', 2],
- 'value' => function($model) {
- return $model->payment * 0.1;
- }
- ],
- ['class' => 'yii\grid\ActionColumn'],
- ],
- ]); ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment