📄 moreusertotal.php
字号:
<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"totaldata");
$userid=(int)$_GET['userid'];
$username=RepPostVar($_GET['username']);
$tbname=RepPostVar($_GET['tbname']);
if(empty($tbname))
{
$tbname=$public_r['tbname'];
}
if(!$userid||!$username||!$tbname)
{
printerror('ErrorUrl','');
}
//数据表
$b=0;
$htb=0;
$tbsql=$empire->query("select tbname,tname from {$dbtbpre}enewstable order by tid");
while($tbr=$empire->fetch($tbsql))
{
$b=1;
$select="";
if($tbr[tbname]==$tbname)
{
$htb=1;
$select=" selected";
}
$tbstr.="<option value='".$tbr[tbname]."'".$select.">".$tbr[tname]."</option>";
}
if($b==0)
{
printerror('ErrorUrl','');
}
if($htb==0)
{
printerror('ErrorUrl','');
}
//日期
$year=date("Y");
$yyear=$year-1;
$date=RepPostVar($_GET['date']);
if(empty($date))
{
$date=date("Y-m");
}
$selectdate='';
$yselectdate='';
for($i=1;$i<=12;$i++)
{
$m=$i;
if($i<10)
{
$m='0'.$i;
}
//今年
$sdate=$year.'-'.$m;
$select='';
if($sdate==$date)
{
$select=' selected';
}
$selectdate.="<option value='".$sdate."'".$select.">".$sdate."</option>";
//去年
$ysdate=$yyear.'-'.$m;
$yselect='';
if($ysdate==$date)
{
$yselect=' selected';
}
$yselectdate.="<option value='".$ysdate."'".$yselect.">".$ysdate."</option>";
}
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?=$username?> 的发布统计</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<form name="ChangeDate" method="get" action="MoreUserTotal.php">
<input type="hidden" name="userid" value="<?=$userid?>">
<input type="hidden" name="username" value="<?=$username?>">
<tr>
<td height="25">位置:<a href="MoreUserTotal.php?tbname=<?=$tbname?>&userid=<?=$userid?>&username=<?=$username?>"><?=$username?> 的发布统计</a></td>
</tr>
<tr>
<td height="30"> <div align="center">
<select name="date" id="date">
<?=$yselectdate.$selectdate?>
</select>
<select name="tbname" id="tbname">
<?=$tbstr?>
</select>
<input type="submit" name="Submit" value="显示">
</div></td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr class="header">
<td width="50%" height="25"> <div align="center">日期</div></td>
<td height="25"> <div align="center">发布数</div></td>
</tr>
<?php
$dr=explode('-',$date);
$dr[0]=(int)$dr[0];
$dr[1]=(int)$dr[1];
for($j=1;$j<=31;$j++)
{
//检测日期合法性
if(!checkdate($dr[1],$j,$dr[0]))
{
continue;
}
$d=$j;
if($j<10)
{
$d='0'.$j;
}
$thisday=$date.'-'.$d;
//发布数
$totalnum=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_".$tbname." where userid='$userid' and ismember=0 and truetime>=".to_time($thisday." 00:00:00")." and truetime<=".to_time($thisday." 23:59:59"));
?>
<tr bgcolor="#FFFFFF">
<td height="25"><div align="center"><?=$thisday?></div></td>
<td height="25"><div align="center"><?=$totalnum?></div></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
<?php
db_close();
$empire=null;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -