Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
+44
View File
@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\bootstrap\Alert;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
$params = Yii::$app->params;
?>
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
<?php
if( Yii::$app->getSession()->hasFlash('error') ) {
echo Alert::widget([
'options' => [
'class' => 'alert alert-danger',
],
'body' => Yii::$app->getSession()->getFlash('error'),
]);
}
?>
<?= $form->field($model, 'nickname')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])->label('头像')?>
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
<?= $form->field($model1, 'name' )->dropDownList($item)->label(Yii::t('common' ,'Role'))?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+27
View File
@@ -0,0 +1,27 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = '新增运维';
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="user-create">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr/>
<?= $this->render('_form', [
'model' => $model,
'model1' => $model1,
'item' => $item,
]) ?>
</div>
</div>
</div>
+37
View File
@@ -0,0 +1,37 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '运维人员';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
// 'email:email',
// 'role',
// 'status',
// 'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
+86
View File
@@ -0,0 +1,86 @@
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '运维人员列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<div class="row">
<div class="col-sm-3">
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('create')?>">新增运维</a>
</div>
<div class="col-sm-3 pull-right">
<form action="<?=Url::toRoute('list')?>" method="post">
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
<div class="input-group">
<input type="text" placeholder="请输入用户名或账号" name="search[username]" class="input-sm form-control" value="<?= isset($search['username'])?$search['username']:''; ?>"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</form>
</div>
</div>
<hr>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>序号</th>
<th>账号</th>
<th>名称</th>
<th>邮箱</th>
<th>手机</th>
<th>用户组</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($user as $vo){?>
<tr>
<td><?=$vo['id']?></td>
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
<td><?=$vo['nickname']?></td>
<td><?=$vo['email']?></td>
<td><?=$vo['mobile']?></td>
<td><?=isset($vo['usergroup']['item_name'])?$vo['usergroup']['item_name']:'未知'?></td>
<td><?=$status[$vo['status']]['title']?></td>
<td><?php if(isset($vo['usergroup']['item_name'])):?>
<a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['update','item_name'=>$vo['usergroup']['item_name'],'id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a>
<?php if($vo['status']==0):?><a href="<?=Url::toRoute(['status','status'=>10,'id'=>$vo['id']])?>" class="btn btn-warning btn-xs"><i class="fa fa-unlock"></i>启用</a><?php endif;?>
<?php if($vo['status']==10):?><a href="<?=Url::toRoute(['status','status'=>0,'id'=>$vo['id']])?>" class="btn btn-danger btn-xs"><i class="fa fa-lock"></i>禁用</a><?php endif;?>
<?php if(!in_array($vo['username'],array('fm453','admin'))):?><a href="<?=Url::toRoute(['delete','id'=>$vo['id']])?>" class="btn btn-default btn-xs"><i class="fa fa-close"></i>删除</a><?php endif;?></td>
<?php else:?>
该用户已删除,如需要需,<br>先联系站长启用后并重新分配权限方可使用
<?php endif;?>
</tr>
<?php };?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+47
View File
@@ -0,0 +1,47 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '更新运维';
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row pd-10">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<div class="auth-item-form col-sm-4">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
<?= $form->field($model, 'username')->textInput(['readonly'=>true])->label('账号') ?>
<?= $form->field($model, 'nickname')->textInput()->label('姓名') ?>
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
<?= $form->field($model, 'email')->textInput(['placeholder'=>''])->label('邮箱')?>
<?= $form->field($model, 'mobile')->textInput(['placeholder'=>''])->label('手机号')?>
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
<span class="help-block m-b-none">如果不需要修改密码,留空即可</span>
<?php if($model->username =='fm453' || $model->username =='admin'):?>
<?= $form->field($model->usergroup, 'item_name' )->dropDownList($item,['disabled'=>true])->label('用户组')?>
<?php else:?>
<?= $form->field($model->usergroup, 'item_name' )->dropDownList($item)->label('用户组')?>
<?php endif;?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
'email:email',
'role',
'status',
'created_at',
'updated_at',
],
]) ?>
</div>
+38
View File
@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\bootstrap\Alert;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
$params = Yii::$app->params;
?>
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'mobile')->textInput(['maxlength' => true]) ?>
<?php
if( Yii::$app->getSession()->hasFlash('error') ) {
echo Alert::widget([
'options' => [
'class' => 'alert alert-danger',
],
'body' => Yii::$app->getSession()->getFlash('error'),
]);
}
?>
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+25
View File
@@ -0,0 +1,25 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = '新增粉丝';
$this->params['breadcrumbs'][] = ['label' => 'Fans', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="user-create">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr/>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
</div>
</div>
+38
View File
@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '粉丝中心';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'mobile',
'auth_key',
'password_hash',
'password_reset_token',
// 'email:email',
// 'role',
// 'status',
// 'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
+83
View File
@@ -0,0 +1,83 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-08 12:10:51
* @Last Modified by: fm453
* @Last Modified time: 2021-09-11 09:13:09
* @Email: fm453@lukegzs.com
*/
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '粉丝清单';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?> 【共计 <kbd><code> <?= $count?> </code></kbd>人】</h1>
<div class="row">
<form action="<?=Url::toRoute('list')?>" method="post">
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
<div class="col-sm-3 pull-right">
<div class="input-group">
<input type="text" placeholder="搜用户名" name="search[username]" class="input-sm form-control" value="<?= isset($search['username'])?$search['username']:''; ?>">
<span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
</span>
</div>
</div>
<div class="col-sm-3 pull-right">
<input type="text" placeholder="搜邮箱" name="search[email]" class="input-sm form-control" value="<?= isset($search['email'])?$search['email']:''; ?>">
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>序号</th>
<th>名称</th>
<th>邮箱</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($fans as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><?=$vo['mobile']?></td>
<td><?=$vo['email']?></td>
<td><?=$status[$vo['status']]?></td>
<td>
<a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+38
View File
@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '更新粉丝';
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row pd-4">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<div class="auth-item-form col-sm-4">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
<?= $form->field($model, 'mobile')->textInput(['readonly'=>true])->label('账号') ?>
<?= $form->field($model, 'email')->textInput(['placeholder'=>''])->label('邮箱')?>
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
<?= $form->field($model, 'status' )->dropDownList($status,['disabled'=>false])->label('状态')?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'mobile',
'auth_key',
'password_hash',
'password_reset_token',
'email:email',
'role',
'status',
'created_at',
'updated_at',
],
]) ?>
</div>
+26
View File
@@ -0,0 +1,26 @@
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
$this->title = 'Hi';
?>
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<script src="js/plugins/flot/jquery.flot.js"></script>
<script src="js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="js/plugins/flot/jquery.flot.spline.js"></script>
<script src="js/plugins/flot/jquery.flot.resize.js"></script>
<script src="js/plugins/flot/jquery.flot.pie.js"></script>
<script src="js/plugins/flot/jquery.flot.symbol.js"></script>
<script src="js/plugins/peity/jquery.peity.min.js"></script>
<script src="js/demo/peity-demo.min.js"></script>
<script src="js/content.min.js?v=1.0.0"></script>
<script src="js/plugins/jquery-ui/jquery-ui.min.js"></script>
<script src="js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="js/plugins/easypiechart/jquery.easypiechart.js"></script>
<script src="js/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="js/demo/sparkline-demo.min.js"></script>
+218
View File
@@ -0,0 +1,218 @@
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use backend\components\Helper;
$this->title = '欢迎界面';
$smsstat = Helper::getSmsStat();
$attachStat = Helper::getAttachStat();
?>
<div class="wrapper wrapper-content">
<div class="row">
<?php if(\Yii::$app->user->can('/site/index')):?> <!--判断是否有‘/site/index’权限,有则显示,无则隐藏-->
<?php endif;?>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-info pull-right">统计</span>
<h5>账号</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">运维人员:<?=Helper::getAdminerCount()?>名</h1>
<div class="stat-percent font-bold text-danger">!!!</div>
<small>可登陆后台管理系统的</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-warning pull-right">统计</span>
<h5>API</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=Helper::getApierCount()?></h1>
<div class="stat-percent font-bold text-warning">稳定 <i class="fa fa-bolt"></i>
</div>
<small>API接口系统用户</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-success pull-right">统计</span>
<h5>会员</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=Helper::getMemberCount()?></h1>
<div class="stat-percent font-bold text-success">上升 <i class="fa fa-bolt"></i>
</div>
<small>可登陆各前端站点的</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-default pull-right">统计</span>
<h5>粉丝</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=Helper::getFansCount()?></h1>
<div class="stat-percent font-bold text-default"> <i class="fa fa-bolt"></i>
</div>
<small>仅作保存的基础数据</small>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>短信</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">累计向<?=$smsstat['mobile']?>个手机发送了<?=$smsstat['sms']?>条短信</h1>
<small>发送量统计</small>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>附件</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">累计储存了<?=$attachStat['num']?>个文件</h1>
<small>合计:<?=$attachStat['size']?> Bytes</small>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">历史</span>
<h5>访客</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=Helper::getHistoryVisNum()?></h1>
<small>访客</small>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-danger pull-right">最近一个月</span>
<h5>活跃用户</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=Helper::getMonthHistoryVisNum()?></h1>
<small><?= date('m')?>月</small>
</div>
</div>
</div>
<div class="col-sm-12">
<div id="history"></div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>用户名</th>
<th>登录IP</th>
<th>登录时间</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<?php foreach($log as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><?=$vo['username']?></td>
<td><?=$vo['ip']?></td>
<td><?= date('Y-m-d H:i:s',$vo['create_time'])?></td>
<td><?=str_replace('-','',$vo['data'])?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/highcharts.js')?>
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/modules/exporting.js')?>
<script type="text/javascript">
$(function () {
$('#history').highcharts({
title: {
text: '',
x: -20 //center
},
credits: { enabled:false }, //屏蔽右下角
exporting: { enabled:false }, //屏蔽右上角
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: [<?=$HistoryMonthStr?>]
},
yAxis: {
title: {
text: '访客/人'
},
//min: 7.5, // 这个用来控制y轴的开始刻度(最小刻度),另外还有一个表示最大刻度的max属性
startOnTick: false, // y轴坐标是否从某一刻度开始(这个设定与标题无关)
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '人',
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y:,.0f} 人</b><br/>',
shared: true
},
/*legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},*/
series: [{
name: '访客数',
data: [<?=$HistoryMonthNum?>]
}]
});
});
</script>
+37
View File
@@ -0,0 +1,37 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="auth-item-form col-sm-4">
<?php $form = ActiveForm::begin(); ?>
<?php if($model->name =='超级管理员'):?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true,'readonly'=>true]) ?>
<?= $form->field($model, 'type' )->dropDownList(['1' =>'角色' ,'2' =>'权限'],['disabled'=>true])?>
<?php else:?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'type' )->dropDownList(['1' =>'角色' ,'2' =>'权限'])?>
<?php endif;?>
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
<?/*= $form->field($model, 'rule_name')->textInput(['maxlength' => true]) */?><!--
<?/*= $form->field($model, 'data')->textarea(['rows' => 6]) */?>
<?/*= $form->field($model, 'created_at')->textInput() */?>
--><?/*= $form->field($model, 'updated_at')->textInput() */?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+24
View File
@@ -0,0 +1,24 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '创建角色';
$this->params['breadcrumbs'][] = ['label' => 'Auth Items', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row pd-10">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
</div>
</div>
+191
View File
@@ -0,0 +1,191 @@
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use backend\widgets\common\LinkPages;
$this->title = '角色&权限列表';
$this->params['breadcrumbs'][] = $this-> title;
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row">
<div class="col-sm-6 m-b-xs">
<?=Html::a("创建 <i class='icon-plus'></i>" , ['create' ], ['class' => 'btn btn-sm btn-primary'])?>
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('item/index')?>">角色管理</a>
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('item/permission')?>">权限管理</a>
</div>
</div>
<hr>
<div class="table-responsive">
<table class ="table table-striped table_base">
<thead >
<tr >
<th >ID </th>
<th >名称 </th>
<th >类型 </th>
<th >描述 </th>
<th >创建时间 </th>
<th >操作 </th>
</tr>
</thead>
<tbody >
<?php if ( empty($data[ 'data'])): ?>
<tr ><td colspan ="20"><?=Yii::t('common' ,'Not find data') ?> </td ></tr >
<?php else: ?>
<?php $i = $data['start'];?>
<?php foreach ( $data['data'] as $list):?>
<tr data-key =" <?=$list[ 'name'] ?>" >
<td ><?= $i++?> </td >
<td ><?= Html::encode($list[ 'name']) ?></ td>
<td ><?= Html::encode(($list[ 'type']==1)? '角色': '权限') ?></ td>
<td ><?= Html::encode($list[ 'description']) ?></ td>
<td> <?=Html:: encode($list['created_at']?date('Y-m-d',$list['created_at']):'未设置') ?></ td>
<td >
<a class="btn btn-primary btn-xs" href= "<?= Url::to([ 'update', 'id'=>$list[ 'name']]); ?>" ><i class="fa fa-edit"></i>编辑 </a >
<a class="btn btn-success btn-xs" href= "<?= Url::toRoute([ 'permission/set', 'id'=>$list[ 'name']]); ?>" ><i class="fa fa-unlock-alt"></i>权限 </a >
<?php if($list['name'] != '超级管理员'):?>
<a class ="del btn btn-default btn-xs" href= "javaScript:;"><i class="fa fa-close"></i>删除</a >
<?php endif;?>
</td >
</tr >
<?php endforeach; ?>
<?php endif; ?>
</tbody >
</table >
<?=Yii::t('common' , '{start}-{end} a total of {total}',['start' => $data[ 'start'], 'end'=> $data['end'],'total'=> $data['count' ]])?> </div >
<?=LinkPages:: widget(['pagination' => $pages]);?>
<input type ="hidden" name="delUrl" value= "<?= Url::to([ 'delete']) ?>" >
</div>
</div >
<script>
(function($) {
var delUrl = $('input[name=delUrl]').val(),
delAllUrl = $('input[name=delAllUrl]').val(),
obj_thead = $('.table_base > thead'),
obj_tbody = $('.table_base > tbody'),
obj_check = $('.table_base .checker'),
obj_check_ipt = obj_tbody.find('input[name=select]'),
obj_check_all = obj_thead.find('input[name=select_all]'),
submitData = {};
submitData[$('[name=csrf-param]').attr('content')] = $('[name=csrf-token]').attr('content');
/*复选框start*/
obj_check.hover(function(){
$(this).addClass('hover');
},function(){
$(this).removeClass('hover');
});
obj_check.click(function(){
var _checkbox = $(this).find('input[name^=select]'),
isChecked = _checkbox[0].checked;
_checkbox.parent()[ isChecked ? 'addClass' : 'removeClass' ]('checked');
if(_checkbox.hasClass('select-on-check-all')){
$.each(obj_check_ipt,function(){
$(this)[0].checked = isChecked ? true : false;
$(this).parent()[ isChecked ? 'addClass' : 'removeClass' ]('checked');
})
}
ifAllCheck();
checkToIpt();
});
$('.bottomBtn > #selectall').click(function(){
obj_check_all.click();
});
$('.bottomBtn > #export').click(function(){
if(confirm('您确定要删除选中项吗?')){
var ids = $('.bottomBtn > #selected').val();
if(ids){
doAjax(
delAllUrl,
{ids: ids},
function(json){
if(json.status){
location.reload(true);
}else{
alert(json.msg);
}
}
);
}
}
});
function ifAllCheck(){
var allCheck = true
$.each(obj_check_ipt,function(){
if( !$(this)[0].checked ){
allCheck = false;
return;
}
})
obj_check_all[0].checked = allCheck;
obj_check_all.parent()[ allCheck ? 'addClass' : 'removeClass' ]('checked');
}
function checkToIpt(){
var selectedTemp = [];
$.each(obj_check_ipt,function(){
if( $(this)[0].checked ){
selectedTemp.push( $(this).parents('tr:first').attr('data-key') );
}
});
$('.bottomBtn > #selected').val( selectedTemp.join(',') );
}
/*复选框end*/
$('.table_base .del').click(function(){ // 点击删除
if(confirm('您确定要删除此项吗?')){
submitData['id'] = $(this).parents('tr:first').attr('data-key');
doAjax(
delUrl,
submitData,
function(json){
if(json.status){
location.reload(true);
}else{
alert(json.msg);
}
}
);
}
});
function renderTmp(item, tmp) { // 渲染值
return tmp.replace( /\{.+?\}/g, function($1) { return item[$1.slice(1, -1)] ? item[$1.slice(1, -1)] : ''; });
}
function trBC(){ // tr背景颜色间隔
obj_tbody.find('td').css('background-color','#ffffff');
obj_tbody.find('tr:visible').each(function(key,val){
if(key%2 == 0){
$(val).find('td').css('background-color','#f9f9f9');
}
});
}
function doAjax(url,data,sucFn){
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: data,
success: sucFn,
error: function(){
alert('交互错误');
}
});
}
})(jQuery)
</script>
+24
View File
@@ -0,0 +1,24 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '更新角色 ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Auth Items', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->name]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="wrapper wrapper-content ">
<div class="ibox-content">
<div class="row pd-10">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
</div>
</div>
+41
View File
@@ -0,0 +1,41 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Auth Items', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<h4><?= Html::encode($this->title) ?></h4>
<p>
<?= Html::a('Update', ['update', 'id' => $model->name], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->name], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'name',
'type',
'description:ntext',
'rule_name',
'data:ntext',
'created_at',
'updated_at',
],
]) ?>
</div>
+81
View File
@@ -0,0 +1,81 @@
<?php
/* @var $this \yii\web\View */
/* @var $content string */
use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use common\widgets\Alert;
// AppAsset::register($this);
$keywords = '';
$description = '';
$routes = ['data']; //自添加的controllers列表集,用于为新添加的控制器在渲染视图时自动加入HTML代码段,以便兼容h+的后台模板
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="keywords" content="<?php echo $keywords ?>">
<meta name="description" content="<?php echo $description ?>">
<!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<![endif]-->
<link rel="shortcut icon" href="./favicon.ico">
<?=Html::cssFile('@web/css/bootstrap.min.css')?>
<?=Html::cssFile('@web/css/font-awesome.css')?>
<?=Html::cssFile('@web/css/animate.min.css')?>
<?=Html::cssFile('@web/css/site.css')?>
<?=Html::cssFile('@web/css/style.min.css')?>
<?=Html::jsFile('@web/js/jquery.min.js')?>
<?php $this->head() ?>
</head>
<body class="fixed-sidebar full-height-layout gray-bg">
<?php $this->beginBody() ?>
<?php if((Yii::$app->controller->module->defaultRoute!="site") ||(Yii::$app->controller->module->defaultRoute=="site" && Yii::$app->controller->module->requestedRoute!=""
&& Yii::$app->controller->module->requestedRoute!="site/login")):?>
<nav class="breadcrumb fix_top hidden-sm hidden-xs" style="height: 45px;">
<div class="pull-right">
<a class="btn btn-primary radius " style="line-height:1.6em;margin-top:3px" href="javascript:history.go(-1);" title="后退">
<span class="fa fa-reply"></span>
</a>
&nbsp;
<a class="btn btn-primary radius" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新">
<span class="fa fa-refresh"></span>
</a>
&nbsp;
</div>
</nav>
<?php endif;?>
<?php if(in_array(Yii::$app->controller->module->id,$routes)): ?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<?php endif;?>
<?= $content ?>
<?php if(in_array(Yii::$app->controller->module->id,$routes)): ?>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
+135
View File
@@ -0,0 +1,135 @@
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '登陆日志';
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">历史</span>
<h5>访客</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=\backend\components\Helper::getHistoryVisNum()?></h1>
<small>访客</small>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-danger pull-right">最近一个月</span>
<h5>活跃用户</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins"><?=\backend\components\Helper::getMonthHistoryVisNum()?></h1>
<small><?= date('m')?>月</small>
</div>
</div>
</div>
<div class="col-sm-12">
<div id="history"></div>
</div>
</div>
<?php if(\Yii::$app->user->can('/log/login')):?> <!--判断是否有权限,有则显示,无则隐藏-->
<div class="row">
<div class="col-md-12">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>用户名</th>
<th>登录IP</th>
<th>登录时间</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<?php foreach($log as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><?=$vo['username']?></td>
<td><?=$vo['ip']?></td>
<td><?= date('Y-m-d H:i:s',$vo['create_time'])?></td>
<td><?=str_replace('-','',$vo['data'])?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
</div>
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/highcharts.js')?>
<?=Html::jsFile('@web/js/plugins/Highcharts/4.1.7/js/modules/exporting.js')?>
<script type="text/javascript">
$(function () {
$('#history').highcharts({
title: {
text: '',
x: -20 //center
},
credits: { enabled:false }, //屏蔽右下角
exporting: { enabled:false }, //屏蔽右上角
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: [<?=$HistoryMonthStr?>]
},
yAxis: {
title: {
text: '访客/人'
},
//min: 7.5, // 这个用来控制y轴的开始刻度(最小刻度),另外还有一个表示最大刻度的max属性
startOnTick: false, // y轴坐标是否从某一刻度开始(这个设定与标题无关)
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '人',
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y:,.0f} 人</b><br/>',
shared: true
},
/*legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},*/
series: [{
name: '访客数',
data: [<?=$HistoryMonthNum?>]
}]
});
});
</script>
+41
View File
@@ -0,0 +1,41 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\bootstrap\Alert;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
$params = Yii::$app->params;
?>
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
<?php
if( Yii::$app->getSession()->hasFlash('error') ) {
echo Alert::widget([
'options' => [
'class' => 'alert alert-danger',
],
'body' => Yii::$app->getSession()->getFlash('error'),
]);
}
?>
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])->label('头像')?>
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+25
View File
@@ -0,0 +1,25 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = '新增会员';
$this->params['breadcrumbs'][] = ['label' => 'Member', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="user-create">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr/>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
</div>
</div>
+38
View File
@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '会员中心';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
// 'email:email',
// 'role',
// 'status',
// 'created_at',
// 'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
+91
View File
@@ -0,0 +1,91 @@
<?php
/**
* @Author: fm453
* @Date: 2021-09-08 12:10:51
* @Last Modified by: fm453
* @Last Modified time: 2021-09-09 03:03:02
* @Email: fm453@lukegzs.com
*/
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '会员列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?> 【共计 <kbd><code> <?= $count?> </code></kbd>人】</h1>
<div class="row">
<div class="col-sm-3">
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('create')?>">添加会员</a>
</div>
<form action="<?=Url::toRoute('list')?>" method="post">
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
<div class="col-sm-3 pull-right">
<div class="input-group">
<input type="text" placeholder="搜手机号" name="search[mobile]" class="input-sm form-control" value="<?= isset($search['mobile'])?$search['mobile']:''; ?>"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</div>
<div class="col-sm-3 pull-right">
<input type="text" placeholder="搜用户名" name="search[username]" class="input-sm form-control" value="<?= isset($search['username'])?$search['username']:''; ?>">
</div>
<div class="col-sm-3 pull-right">
<input type="text" placeholder="搜邮箱" name="search[email]" class="input-sm form-control" value="<?= isset($search['email'])?$search['email']:''; ?>">
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>序号</th>
<th>名称</th>
<th>手机</th>
<th>邮箱</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($member as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
<td><?=$vo['mobile']?></td>
<td><?=$vo['email']?></td>
<td><?=$status[$vo['status']]?></td>
<td>
<a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a>
<?php if($vo['status']==0):?><a href="<?=Url::toRoute(['status','status'=>1,'id'=>$vo['id']])?>" class="btn btn-warning btn-xs"><i class="fa fa-unlock"></i>恢复</a><?php endif;?>
<?php if($vo['status']==1):?><a href="<?=Url::toRoute(['status','status'=>0,'id'=>$vo['id']])?>" class="btn btn-danger btn-xs"><i class="fa fa-lock"></i>禁用</a><?php endif;?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+41
View File
@@ -0,0 +1,41 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '更新会员';
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row pd-4">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<div class="auth-item-form col-sm-4">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
<?= $form->field($model, 'username')->textInput()->label('会员名称') ?>
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
<?= $form->field($model, 'email')->textInput(['placeholder'=>'','readonly'=>true])->label('邮箱')?>
<?= $form->field($model, 'mobile')->textInput(['placeholder'=>'','readonly'=>true])->label('手机号')?>
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
<?= $form->field($model, 'status' )->dropDownList($status,['disabled'=>false])->label('状态')?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
'email:email',
'role',
'status',
'created_at',
'updated_at',
],
]) ?>
</div>
+33
View File
@@ -0,0 +1,33 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="menu-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'parent' )->dropDownList($menuArr)?>
<?= $form->field($model, 'route')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'sort')->textInput()->label('排序') ?>
<?= $form->field($model, 'status')->radioList(['1'=>'显示','0'=>'隐藏'])->label('显示')?>
<?= $form->field($model, 'data')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+23
View File
@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = '创建菜单';
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
'menuArr' => $menuArr,
]) ?>
</div>
</div>
+85
View File
@@ -0,0 +1,85 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '菜单';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox float-e-margins">
<div class="ibox-content">
<p>
<?= Html::a('创建菜单', ['create'], ['class' => 'btn btn-sm btn-primary']) ?>
</p>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>父级</th>
<th>路由</th>
<th>状态</th>
<th>排序</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($menu as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><?=$vo['name']?></td>
<td><?=$vo['parent']?></td>
<td><?=$vo['route']?></td>
<td><?=$vo['status'] >0 ? '显示 ' : '隐藏'?></td>
<td><?=($vo['sort']==''?'未排序':$vo['sort'])?></td>
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$vo['id']])?>"><i class="fa fa-close"></i>删除</a></td>
</tr>
<?php if(!empty($vo['_child'])):?>
<?php foreach($vo['_child'] as $v):?>
<tr>
<td><?=$v['id']?></td>
<td><?=$v['name']?></td>
<td><?=$v['parent']?></td>
<td><?=$v['route']?></td>
<td><?=$v['status'] > 0 ? '显示' : '隐藏'?></td>
<td><?=($v['sort']==''?'未排序':$v['sort'])?></td>
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$v['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$v['id']])?>"><i class="fa fa-close"></i>删除</a></td>
</tr>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<!--<div class="f-r">
<?/*= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) */?>
</div>-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+22
View File
@@ -0,0 +1,22 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = '更新菜单: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="wrapper wrapper-content ">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
'menuArr' => $menuArr,
]) ?>
</div>
</div>
+40
View File
@@ -0,0 +1,40 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content animated fadeInRight">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('创建', ['create'], ['class' => 'btn btn-primary']) ?>
<?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('删除', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'parent',
'route',
'sort',
'data:ntext',
],
]) ?>
</div>
+25
View File
@@ -0,0 +1,25 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItemChild */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="auth-item-child-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'parent')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'child')->textInput(['maxlength' => true]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+21
View File
@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItemChild */
$this->title = 'Create Auth Item Child';
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="auth-item-child-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
+30
View File
@@ -0,0 +1,30 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Auth Item Children';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="auth-item-child-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create Auth Item Child', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'parent',
'child',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
+75
View File
@@ -0,0 +1,75 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItemChild */
$this->title = '配置权限';
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<form action="<?=Url::toRoute(['permission/set','id'=>$id])?>" method="post">
<div class="row">
<?php foreach($menu as $vo):?>
<div class="col-sm-12 permission-block">
<div class="ibox-permission">
<h3><?= $vo->name?></h3>
<hr>
<input name="parent" type="hidden" value="<?=$id?>">
<!--<label><input type="checkbox" class="chkall" name="checkall" value="1">全选</label>&nbsp;&nbsp;-->
<?php foreach($items as $v):?>
<?php if($vo['id'] == $v->permissionName['parent']):?>
<?php if($id == '超级管理员'):?>
<label><input type="checkbox" class="chk" disabled name="permission[]" value="<?=$v->name?>"><?=($v->permissionName['name'] ==''? $v->name : $v->permissionName['name'])?></label>&nbsp;&nbsp;
<?php else:?>
<label><input type="checkbox" class="chk" name="permission[]" value="<?=$v->name?>"><?=($v->permissionName['name'] ==''? $v->name : $v->permissionName['name'])?></label>&nbsp;&nbsp;
<?php endif;?>
<?php endif;?>
<?php endforeach;?>
</div>
</div>
<?php endforeach;?>
</div>
<br>
<br>
<div class="clear"></div>
<input type="submit" value="保存" class="btn btn-primary">
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var num = 0;
var permission = <?= json_encode($Permission);?>;
$('.chk').each(function(){
var self = $(this);
var selfVal = self.val();
$.each(permission, function(n, v){
if(v.name == selfVal){
self.attr('checked' , 'true');
num++;
};
});
});
var nums = $('.chk').size(); //全选勾中
if(nums == num){
$('.chkall').attr("checked",true);
}
$(".chkall").click(function(){
var isChecked = $(this).prop("checked");
$("input[name='permission[]']").prop("checked", isChecked);
});
});
</script>
+21
View File
@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItemChild */
$this->title = 'Update Auth Item Child: ' . ' ' . $model->parent;
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->parent, 'url' => ['view', 'parent' => $model->parent, 'child' => $model->child]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="auth-item-child-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
+36
View File
@@ -0,0 +1,36 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItemChild */
$this->title = $model->parent;
$this->params['breadcrumbs'][] = ['label' => 'Auth Item Children', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="auth-item-child-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'parent' => $model->parent, 'child' => $model->child], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'parent' => $model->parent, 'child' => $model->child], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'parent',
'child',
],
]) ?>
</div>
+18
View File
@@ -0,0 +1,18 @@
<?php
/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */
use yii\helpers\Html;
$this->title = $name;
?>
<div class="site-error">
<div style="margin-top: 100px;text-align: center;">
<h1><?= Html::encode($this->title) ?></h1><br>
</div>
<h4 style="margin: 10px auto;text-align: center;background-color: #1ab394; color: #ffffff;width: 500px;height: 50px;line-height: 50px;border-radius: 5px;"><?= nl2br(Html::encode($message)) ?></h4>
</div>
+284
View File
@@ -0,0 +1,284 @@
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use mdm\admin\components\MenuHelper;
$this->title = Yii::t('common' ,'System Name');
$keywords = '';
$description = '';
$this->params['breadcrumbs'][] = $this->title;
?>
<div id="wrapper">
<!--左侧导航开始-->
<nav class="navbar-default navbar-static-side" role="navigation">
<div class="nav-close"><i class="fa fa-times-circle"></i>
</div>
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li class="nav-header">
<div class="dropdown profile-element">
<span><img alt="image" class="img-circle" src="<?php echo Url::to(Yii::$app->user->identity->avatar);?>" /></span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="clear">
<span class="block m-t-xs"><strong class="font-bold"><?= Yii::$app->user->identity->username ?></strong></span>
<span class="text-muted text-xs block"><?= $user_info?><b class="caret"></b></span>
</span>
</a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a class="J_menuItem" href="">修改头像</a>
</li>
<li><a class="J_menuItem" href="<?= Url::toRoute(['adminer/update','id'=>Yii::$app->user->identity->getId()])?>">个人资料</a>
</li>
<li class="divider"></li>
<li><a href="<?=Url::toRoute('site/logout')?>">安全退出</a>
</li>
</ul>
</div>
<div class="logo-element">Hi
</div>
</li>
<?php foreach($menu as $v1):?>
<?php $data = json_decode($v1['data'], true);?>
<li><!--一级级菜单-->
<a href="#">
<i class="<?=$data['icon']?>"></i>
<span class="nav-label"><?= $v1['name']?></span>
<span class="fa arrow"></span>
</a>
<?php if(array_key_exists('_child',$v1)):?>
<ul class="nav nav-second-level">
<?php foreach($v1['_child'] as $v2):?>
<?php $data2 = isset($v2['data']) ? json_decode($v2['data'], true) : [];?>
<?php if(array_key_exists('_child',$v2)):?>
<li><!--二级菜单-->
<a href="#">
<?php if($data2['icon']):?><i class="<?=$data2['icon']?>"></i><?php endif;?><?= $v2['name']?>
<span class="fa arrow"></span>
</a>
<?php if(!empty($v2['_child'])):?>
<ul class="nav nav-third-level collapse">
<?php foreach($v2['_child'] as $v3):?>
<li><!--三级菜单-->
<a class="J_menuItem" href="<?= Url::toRoute($v3['route']);?>" data-index="0"><?= $v3['name']?></a>
</li>
<?php endforeach;?>
</ul>
<?php endif;?>
</li>
<?php else:?>
<li><!--二级菜单-->
<a class="J_menuItem" href="<?= Url::toRoute($v2['route']);?>" data-index="0"><?= $v2['name']?></a>
</li>
<?php endif;?>
<?php endforeach;?>
</ul>
<?php endif;?>
</li>
<?php endforeach;?>
</ul>
</div>
</nav>
<!--左侧导航结束-->
<!--右侧部分开始-->
<div id="page-wrapper" class="gray-bg dashbard-1">
<div class="row border-bottom">
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
<button class="navbar-minimalize minimalize-styl-2 btn btn-primary " >超级后台</button><form role="search" class="navbar-form-custom" method="post" action="#">
<div class="form-group">
<input type="text" placeholder="快速查找(该功能暂未开放) …" class="form-control" name="top-search" id="top-search">
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-bell"></i> <span class="label label-warning">8</span>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<a href="#">
<div>
<i class="fa fa-envelope fa-fw"></i> 还只是测试
<span class="pull-right text-muted small">4分钟前</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="#">
<div>
<i class="fa fa-qq fa-fw"></i> 请忽略我
<span class="pull-right text-muted small">12分钟钱</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a class="J_menuItem" href="#">
<strong>查看所有 </strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
<li class="dropdown hidden-xs">
<a class="right-sidebar-toggle" aria-expanded="false">
<i class="fa fa-tasks"></i> 主题
</a>
</li>
</ul>
</nav>
</div>
<div class="row content-tabs">
<button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
</button>
<nav class="page-tabs J_menuTabs">
<div class="page-tabs-content">
<a href="javascript:;" class="active J_menuTab" data-id="">首页</a>
</div>
</nav>
<button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
</button>
<div class="btn-group roll-nav roll-right">
<button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
</button>
<ul role="menu" class="dropdown-menu dropdown-menu-right">
<li class="J_tabShowActive"><a>定位当前选项卡</a>
</li>
<li class="divider"></li>
<li class="J_tabCloseAll"><a>关闭全部选项卡</a>
</li>
<li class="J_tabCloseOther"><a>关闭其他选项卡</a>
</li>
</ul>
</div>
<a href="<?=Url::toRoute('site/logout')?>" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
</div>
<div class="row J_mainContent" id="content-main">
<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="<?= Url::toRoute('index/welcome')?>" frameborder="0" data-id="" seamless></iframe>
</div>
<div class="footer">
<div class="pull-left">
version:<?= HI_VERSION;?>
</div>
<div class="pull-right">
Copyright &copy; <?= Yii::t('common' ,'Company Create Time') ?>-<?php echo date('Y',time()); ?> <a href="https://www.hiluker.com" target="_blank">嗨路客电商</a> -Based On V<?php echo Yii::getVersion();?>
</div>
</div>
</div>
</div>
<!--右侧部分结束-->
<!--右侧边栏开始-->
<div id="right-sidebar">
<div class="sidebar-container">
<ul class="nav nav-tabs navs-3">
<li class="active ">
<a data-toggle="tab" href="#tab-1">
<i class="fa fa-gear"></i> 主题
</a>
</li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane active">
<div class="sidebar-title ">
<h3> <i class="fa fa-comments-o"></i> 主题设置</h3>
<small><i class="fa fa-tim"></i> 你可以从这里选择和预览主题的布局和样式;刷新后或重新登陆后即会重置。</small>
</div>
<div class="skin-setttings">
<div class="title">主题设置</div>
<div class="setings-item">
<span>收起左侧菜单</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="collapsemenu">
<label class="onoffswitch-label" for="collapsemenu">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>固定顶部</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="fixednavbar" class="onoffswitch-checkbox" id="fixednavbar">
<label class="onoffswitch-label" for="fixednavbar">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="setings-item">
<span>
固定宽度
</span>
<div class="switch">
<div class="onoffswitch">
<input type="checkbox" name="boxedlayout" class="onoffswitch-checkbox" id="boxedlayout">
<label class="onoffswitch-label" for="boxedlayout">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</div>
</div>
<div class="title">皮肤选择</div>
<div class="setings-item default-skin nb">
<span class="skin-name ">
<a href="#" class="s-skin-0">
默认皮肤
</a>
</span>
</div>
<div class="setings-item blue-skin nb">
<span class="skin-name ">
<a href="#" class="s-skin-1">
蓝色主题
</a>
</span>
</div>
<div class="setings-item yellow-skin nb">
<span class="skin-name ">
<a href="#" class="s-skin-3">
黄色/紫色主题
</a>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!--右侧边栏结束-->
</div>
<?=Html::jsFile('@web/js/jquery.min.js')?>
<?=Html::jsFile('@web/js/bootstrap.min.js')?>
<?=Html::jsFile('@web/js/plugins/metisMenu/jquery.metisMenu.js')?>
<?=Html::jsFile('@web/js/plugins/slimscroll/jquery.slimscroll.min.js')?>
<?=Html::jsFile('@web/js/plugins/layer/layer.min.js')?>
<?=Html::jsFile('@web/js/hplus.min.js')?>
<?=Html::jsFile('@web/js/contabs.min.js')?>
<?=Html::jsFile('@web/js/plugins/pace/pace.min.js')?>
+47
View File
@@ -0,0 +1,47 @@
<?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = Yii::t('backend' ,'System Name');
$keywords = '';
$description = '';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="middle-box text-center loginscreen animated fadeInDown">
<div>
<div>
<h1 class="logo-name">Hi</h1>
</div>
<h3><?php echo $this->title ?></h3>
<div class="row">
<div class="">
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<?= $form->field($model, 'username')->textInput(['autofocus' => true])->label(Yii::t('common' ,'Username')) ?>
<?= $form->field($model, 'password')->passwordInput()->label(Yii::t('common' ,'Password')) ?>
<?= $form->field($model, 'rememberMe')->checkbox()->label(Yii::t('common' ,'Remember Me')) ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
<div class="footer">
<div class="">Copyright &copy; <?=Yii::t('common' ,'Company Create Time') ?>-<?php echo date('Y',time()); ?> <a href="https://www.hiluker.com" target="_blank">嗨路客电商</a>
</div>
</div>
</div>
+42
View File
@@ -0,0 +1,42 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\bootstrap\Alert;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
$params = Yii::$app->params;
?>
<div class="user-form">
<?php $form = ActiveForm::begin(); ?>
<?php
if( Yii::$app->getSession()->hasFlash('error') ) {
echo Alert::widget([
'options' => [
'class' => 'alert alert-danger',
],
'body' => Yii::$app->getSession()->getFlash('error'),
]);
}
?>
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])?>
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
<?= $form->field($model, 'sms_type')->textInput(['placeholder'=>'alidayu','readonly'=>'true'])->label('短信接口')?>
<?= $form->field($model, 'sms_left')->textInput(['placeholder'=>'','type'=>'number'])->label('短信余量')?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+24
View File
@@ -0,0 +1,24 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = '新增API';
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="user-create">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr/>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
</div>
</div>
+32
View File
@@ -0,0 +1,32 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'API中心';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>
+85
View File
@@ -0,0 +1,85 @@
<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = 'API用户列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<div class="row">
<div class="col-sm-3">
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('user/create')?>">新增用户</a>
</div>
<form action="<?=Url::toRoute('user/list')?>" method="post">
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
<div class="col-sm-3 pull-right">
<div class="input-group">
<input type="text" placeholder="请输入手机号" name="search[mobile]" class="input-sm form-control" value="<?= isset($search['mobile'])?$search['mobile']:''; ?>"> <span class="input-group-btn">
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
</div>
</div>
<div class="col-sm-3 pull-right">
<input type="text" placeholder="请输入用户名" name="search[username]" class="input-sm form-control" value="<?= isset($search['username'])?$search['username']:''; ?>">
</div>
</form>
</div>
<hr>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>序号</th>
<th>账号</th>
<th>联系方式</th>
<th>存入统计</th>
<th>取出统计</th>
<th>短信统计</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($user as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
<td><?=$vo['mobile']?><br><?=$vo['email']?></td>
<td>流量:<?=$vo['inbytes']?>字节<br>次数:<?=$vo['intimes']?>次</td>
<td>流量:<?=$vo['outbytes']?>字节<br>次数:<?=$vo['outtimes']?>次</td>
<td>累计发送:<?=$vo['sms_total']?>条<br>剩余:<?=$vo['sms_left']?>条</td>
<td><?=$status[$vo['status']]['title']?></td>
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['user/update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a>
<?php if($vo['status']==9):?><a href="<?=Url::toRoute(['status','status'=>10,'id'=>$vo['id']])?>" class="btn btn-warning btn-xs"><i class="fa fa-unlock"></i>启用</a><?php endif;?>
<?php if($vo['status']==10):?><a href="<?=Url::toRoute(['status','status'=>9,'id'=>$vo['id']])?>" class="btn btn-danger btn-xs"><i class="fa fa-lock"></i>禁用</a><?php endif;?>
<?php if(!in_array($vo['username'],array('publicapi','test'))):?><a href="<?=Url::toRoute(['user/delete','id'=>$vo['id']])?>" class="btn btn-default btn-xs"><i class="fa fa-close"></i>删除</a><?php endif;?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<div class="f-r">
<?= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+45
View File
@@ -0,0 +1,45 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\AuthItem */
$this->title = '更新API';
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<div class="row pd-10">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<div class="auth-item-form col-sm-4">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
<?= $form->field($model, 'username')->textInput(['readonly'=>true])->label('登陆账号') ?>
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
<?= $form->field($model, 'email')->textInput(['placeholder'=>''])->label('邮箱')?>
<?= $form->field($model, 'mobile')->textInput(['placeholder'=>''])->label('手机号')?>
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
<span class="help-block m-b-none">如果不需要修改密码,留空即可</span>
<?= $form->field($model, 'sms_type')->textInput(['placeholder'=>'alidayu','readonly'=>'true'])->label('短信接口')?>
<?= $form->field($model, 'sms_left')->textInput(['placeholder'=>'','type'=>'number'])->label('短信余量')?>
<?= $form->field($model, 'status' )->dropDownList($userstatus,['disabled'=>false])->label('状态')?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\User */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'username',
'auth_key',
'password_hash',
'password_reset_token',
'email:email',
'role',
'status',
'created_at',
'updated_at',
],
]) ?>
</div>