Browse Source

添加流量统计列表

adminstyle
叙述、别离 2 weeks ago
parent
commit
b4a504a8b3
3 changed files with 135 additions and 0 deletions
  1. +1
    -0
      src/admin/inc/inc_menu.php
  2. +40
    -0
      src/admin/statchart.php
  3. +94
    -0
      src/admin/templets/statchart.htm

+ 1
- 0
src/admin/inc/inc_menu.php View File

@@ -94,6 +94,7 @@ $adminMenu1
<m:item name='文档关键词维护' link='article_keywords_main.php' rank='sys_Keyword' target='main' />
<m:item name='搜索关键词维护' link='search_keywords_main.php' rank='sys_Keyword' target='main' />
<m:item name='自动摘要分页' link='article_description_main.php' rank='sys_Keyword' target='main' />
<m:item name='流量统计列表' link='statchart.php' rank='sys_ArcBatch' target='main' />
".(DEDEBIZ_SAFE_MODE ? "" : "<m:item name='数据库字段替换' link='sys_data_replace.php' rank='sys_ArcBatch' target='main' />")."
</m:top>
{$GLOBALS['menusMoudle']}


+ 40
- 0
src/admin/statchart.php View File

@@ -0,0 +1,40 @@
<?php
/**
* 流量统计列表
*
* @version $id:statchart.php 2024-04-15 xushubieli $
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2022 DedeBIZ.COM
* @license GNU GPL v2 (https://www.dedebiz.com/license)
* @link https://www.dedebiz.com
*/
require_once(dirname(__FILE__)."/config.php");
require_once(DEDEINC.'/datalistcp.class.php');
//检查权限
if ($id == 0 && $reid == 0) {
CheckPurview('c_List');
}
if (empty($mobile)) $mobile = '';
if ($dopost=="delete") {
$ids = explode('`',$aids);
$dquery = "";
foreach ($ids as $id) {
if ($dquery=="") $dquery .= "id='$id' ";
else $dquery .= " OR id='$id' ";
}
if($dquery!="") $dquery = " WHERE ".$dquery;
$dsql->ExecuteNoneQuery("DELETE FROM `#@__statistics_detail` $dquery");
ShowMsg("成功删除指定的记录", "statchart.php");
exit();
} else {
$addsql = " WHERE ip LIKE '%$ip%' ";
$sql = "SELECT * FROM `#@__statistics_detail` $addsql ORDER BY id DESC";
$dlist = new DataListCP();
//文档列表数
$dlist->pageSize = 30;
$tplfile = DEDEADMIN."/templets/statchart.htm";
$dlist->SetTemplate($tplfile); //载入模板
$dlist->SetSource($sql); //设定查询SQL
$dlist->Display(); //显示
}
?>

+ 94
- 0
src/admin/templets/statchart.htm View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<title>流量统计列表</title>
<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/web/css/admin.css">
</head>
<body>
<form name="form2" action="statchart.php" method="get">
<table class="table shadow-sm my-3">
<tr>
<td>
<input type="text" name="ip" class="admin-input-lg mr-3" placeholder="请输入地址ip">
<button type="submit" class="btn btn-success btn-sm">搜索</button>
</td>
</tr>
</table>
</form>
<form name="form1">
<table class="table shadow-sm mb-3">
<tr>
<td colspan="9">流量统计列表</td>
</tr>
<tr align="center">
<td width="6%">选择</td>
<td width="6%">序号</td>
<td width="16%">用户</td>
<td width="10%">地址</td>
<td width="10%">浏览器</td>
<td width="10%">终端</td>
<td width="10%">创建时间</td>
<td width="16%">访问时间</td>
<td width="16%">访问日期</td>
</tr>
{dede:datalist}
<tr align="center">
<td><input type="checkbox" name="aids" value="{dede:field.id/}"></td>
<td>{dede:field.id/}</td>
<td>{dede:field.dduuid/}</td>
<td>{dede:field.ip/}</td>
<td>{dede:field.browser/}</td>
<td>{dede:field.os/}</a></td>
<td>{dede:field.created_hour/}</td>
<td>{dede:field.t function="MyDate('Y-m-d H:i:s',@me)"/}</td>
<td>{dede:field.created_date/}</td>
</tr>
{/dede:datalist}
<tr>
<td colspan="9">
<a href="javascript:ReSel();" class="btn btn-success btn-sm">反选</a>
<a href="javascript:DelSel();" class="btn btn-danger btn-sm">删除</a>
</td>
</tr>
<tr>
<td colspan="9" align="center">
{dede:pagelist listitem="info,pre,next,pageno" listsize="5"/}
</td>
</tr>
</table>
</form>
<script>
function getCheckboxItem() {
var allSel = "";
if (document.form1.aids.value) return document.form1.aids.value;
for (i = 0; i < document.form1.aids.length; i++) {
if (document.form1.aids[i].checked) {
if (allSel == "")
allSel = document.form1.aids[i].value;
else
allSel = allSel + "`" + document.form1.aids[i].value;
}
}
return allSel;
}
function ReSel() {
for (i = 0; i < document.form1.aids.length; i++) {
if (document.form1.aids[i].checked) document.form1.aids[i].checked = false;
else document.form1.aids[i].checked = true;
}
}
function DelSel() {
var nid = getCheckboxItem();
if (nid == "") {
alert("请选择要删除的信息");
return;
}
location.href = "statchart.php?dopost=delete&aids=" + nid;
}
</script>
</body>
</html>

Loading…
Cancel
Save