<?php
require_once("../global/checkuser2.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站设置</title>
<link rel="stylesheet" href="index.css" />
</head>

<body>
<div class="bigdiv">
<table cellspacing="0" cellpadding="0" style="font-size:14px;"><tr><td style="text-align:left;border-left:none;">您的位置：<a href="index.php">工作任务统计</a></td><td style="text-align:right;border-left:none;"><a href="index.php?prev=1">昨天</a>&nbsp;&nbsp;&nbsp;<a href="index.php">今天</a>&nbsp;&nbsp;&nbsp;<a href="index.php?prev=2">一周</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr></table>
<div style="float:left;width:100%;border-bottom:2px solid #337abb;height:25px;font-size:14px;line-height:25px;"><ul>
<li style="float:left;width:100px;text-align:center;border:2px solid #337abb;border-top:1px solid #337abb;border-bottom:none;background:#337abb;margin-left:20px;display:inline;"><a href="index.php" style="color:#FFF;">工作任务统计</a></li>
</ul></div>
<div class="list">
<table cellspacing="0" cellpadding="0"><tr style="background:#d3edf9;"><td style="border-left:none;">执行者</td><td style="border-left:1px solid #000000;">主站</td><td style="border-left:1px solid #000000;border-right:1px solid #000000;">博客注册</td>
<?php
require_once("../global/connect.php");
$sql=mysql_query("select * from linktype limit 0 , 10");
$types="";
$xnum="";
$xsum=0;
while($row=mysql_fetch_array($sql)){
echo "<td>".$row["name"]."</td>";
$types .=$row["name"].",";
}
$typesar=explode(",",$types);
?>
<td style='border-left:1px solid #000000;'>外链总数</td></tr>
<?php
$date=date("Y-m-d");
if(isset($_GET["prev"])){
if($_GET["prev"]==1)
$date=date("Y-m-d",strtotime("-1 day"));
if($_GET["prev"]==2)
$date=date("Y-m-d",strtotime("-7 day"));
}
$sql=mysql_query("select * from user");
while($row=mysql_fetch_array($sql)){
$user=$row["name"];
$sql1="select * from content where user='$user' and adddate ='$date'";
$sql3="select * from blog where user='$user' and adddate ='$date'";
if(isset($_GET["prev"])){
if($_GET["prev"]==2)
$sql1="select * from content where user='$user' and adddate >='$date'";
$sql3="select * from blog where user='$user' and adddate >='$date'";
}
$zhuzhan=mysql_num_rows(mysql_query($sql1));
if(mysql_query($sql3)){
$blog=mysql_num_rows(mysql_query($sql3));
}
foreach($typesar as $a=>$b){
if($b!=""){
$sql2="select * from weblink where linktype='$b' and user='$user' and adddate ='$date'";
if(isset($_GET["prev"])){
if($_GET["prev"]==2)
$sql2="select * from weblink where linktype='$b' and user='$user' and adddate >='$date'";
}
$xnum .= mysql_num_rows(mysql_query($sql2)).",";
$xsum +=mysql_num_rows(mysql_query($sql2));
}
}
$xnumar=explode(",",$xnum);
echo "<tr><td style=\"border-left:none\">".$user."</td><td style='border-left:1px solid #000000;color:red;'>".$zhuzhan."</td><td style='border-left:1px solid #000000;border-right:1px solid #000000;color:green;'>".$blog."</td>";
foreach($xnumar as $c=>$d){
if($d!="")
echo "<td>".$d."</td>";
}
echo "<td style='border-left:1px solid #000000;color:green;'>".$xsum."</td></tr>";
$xnum="";
$xsum="";
}
?>
</table>
</div>
</div>
</body>
</html>
