Example #1
0
<?php

use common\models\User;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', '用户管理');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <!-- <?php 
echo Html::a(Yii::t('backend', '创建用户', ['modelClass' => 'User']), ['create'], ['class' => 'btn btn-success']);
?>
 -->
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['attribute' => 'username', 'label' => '用户名'], ['attribute' => 'email', 'label' => '邮箱'], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => User::getStatuses(), 'filter' => User::getStatuses(), 'label' => '状态'], ['attribute' => 'created_at', 'label' => '创建时间', 'format' => 'datetime'], ['attribute' => 'logged_at', 'label' => '登录时间', 'format' => 'datetime'], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\SecurityQuestions;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\SecurityQuestionsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Security Questions');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="security-questions-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Security Questions')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'question', 'created_at:datetime', 'updated_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => SecurityQuestions::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #3
0
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\PlayerAlbumSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Player Albums');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="player-album-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => '玩家相册']), ['create'], ['class' => 'btn btn-success btn-flat']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user->username;
}], 'created_at:datetime', ['label' => Yii::t('common', 'Picture'), 'format' => 'html', 'value' => function ($model) {
    return Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $model->thumbnail_path, 'w' => 100], true), ['class' => 'img-responsive']);
}], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('common', 'Not Active'), Yii::t('common', 'Active')]], ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #4
0
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\RechargeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Recharge');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="recharge-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => '充值']), ['create'], ['class' => 'btn btn-success btn-flat']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user->username;
}], ['attribute' => 'game_id', 'value' => function ($model) {
    return $model->game->name;
}, 'filter' => ArrayHelper::map(\common\models\Game::find()->statusInUse()->all(), 'id', 'name')], ['attribute' => 'server_id', 'value' => function ($model) {
    return $model->server->server_name;
}, 'filter' => ArrayHelper::map(\common\models\GameServer::find()->statusInUse()->all(), 'id', 'server_name')], 'amount', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => \common\models\Recharge::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #5
0
use common\models\ShopProduct;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\ShopProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Shop Product');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="shop-product-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Shop Product')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'title', ['attribute' => 'relation_game', 'value' => function ($model) {
    return $model->relationGame ? $model->relationGame->name : null;
}], 'description:ntext', ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => \yii\helpers\ArrayHelper::map(\common\models\ShopCategory::find()->all(), 'id', 'title')], 'price', ['label' => Yii::t('common', 'Thumbnail'), 'format' => 'html', 'value' => function ($dataProvider) {
    return Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $dataProvider->thumbnail_path, 'w' => 100], true), ['class' => 'img-rounded pull-left img-responsive']);
}], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'is_on_sale', 'enum' => [Yii::t('common', 'Not'), Yii::t('common', 'Yes')]], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => ShopProduct::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #6
0
<?php

use common\models\User;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => 'User']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'username', 'email:email', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => User::getStatuses(), 'filter' => User::getStatuses()], 'created_at:datetime', 'logged_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #7
0
echo Yii::t('backend', 'Clone model');
?>
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
            <?php 
foreach ($list as $key => $value) {
    echo '<li><a href="/model/create?locale_group_id=' . $key . '">' . $value . '</a></li>';
}
?>

        </ul>
    </span>

    <?php 
$columns = ['id', 'title', 'slug', 'price', 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {pages} {log} {delete}', 'buttons' => ['pages' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['info/index', 'mid' => $model['id']]);
    return Html::a('<span class="glyphicon glyphicon glyphicon-list-alt"></span>', $customurl, ['title' => Yii::t('yii', 'Pages'), 'data-pjax' => '0']);
}, 'log' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['timeline-event/index', 'TimelineEventSearch[category]' => 'common\\models\\locale\\Model', 'TimelineEventSearch[row_id]' => $model->id]);
    return Html::a('<span class="glyphicon glyphicon-time"></span>', $customurl, ['title' => Yii::t('yii', 'Log'), 'data-pjax' => '0']);
}]]];
if (\Yii::$app->user->can('administrator')) {
    // adding after price
    array_splice($columns, 4, 0, [['attribute' => 'domain_id', 'content' => function ($model) {
        $domain = Domain::findOne($model->domain_id);
        $domain = $domain ? $domain->title : '';
        return Html::tag('div', $model->domain_id, ['data-toggle' => 'tooltip', 'data-placement' => 'left', 'title' => $domain, 'style' => 'cursor:default;']);
    }]]);
}
//\yii\helpers\VarDumper::dump($dataProvider , 11, true);
Example #8
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\MemberSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Members');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="member-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => 'Member']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['firstname', 'lastname', 'position', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'gender', 'enum' => ['1' => Yii::t('backend', 'Male'), '2' => Yii::t('backend', 'Female')]], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'locale', 'enum' => Yii::$app->params['availableLocales']], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Active'), Yii::t('backend', 'Active')]], 'weight', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

