lylme_spage/admin/index.php

233 lines
7.6 KiB
PHP
Raw Normal View History

2022-02-19 23:38:30 +08:00
<?php
$title = '后台管理';
include './head.php';
2022-12-05 21:54:07 +08:00
$last = date("Ym");
2022-05-12 03:00:31 +08:00
if(@file_get_contents('log.txt') != $last || !file_exists('cache.php')){
2022-05-03 14:12:28 +08:00
$update = update();
2022-05-12 03:00:31 +08:00
file_put_contents('log.txt',$last);
var_export($update,true);
$content = "<?php\nreturn ".var_export($update,true)."\n?>";
file_put_contents('cache.php', $content);
}
2022-03-12 15:39:33 +08:00
$mysqlversion=$DB->count("select VERSION()");
2022-03-26 16:31:45 +08:00
function tjsj($tjname) {
if($tjname=='') {
echo '0';
} else {
echo $tjname;
}
}
2022-02-19 23:38:30 +08:00
?>
<!--页面主要内容-->
<main class="lyear-layout-content">
<div class="container-fluid">
2022-03-05 14:00:05 +08:00
<?php
2022-05-12 03:00:31 +08:00
$update = require('cache.php');
2022-03-26 16:31:45 +08:00
if(!empty($update)) {
2022-05-23 15:31:11 +08:00
if($update['switch']) {
if($update['msg_switch'] && !empty($update['msg'])) {
echo '<div class="card"><div class="card-header"><h4>'.$update['title'].'</h4></div><ul class="list-group">'.$update['msg'].'</ul></div>';
2022-03-26 16:31:45 +08:00
}
if(getver($update['version']) > getver($conf['version'])) {
2022-05-23 15:31:11 +08:00
echo '<div class="card"><div class="card-header"><h4>更新提示</h4></div><ul class="list-group">'.$update['update_msg'].'</ul></div>';
2022-03-26 16:31:45 +08:00
}
}
}
?>
2022-02-19 23:38:30 +08:00
<div class="row">
<div class="col-sm-6 col-lg-3">
<div class="card bg-primary">
<div class="card-body clearfix">
<div class="pull-right">
2022-02-22 03:04:20 +08:00
<p class="h6 text-white m-t-0">链接数量</p>
2022-03-26 16:31:45 +08:00
<p class="h3 text-white m-b-0 fa-1-5x"><?php tjsj($linksrows);
?></p>
2022-02-19 23:38:30 +08:00
</div>
2022-03-26 16:31:45 +08:00
<div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-web fa-1-5x"></i></span> </div>
2022-02-19 23:38:30 +08:00
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card bg-danger">
<div class="card-body clearfix">
<div class="pull-right">
2022-05-03 14:01:49 +08:00
<p class="h6 text-white m-t-0">今日浏览量</p>
2022-03-26 16:31:45 +08:00
<p class="h3 text-white m-b-0 fa-1-5x"><?php tjsj($tjtoday);
?></p>
2022-02-19 23:38:30 +08:00
</div>
<div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fa-1-5x"></i></span> </div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card bg-success">
<div class="card-body clearfix">
<div class="pull-right">
2022-05-03 14:01:49 +08:00
<p class="h6 text-white m-t-0">昨日浏览量</p>
2022-03-26 16:31:45 +08:00
<p class="h3 text-white m-b-0 fa-1-5x"><?php tjsj($tjyesterday);
?></p>
2022-02-19 23:38:30 +08:00
</div>
2022-03-26 16:31:45 +08:00
<div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account-convert fa-1-5x"></i></span> </div>
2022-02-19 23:38:30 +08:00
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="card bg-purple">
<div class="card-body clearfix">
<div class="pull-right">
2022-05-03 14:01:49 +08:00
<p class="h6 text-white m-t-0">累计浏览量</p>
2022-03-26 16:31:45 +08:00
<p class="h3 text-white m-b-0 fa-1-5x"><?php tjsj($tjtotal);
?></p>
2022-02-19 23:38:30 +08:00
</div>
2022-03-26 16:31:45 +08:00
<div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account-multiple fa-1-5x"></i></span> </div>
2022-02-19 23:38:30 +08:00
</div>
</div>
</div>
</div>
2022-04-03 22:58:53 +08:00
<?php
2022-03-26 16:31:45 +08:00
if($applyrows>0) {
echo'
<div class="row">
<div class="col-sm-6 col-lg-12">
<div class="card bg-info">
<div class="card-body clearfix">
<a href="./apply.php"> <div class="pull-right">
<p class="h6 text-white m-t-0">待审核链接</p>
<p class="h3 text-white m-b-0 fa-1-5x">'.$applyrows.'</p>
</div></a>
<div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-link fa-1-5x"></i></span> </div>
</div>
</div>
</div>
</div>';
}
?>
<div class="row">
2022-02-22 03:04:20 +08:00
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h4>仪表盘柱状统计图</h4>
</div>
<div class="card-body">
<canvas class="js-chartjs-bars"></canvas>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h4>仪表盘折线统计图</h4>
</div>
<div class="card-body">
<canvas class="js-chartjs-lines"></canvas>
</div>
</div>
</div>
</div>
2022-02-19 23:38:30 +08:00
<div class="card">
<div class="card-header">
<h4>服务器信息</h4>
</div>
<ul class="list-group">
<li class="list-group-item">
<b>PHP 版本:</b><?php echo phpversion() ?>
2022-03-26 16:31:45 +08:00
<?php if(ini_get('safe_mode')) {
echo '线程安全';
} else {
echo '非线程安全';
}
?>
2022-02-19 23:38:30 +08:00
</li>
<li class="list-group-item">
<b>MySQL 版本:</b><?php echo $mysqlversion ?>
</li>
<li class="list-group-item">
<b>服务器软件:</b><?php echo $_SERVER['SERVER_SOFTWARE'] ?>
</li>
<li class="list-group-item">
2022-02-22 03:04:20 +08:00
<b>程序名称:</b>六零导航页(LyLme Spage)
2022-02-23 22:11:16 +08:00
</li>
<li class="list-group-item">
<b>建站日期:</b><?php echo $conf['build']?>
2022-02-19 23:38:30 +08:00
</li>
<li class="list-group-item">
2023-07-22 22:11:49 +08:00
<b>当前版本:</b><?php echo $conf['version']?> <a href="./update.php" target="_blank">检查更新</a>
2022-02-19 23:38:30 +08:00
</li>
<li class="list-group-item">
2023-07-22 22:11:49 +08:00
<b>最新版本:</b> <?php echo $update['version']?> <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank">查看更新说明</a>
2022-02-19 23:38:30 +08:00
</li>
<li class="list-group-item">
2023-07-22 22:11:49 +08:00
<b>项目作者:</b>六零 <a href="https://www.lylme.com/support/" target="_blank">捐赠作者</a>
2022-02-19 23:38:30 +08:00
</li>
<li class="list-group-item">
<b>项目地址:</b>https://github.com/LyLme/lylme_spage
2022-03-26 16:31:45 +08:00
</li>
2022-02-19 23:38:30 +08:00
</ul>
</div>
</div>
</main>
<!--End 页面主要内容-->
</div>
2022-01-20 15:35:11 +08:00
</div>
2022-02-22 03:04:20 +08:00
<?php
include './footer.php';
?>
2022-02-19 23:38:30 +08:00
<!--图表插件-->
2022-02-22 03:04:20 +08:00
<script type="text/javascript" src="js/Chart.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
2022-03-26 16:31:45 +08:00
var $dashChartBarsCnt = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
$dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );
var $dashChartBarsData = {
2022-05-03 14:01:49 +08:00
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览', '链接数', '分组数'],
2022-03-26 16:31:45 +08:00
datasets: [ {
label: '数量',
borderWidth: 1,
borderColor: 'rgba(0,0,0,0)',
backgroundColor: 'rgba(51,202,185,0.5)',
hoverBackgroundColor: "rgba(51,202,185,0.7)",
hoverBorderColor: "rgba(0,0,0,0)",
data: [<?php echo $tjtoday;
?>, <?php echo $tjyesterday;
?>, <?php echo $tjmonth;
?>, <?php echo $tjtotal;
?>, <?php echo $linksrows;
?>, <?php echo $groupsrows;
?>]
}
2022-02-22 03:04:20 +08:00
]
2022-03-26 16:31:45 +08:00
}
;
var $dashChartLinesData = {
2022-05-03 14:01:49 +08:00
labels: ['今日浏览', '昨日浏览', '本月浏览', '总浏览', '链接数', '分组数'],
2022-03-26 16:31:45 +08:00
datasets: [ {
label: '数量',
data: [<?php echo $tjtoday;
?>, <?php echo $tjyesterday;
?>, <?php echo $tjmonth;
?>, <?php echo $tjtotal;
?>,<?php echo $linksrows;
?>, <?php echo $groupsrows;
?>],
borderColor: '#358ed7',
backgroundColor: 'rgba(53, 142, 215, 0.175)',
borderWidth: 1,
fill: false,
lineTension: 0
}
2022-02-22 03:04:20 +08:00
]
2022-03-26 16:31:45 +08:00
}
;
new Chart($dashChartBarsCnt, {
type: 'bar',
data: $dashChartBarsData
}
);
var myLineChart = new Chart($dashChartLinesCnt, {
type: 'line',
data: $dashChartLinesData,
}
);
}
);
</script>