MoreUserTotal.php
4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//驗證權限
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>";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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">
<?=$ecms_hashur['eform']?>
<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?><?=$ecms_hashur['ehref']?>"><?=$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="40%" height="25">
<div align="center">日期</div></td>
<td width="30%" height="25">
<div align="center">發佈數</div></td>
<td width="30%">
<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"));
//未審核數
$totalchecknum=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_".$tbname."_check 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+$totalchecknum)?>
</div></td>
<td><div align="center"><?=$totalchecknum?></div></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
<?php
db_close();
$empire=null;
?>