Пример #1
0
<?php

use backend\components\SetColumn;
use common\models\Application;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Applications');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="box">
    <div class="box-body table-responsive">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'time:datetime', 'name', 'phone', 'email:email', ['class' => SetColumn::className(), 'attribute' => 'status', 'filter' => Application::getStatusList(), 'name' => 'statusName', 'cssClasses' => [Application::STATUS_READ => 'default', Application::STATUS_NEW => 'danger']], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['width' => '70'], 'template' => '{view} {delete}']]]);
?>
    </div>
</div>
Пример #2
0
<?php

use backend\components\SetColumn;
use common\models\District;
use common\models\Lang;
use common\models\Region;
use common\models\Sale;
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel common\models\SaleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Sales');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box">
    <div class="box-body table-responsive">
        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'code', 'headerOptions' => ['width' => '100']], ['class' => SetColumn::className(), 'attribute' => 'name', 'name' => 'name', 'value' => 'content.name'], ['class' => SetColumn::className(), 'attribute' => 'region_id', 'filter' => Region::getList(), 'name' => 'region.content.name'], ['class' => SetColumn::className(), 'attribute' => 'district_id', 'filter' => District::getListAll(), 'name' => 'district.content.name'], 'address', ['attribute' => 'created_at', 'format' => ['date', 'dd.MM.Y'], 'options' => ['width' => '80']], ['class' => SetColumn::className(), 'attribute' => 'top', 'filter' => Sale::getTopList(), 'name' => 'topName', 'cssClasses' => [Sale::TOP_DISABLED => 'default', Sale::TOP_ENABLED => 'success']], ['class' => SetColumn::className(), 'attribute' => 'status', 'filter' => Sale::getStatusList(), 'name' => 'statusName', 'cssClasses' => [Sale::STATUS_HIDE => 'default', Sale::STATUS_ACTIVE => 'success', Sale::STATUS_AWAITING => 'warning']], ['class' => SetColumn::className(), 'attribute' => 'sold', 'filter' => Sale::getSoldList(), 'name' => 'soldName', 'cssClasses' => [Sale::SOLD_ACTUAL => 'success', Sale::SOLD_US => 'default', Sale::SOLD_OTHER => 'default']], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['width' => '70'], 'template' => '{link} {update} {delete}', 'buttons' => ['link' => function ($url, $model, $key) {
    return Html::a('<span class="fa fa-eye"></span>', Url::to(Yii::$app->params['http'] . '/' . Lang::getCurrent()->code . '/sale/' . $model->id), ['target' => '_blank']);
}]]]]);
?>
    </div>
    <div class="box-footer">
        <?php 
echo Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-success']);
?>
    </div>
</div>
Пример #3
0
<?php

use common\models\Group;
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\User;
use backend\components\SetColumn;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box">
    <div class="box-body table-responsive">
        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'headerOptions' => ['width' => '50']], 'username', 'email:email', ['class' => SetColumn::className(), 'attribute' => 'group_id', 'filter' => Group::getList(), 'name' => 'group.name'], ['class' => SetColumn::className(), 'attribute' => 'status', 'filter' => User::getStatusList(), 'name' => 'statusName', 'cssClasses' => [User::STATUS_DELETED => 'default', User::STATUS_ACTIVE => 'success']], ['attribute' => 'created_at', 'format' => ['date', 'dd.MM.Y']], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['width' => '50'], 'template' => '{update} {delete}']]]);
?>
    </div>
    <div class="box-footer">
        <?php 
echo Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-success']);
?>
    </div>
</div>
Пример #4
0
use common\models\Group;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\BrokerSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Agents');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box">
    <div class="box-body table-responsive">
        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function ($model, $index, $widget, $grid) {
    if ($model->edit != '' || $model->user->group_id == Group::GROUP_DEFAULT) {
        return ['class' => 'danger'];
    } else {
        return [];
    }
}, 'columns' => [['attribute' => 'user_id', 'headerOptions' => ['width' => '50']], ['class' => SetColumn::className(), 'attribute' => 'type_id', 'filter' => Broker::getTypeList(), 'name' => 'typeName'], ['class' => SetColumn::className(), 'attribute' => 'user.group_id', 'filter' => Group::getList(), 'name' => 'user.group.groupName'], 'name', 'company', 'phone', 'email:email', 'address', ['class' => 'yii\\grid\\ActionColumn']]]);
?>
    </div>
    <div class="box-footer">
        <?php 
echo Html::a(Yii::t('app', 'Add agent'), ['create', 'type_id' => 1], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Add company'), ['create', 'type_id' => 2], ['class' => 'btn btn-success']);
?>
    </div>
</div>
Пример #5
0
<?php

use backend\components\SetColumn;
use common\models\District;
use common\models\Region;
use common\models\Sale;
use yii\bootstrap\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ObjectSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Objects');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box">
    <div class="box-body table-responsive">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'headerOptions' => ['width' => '50']], ['class' => SetColumn::className(), 'label' => Yii::t('app', 'Name'), 'attribute' => 'name', 'value' => 'sale.name'], ['class' => SetColumn::className(), 'attribute' => 'region_id', 'filter' => Region::getList(), 'value' => 'sale.region.content.name'], ['class' => SetColumn::className(), 'attribute' => 'district_id', 'filter' => District::getListAll(), 'value' => 'sale.district.content.name'], ['class' => SetColumn::className(), 'label' => Yii::t('app', 'Address'), 'attribute' => 'address', 'value' => 'sale.address'], ['attribute' => 'sale.created_at', 'format' => ['date', 'dd.MM.Y'], 'options' => ['width' => '80']], ['class' => SetColumn::className(), 'attribute' => 'status', 'filter' => Sale::getStatusList(), 'name' => 'statusName', 'cssClasses' => [Sale::STATUS_HIDE => 'default', Sale::STATUS_ACTIVE => 'success', Sale::STATUS_AWAITING => 'warning']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{link} {create}', 'buttons' => ['link' => function ($url, $model, $key) {
    return Html::a(Yii::t('app', 'View'), Url::toRoute(['sale/update', 'id' => $model->sale->id]), ['class' => 'btn btn-primary btn-xs']);
}, 'create' => function ($url, $model, $key) {
    return Html::a(Yii::t('app', 'Create'), Url::toRoute(['sale/create', 'object_id' => $model->id]), ['class' => 'btn btn-success btn-xs']);
}]]]]);
?>
    </div>
</div>