2025-04-10 23:19:13 +08:00

229 lines
8.4 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
# @Author: fm453
# @Date: 2021-12-31T04:43:18+08:00
# @Last modified by: fm453
# @Last modified time: 2022-03-11T09:56:02+08:00
/* @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: 0.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>
<hr>
<?php
fm_load()->fm_func('userAgent');
if(!fmFunc_UA_isMobile()){
Html::jsFile('@web/js/welcome.min.js?v=1.0.0');
}
?>