</div>
Example #9
0
use common\models\Game;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\GameSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Games');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="game-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Game')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => ArrayHelper::map(\common\models\GameCategory::find()->all(), 'id', 'title')], 'name', 'short', ['attribute' => 'thumbnail', 'format' => 'html', 'value' => function ($model) {
    return Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $model->thumbnail_path, 'w' => 150], true), ['class' => 'img-responsive']);
}], ['attribute' => 'attr', 'value' => function ($model) {
    return ArrayHelper::getValue(Game::getAttr(), $model->attr);
}, 'filter' => Game::getAttr()], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('common', 'Not Used'), Yii::t('common', 'In Use')]], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'is_recommend', 'enum' => [Yii::t('common', 'Not'), Yii::t('common', 'Yes')]], 'sort', ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #10
0
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Post;
/* @var $this yii\web\View */
/* @var $searchModel common\Models\PostSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Posts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Post', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['width' => '10px']], 'title', ['attribute' => 'category_name', 'filter' => Html::activeTextInput($searchModel, 'category_name', ['class' => 'form-control']), 'format' => 'raw', 'value' => function ($data) {
    return $data->category['name'];
}], ['attribute' => 'username', 'filter' => Html::activeTextInput($searchModel, 'username', ['class' => 'form-control']), 'value' => function ($data) {
    return $data->user['username'];
}], ['attribute' => 'view_count', 'options' => ['width' => '10px']], ['attribute' => 'comment_count', 'options' => ['width' => '10px']], ['attribute' => 'order', 'options' => ['width' => '10px']], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'filter' => Post::getStatuses(), 'enum' => Post::getStatuses()], 'updated_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #11
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\UserHistorySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'User History');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-history-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user->username;
}], ['attribute' => 'game_id', 'value' => function ($model) {
    return $model->game->name;
}, 'filter' => ArrayHelper::map(\common\models\Game::find()->all(), 'id', 'name')], ['attribute' => 'server_id', 'value' => function ($model) {
    return $model->server->server_name;
}, 'filter' => ArrayHelper::map(\common\models\GameServer::find()->all(), 'id', 'server_name')], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => \common\models\UserHistory::getStatus()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}{delete}']]]);
?>

</div>
Example #12
0
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
use common\models\GameServer;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\GameServerSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Game Server');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="game-server-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Game Server')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'server_id', 'server_name', ['attribute' => 'game_id', 'value' => function ($model) {
    return $model->game->name;
}, 'filter' => ArrayHelper::map(\common\models\Game::find()->all(), 'id', 'name')], 'start_time:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('common', 'Not Used'), Yii::t('common', 'In Use')]], ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #13
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\FeedbackSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Feedbacks');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="feedback-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => 'Feedback']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'nick', 'email', 'message', 'lang', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not sent'), Yii::t('backend', 'Was sent')]], 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

</div>
Example #14
0
    </span>

    <span class="dropdown">
        <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
            <?php 
echo Yii::t('backend', 'Extend service');
?>
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
            <?php 
foreach ($list as $key => $value) {
    echo '<li><a href="/service/create?locale_group_id=' . $key . '&scenario=extend">' . $value . '</a></li>';
}
?>

        </ul>
    </span>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'slug', 'title', 'price', 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {pages} {log} {delete}', 'buttons' => ['pages' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['service-page/index', 'mid' => $model['id']]);
    return Html::a('<span class="glyphicon glyphicon glyphicon-list-alt"></span>', $customurl, ['title' => Yii::t('yii', 'Pages'), 'data-pjax' => '0']);
}, 'log' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['timeline-event/index', 'TimelineEventSearch[category]' => 'common\\models\\locale\\Service', 'TimelineEventSearch[row_id]' => $model->id]);
    return Html::a('<span class="glyphicon glyphicon-time"></span>', $customurl, ['title' => Yii::t('yii', 'Log'), 'data-pjax' => '0']);
}]]]]);
?>

</div>
Example #15
0
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
use common\models\GameGift;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\GameGiftSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Game Gift');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="game-gift-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Game Gift')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'game_server_id', 'value' => function ($model) {
    return $model->gameServer->server_name;
}, 'filter' => ArrayHelper::map(\common\models\GameServer::find()->all(), 'id', 'server_name')], 'lb_gid', 'lb_name', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => GameGift::getStatus()], ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #16
0
?>

        </ul>
    </span>

    <span class="dropdown">
        <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
            <?php 
echo Yii::t('backend', 'Extend promo');
?>
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
            <?php 
foreach ($list as $key => $value) {
    echo '<li><a href="/promo/create?locale_group_id=' . $key . '&scenario=extend">' . $value . '</a></li>';
}
?>

        </ul>
    </span>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'title', 'slug', ['attribute' => 'author', 'value' => 'author.username', 'label' => 'Автор'], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')]], ['attribute' => 'search_date_published', 'label' => 'Дата публикации', 'value' => 'published_at', 'format' => ['date', 'php:d-m-Y']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {log} {delete}', 'buttons' => ['log' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['timeline-event/index', 'TimelineEventSearch[category]' => 'common\\models\\locale\\Promo', 'TimelineEventSearch[row_id]' => $model->id]);
    return Html::a('<span class="glyphicon glyphicon-time"></span>', $customurl, ['title' => Yii::t('yii', 'Log'), 'data-pjax' => '0']);
}]]]]);
?>

</div>
Example #17
0
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
use common\models\IndexSlide;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\IndexSlideSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Index Slide');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="index-slide-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Index Slide')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'game_id', 'value' => function ($model) {
    return $model->game->name;
}, 'filter' => ArrayHelper::map(\common\models\Game::find()->statusInUse()->all(), 'id', 'name')], 'name', 'sort', ['attribute' => 'thumbnail', 'format' => 'html', 'value' => function ($model) {
    return Html::img(Yii::$app->glide->createSignedUrl(['glide/index', 'path' => $model->thumbnail_path, 'w' => '600'], true), ['class' => 'img-responsive']);
}], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => IndexSlide::getStatus()], ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #18
0
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
use common\models\ShopOrder;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\ShopOrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Shop Order');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="shop-order-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Shop Order')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'order_sn', ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user ? $model->user->username : null;
}], 'phone', 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => ShopOrder::getStatus()], ['class' => 'yii\\grid\\ActionColumn']], 'layout' => "{items}\n{summary}\n{pager}"]);
?>

</div>
Example #19
0
	<div class="container content">
		<div class="headline">
			<a href="<?php 
echo Url::toRoute(['product/my-order']);
?>
"><h2>我的订单</h2></a>
		</div>

		<div class="row">
			<div class="col-lg-12">
				<?php 
echo \yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'order_sn', ['attribute' => '名称', 'value' => function ($model) {
    return \common\models\ShopOrderItem::findOne(['order_id' => $model->id])->title;
}], ['attribute' => 'user_id', 'value' => function ($model) {
    return $model->user ? $model->user->username : null;
}], 'phone', 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => ShopOrder::getStatus()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon glyphicon-trash"></span>', ['/product/my-order-delete', 'id' => $model->id], ['title' => '删除', 'aria-labe' => '删除', 'data-confirm' => "您确定要删除此项吗?", 'data-method' => 'post']);
}]]], 'layout' => "{items}\n{summary}\n{pager}"]);
?>
			</div>
		</div>
	</div>

-->

<?php 
$js = <<<JS

//make user-nav active
\$('.index-nav').removeClass('active');
\$('.shangcheng-nav').addClass('active');
Example #20
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\MessageSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Site Messages');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Site Messages')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'title', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'receive', 'enum' => \common\models\Message::getReceive()], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => \common\models\Message::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #21
0
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;
use common\models\KefuFaq;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\KefuFaqSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Kefu Faq');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="kefu-faq-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Kefu Faq')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'title', ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => ArrayHelper::map(\common\models\KefuFaqCat::find()->all(), 'id', 'title')], 'description', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuFaq::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #22
0
<?php

use yii\grid\GridView;
use yii\helpers\Html;
//echo ;
//\yii\helpers\VarDumper::dump(\Yii::$app->user->identity->id , 11, true);
//\yii\helpers\VarDumper::dump((array_combine(explode(',', Yii::getAlias('@frontendUrls')), explode(',', Yii::getAlias('@frontendUrls')))) , 11, true);
//\yii\helpers\VarDumper::dump($searchModel , 11, true);
//\yii\helpers\VarDumper::dump(\api\models\User::findOne(1) , 11, true);
?>
    <a class="btn btn-default" href="/feedback/create"><?php 
echo Yii::t('backend', 'Add question');
?>
</a>
<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['attribute' => 'subject', 'format' => 'raw', 'value' => function ($model, $key, $index, $grid) {
    return Html::a($model->subject, \yii\helpers\Url::toRoute(['view', 'id' => $model->id]), ['class' => 'dads', 'target' => '_blank', 'data-pjax' => '0']);
}], ['attribute' => 'author', 'label' => 'Автор', 'value' => 'author.username'], ['attribute' => 'search_date_created', 'label' => 'Создано', 'value' => 'created_at', 'format' => ['date', 'php:d-m-Y']], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'not done'), Yii::t('backend', 'done')]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
Example #23
0
echo Yii::t('backend', 'Extend service page');
?>
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
            <?php 
foreach ($list as $key => $value) {
    echo '<li><a href="/service-page/create?locale_group_id=' . $key . '&' . $additionalGetParam . '&scenario=extend">' . $value . '</a></li>';
}
?>

        </ul>
    </span>

    <?php 
$columns = ['id', 'title', 'slug', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')]], ['attribute' => 'search_date_published', 'label' => 'Дата публикации', 'value' => 'published_at', 'format' => ['date', 'php:d-m-Y']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {log} {delete}', 'buttons' => ['log' => function ($url, $model) {
    $customurl = Yii::$app->getUrlManager()->createUrl(['timeline-event/index', 'TimelineEventSearch[category]' => 'common\\models\\locale\\ServicePage', 'TimelineEventSearch[row_id]' => $model->id]);
    return Html::a('<span class="glyphicon glyphicon-time"></span>', $customurl, ['title' => Yii::t('yii', 'Log'), 'data-pjax' => '0']);
}]]];
if (\Yii::$app->user->can('administrator')) {
    // adding after url
    array_splice($columns, 3, 0, [['attribute' => 'domain_id', 'content' => function ($model) {
        $domain = Domain::findOne($model->domain_id);
        $domain = $domain ? $domain->title : '';
        return Html::tag('div', $model->domain_id, ['data-toggle' => 'tooltip', 'data-placement' => 'left', 'title' => $domain, 'style' => 'cursor:default;']);
    }]]);
}
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);
?>

</div>
Example #24
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common', 'Kefu Account Repair');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="kefu-account-repair-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<?php 
if (Yii::$app->user->can('administrator')) {
    ?>
		<p>
			<?php 
    echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Kefu Account Repair')]), ['create'], ['class' => 'btn btn-success']);
    ?>
		</p>
	<?php 
}
?>


	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'sn', ['attribute' => 'account', 'value' => function ($model) {
    return $model->user->username;
}], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'reason', 'enum' => KefuAccountRepair::getReason()], 'register_time:datetime', 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'progress', 'enum' => KefuAccountRepair::getProgress()], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuAccountRepair::getStatus()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #25
0
	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<?php 
if (Yii::$app->user->can('administrator')) {
    ?>
		<p>
			<?php 
    echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => Yii::t('common', 'Kefu Selfservice')]), ['create'], ['class' => 'btn btn-success']);
    ?>
		</p>
	<?php 
}
?>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'sn', ['attribute' => 'game_server', 'value' => function ($model) {
    return \common\models\GameServer::findOne($model->game_server)['server_name'];
}, 'filter' => ArrayHelper::map(\common\models\GameServer::find()->all(), 'id', 'server_name')], 'game_role', ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => ArrayHelper::map(\common\models\KefuSelfserviceCat::find()->all(), 'id', 'title')], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuSelfservice::getStatus()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {result} {delete}', 'buttons' => ['result' => function ($url, $model, $key) {
    if ($model->status == KefuSelfservice::STATUS_YICHULI) {
        return "";
    }
    return Html::a('<span class="glyphicon glyphicon-check"></span>', ['/kefu-selfservice/result', 'id' => $model->id], ['title' => Yii::t('common', 'check'), 'id' => 'check' . $model->id]);
}]]]]);
?>

</div>
Example #26
0
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\ArticleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', '文章管理');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', '创建新文章'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'label' => 'id'], ['attribute' => 'slug', 'label' => '标识'], ['attribute' => 'title', 'label' => '标题'], ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => \yii\helpers\ArrayHelper::map(\common\models\ArticleCategory::find()->all(), 'id', 'title'), 'label' => '目录'], ['attribute' => 'author_id', 'value' => function ($model) {
    return $model->author->username;
}, 'label' => '作者'], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')], 'label' => '状态'], ['attribute' => 'commission', 'label' => '佣金'], ['attribute' => 'published_at', 'label' => '发布时间', 'format' => 'datetime'], ['attribute' => 'created_at', 'label' => '创建时间', 'format' => 'datetime'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

</div>
Example #27
0
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\ArticleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Articles');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => 'Article']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', 'slug', 'title', ['attribute' => 'category_id', 'value' => function ($model) {
    return $model->category ? $model->category->title : null;
}, 'filter' => \yii\helpers\ArrayHelper::map(\common\models\ArticleCategory::find()->all(), 'id', 'title')], ['attribute' => 'author_id', 'value' => function ($model) {
    return $model->author->username;
}], ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Not Published'), Yii::t('backend', 'Published')]], 'published_at:datetime', 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

</div>
Example #28
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\search\WidgetMenuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Widget Menus');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="widget-menu-index">
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => 'Widget Menu']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'dataTable table table-striped table-bordered'], 'summary' => false, 'showOnEmpty' => false, 'columns' => [['attribute' => 'title', 'format' => 'raw', 'value' => function ($model) {
    return Html::a($model->title, ['update', 'id' => $model->id]);
}], 'key', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Disabled'), Yii::t('backend', 'Enabled')]], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['class' => 'unsorted'], 'template' => '{update} {delete}']]]);
?>

</div>
Example #29
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \backend\models\search\WidgetTextSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend', 'Text Blocks');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="text-block-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('backend', 'Create {modelClass}', ['modelClass' => '文本块']), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'key', 'title', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => [Yii::t('backend', 'Disabled'), Yii::t('backend', 'Enabled')]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}']]]);
?>

</div>
Example #30
0
		<div class="col-md-12">
			<div class="tag-box tag-box-v3">
				<div class="headline"><h3><?php 
echo $this->title;
?>
</h3></div>
				<?php 
if (!Yii::$app->user->isGuest) {
    ?>
					<?php 
    echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'template' => '{view}', 'buttons' => ['view' => function ($url, $model, $key) {
        return Html::a('查看', $url);
    }]], 'sn', ['attribute' => 'category_id', 'value' => function ($dataProvider) {
        $cat = $dataProvider->category_id;
        return \common\models\KefuSelfserviceCat::findOne(['id' => $cat])['title'];
    }], 'created_at:datetime', ['class' => \common\grid\EnumColumn::className(), 'attribute' => 'status', 'enum' => KefuSelfservice::getStatus()]], 'tableOptions' => ['class' => 'table table-bordered table-condensed table-hover table-striped', 'id' => 'index scroll'], 'layout' => "{items}\n{summary}\n{pager}"]);
    ?>
				<?php 
} else {
    ?>
					<?php 
    echo Html::tag('h5', '没有记录!');
    ?>
				<?php 
}
?>
			</div>
		</div>
	</div>
</div>