<!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=gb2312'>
<title>管理员帐号--更改帐号</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="bodytitle">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt">系统帐号管理</div>
</div>
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
  <tr>
    <td height="19" bgcolor="#EDF9D5"> 
      <table width="96%" border="0" cellspacing="1" cellpadding="1">
        <tr> 
          <td width="24%"><b><strong>&nbsp;&nbsp;帐号信息统计：</strong></b> </td>
          <td width="76%" align="right"><strong><a href="sys_admin_user.php"><u>管理帐号</u></a></strong></td>
        </tr>
      </table></td>
</tr>
<tr>
    <td align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" class="tblist">
      <tr>
        <td width="16%" height="24">用户登录ID：</td>
        <td width="84%" align="left"><?php echo $row['userid']?></td>
      </tr>
      <tr>
        <td height="24">用户笔名：</td>
        <td align="left"><?php echo $row['uname']?></td>
      </tr>
      <tr>
        <td height="24">真实姓名：</td>
        <td align="left"><?php echo $row['tname']?></td>
      </tr>
      <tr>
        <td height="24">用户类型：</td>
        <td align="left"><?php 
			  	$myrow = $dsql->GetOne(" Select * from #@__admintype where rank='{$row['usertype']}' ");
			  	echo $myrow['typename'];
			 ?>
        </td>
      </tr>
      <tr>
        <td height="24">负责频道：</td>
        <td align="left"><?php
    $typeOptions = "";
    $typeids = Array();
    if($row['typeid']!='')
    {
	     $typeids = explode(',',$row['typeid']);
       $dsql->Execute('op',"Select ID,typename From #@__arctype where reID=0 And (ispart=0 Or ispart=1)");
       while($row1 = $dsql->GetObject('op'))
       {
	        if(in_array($row1->ID,$typeids)){ echo "{$row1->typename}、"; }
          $dsql->Execute('s',"Select ID,typename From #@__arctype where reID={$row1->ID} And (ispart=0 Or ispart=1)");
          while($row2 = $dsql->GetObject('s')){
	            if(in_array($row2->ID,$typeids)){ echo "{$row2->typename}、"; }
	        }
       }
    }else{
    	echo "所有频道";
    }
  ?>
        </td>
      </tr>
    </table></td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6EDA5" style="margin-top:8px;">
  <tr>
    <td height="28" bgcolor="#EDF9D5" class="ct_td"><strong>历史文档统计：</strong></td>
  </tr>
  <tr>
    <td height="28" bgcolor="#FFFFFF" class="ct_td">
<table width="100%" border="0" cellspacing="5" cellpadding="3">
<?php
$adminid = $ID;
$row = '';

//季度、月份起始时间
$ntime = time();
$y = strftime("%Y",$ntime);
$m = strftime("%m",$ntime);
//当年
$ystart = GetMkTime("{$y}-01-01");
//当月
$mstart = GetMkTime("{$y}-{$m}-01");
//当季
$j = floor($m%3)+1;
$ms = ($j * 3) - 2;
if($ms<1) $ms = 1;
$qstart = GetMkTime("{$y}-{$ms}-01");

$dsql->SetQuery("Select ID,maintable,typename From `#@__channeltype` ");
$dsql->Execute('me');
$color = '#F1FAD6';
$j = 0;
while($row = $dsql->GetArray('me',MYSQL_ASSOC))
{
	$j++;
	$color = ($j%2!=0 ? '#F1FAD6' : '#FCFDEE');
	$tcc = $tac = $ycc = $yac = $qcc = $qac = $mcc = $mac = 0;
	$maintable = ($row['maintable']=='' ? $row['maintable'] : '#@__archives');
	$channelid = $row['ID'];
	$dsql->SetQuery("Select click,senddate From `$maintable` where adminid='$adminid' And channel='$channelid' ");
	$dsql->Execute('c');
	$allrow = $dsql->GetTotalRow('c');
	if($allrow<1) continue;
	while($rowc = $dsql->GetArray('c',MYSQL_ASSOC))
	{
		if($rowc['senddate']>$mstart){
			$mac++; $mcc += $rowc['click'];
			$qac++; $qcc += $rowc['click'];
			$yac++; $ycc += $rowc['click'];
		}else if($rowc['senddate']>$qstart){
			$qac++; $qcc += $rowc['click'];
			$yac++; $ycc += $rowc['click'];
		}else if($rowc['senddate']>$ystart){
			$yac++; $ycc += $rowc['click'];
		}
		$tcc += $rowc['click'];
		$tac++;
	}
	$dsql->FreeResult('c');
?>
  <tr style='background-color:<?php echo $color; ?>'>
    <td width="14%" height="42">
    	&nbsp;·<?php echo $row['typename']; ?>
    </td>
    <td width="86%">
    	<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC" align="center">
     <tr align="center" bgcolor='#F4FAE7'>
     	<td width='16%' height="24" bgcolor="#F4FAE7">项目</td>
     	<td width='21%'> 月 </td>
     	<td width='21%'> 季 </td>
     	<td width='21%'> 年 </td>
     	<td> 总 </td>
     </tr>
     <tr align='center' bgcolor='#ffffff'>
     	<td height="24" bgcolor="#ffffff">文档</td>
     	<td><?php echo $mac; ?></td>
     	<td><?php echo $qac; ?></td>
     	<td><?php echo $yac; ?></td>
     	<td><?php echo $tac; ?></td>
     </tr>
     <tr align='center' bgcolor='#ffffff'>
     	<td height="24" bgcolor="#ffffff">点击</td>
     	<td><?php echo $mcc; ?></td>
     	<td><?php echo $qcc; ?></td>
     	<td><?php echo $ycc; ?></td>
     	<td><?php echo $tcc; ?></td>
     </tr>
    </table>
    </td>
  </tr>
<?	
}
?>
</table>
    </td>
  </tr>
</table>
</body>
</html>