<?php
//----------------------------------------------------------------------
//  Stat Therefor 2002 alpha 0110  (所以统计系统 - 正式版 Build 0210 )
//----------------------------------------------------------------------
// Copyright(C) Dai Zhikang, Crossday Studio, 2002. All rights reserved
//
//          所以网络空间  www.crossday.com  www.therefor.net
//----------------------------------------------------------------------
//     免费软件  ALWAYS FREEWARE!  *技术支持 <webmaster@therefor.net>
//----------------------------------------------------------------------
//   欢 迎 您 指 出 存 在 的 b u g 和 问 题 ,  提 出 您 的 宝 贵 意 见
//----------------------------------------------------------------------
// 软件为作者利用数天的休息时间辛勤劳作而写成,请您保护我所保留的很少一点
// 权利, 您在使用本软件时请勿擅自修改页面上作者署名及版权信息,谢谢!谢谢!
//----------------------------------------------------------------------

function login() {

?>
            <table width="460" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td background="../images/graph_border1.gif" height="25" valign="top"> 
                  <b style="font-family: 宋体;line-height: 21px">&nbsp;&nbsp;用户管理登录</b> 
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border2.gif">
                  <table width="460" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="11">&nbsp;</td>
                      <td align="center"> 
                        <form name="login" method="post" action="superadmin.php">
                        <table width="50%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="15" colspan="2"></td>
                          </tr>
                          <tr>
                            <td height="20" align="center" colspan="2">请将浏览器cookie打开才能正确登录</td>
                          </tr>
                          <tr>
                            <td height="10" colspan="2"></td>
                          </tr>
                          <tr> 
                            <td height="20" align="center">用户名</td>
                            <td height="20" align="right"><input type="text" name="user" value="Administrators" class="input" onMouseOver ="this.style.backgroundColor='#F0F1FF'" onMouseOut ="this.style.backgroundColor=''"></td>
                          </tr>
                          <tr> 
                            <td height="20" align="center">密 码</td>
                            <td height="20" align="right"><input type="password" name="password" class="input" onMouseOver ="this.style.backgroundColor='#F0F1FF'" onMouseOut ="this.style.backgroundColor=''"></td>
                          </tr>
                          <tr>
                            <td height="15"></td>
                          </tr>
                          <tr> 
                            <td height="20" align="center" colspan="2">
                              <input type="submit" name="Submit" value="登  录" class="button" onMouseOver ="this.style.backgroundColor='#EEF7FF'" onMouseOut ="this.style.backgroundColor=''">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="Reset" value="清  除" class="button" onMouseOver ="this.style.backgroundColor='#EEF7FF'" onMouseOut ="this.style.backgroundColor=''">
                            </td>
                          </tr>
                        </table>
                        </form>
                      </td>
                      <td width="5"></td>
                      <td width="11" background="../images/graph_border5.gif">&nbsp;</td>
                      <td width="9"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border4.gif" height="10"></td>
              </tr>
            </table>
<?

}

function content1() {

?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="../images/admin.css">
</head>

<body topmargin="0" leftmargin="0" bgcolor="#CDB800" background="../images/bg.gif">
<script language="JavaScript" src="../images/admin.js"></script>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td height="280" width="115">
      <div id="floater" style="position:absolute; width:115px; height:280px; z-index:10; left: 0px; top: 0px">
        <table width="115" height="280" border="0" cellspacing="0" cellpadding="0" background="../images/float_admin.gif">
          <tr>
            <td width="29" height="95"></td>
            <td width="56" height="95"></td>
            <td width="30" height="95"></td>
          </tr>
          <tr>
            <td width="29" height="105"></td>
            <td width="56" height="105" align="center" valign="center">
              <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="center" height="18"><a href="setup.php" target="_blank" onmouseout=dL(this) onmouseover=hL(this) style="text-decoration: none">安装向导</a></td>
                </tr>
                <tr>
                  <td></td>
                </tr>
                <tr>
                  <td align="center" height="18"><a href="superadmin.php?action=restore" onmouseout=dL(this) onmouseover=hL(this) style="text-decoration: none">数据恢复</a></td>
                </tr>
                <tr>
                  <td></td>
                </tr>
                <tr>
                  <td align="center" height="18"><a href="superadmin.php?action=reset" onmouseout=dL(this) onmouseover=hL(this) style="text-decoration: none">数据重置</a></td>
                </tr>
                <tr>
                  <td></td>
                </tr>
                <tr>
                  <td align="center" height="18"><a href="superadmin.php?action=manage" onmouseout=dL(this) onmouseover=hL(this) style="text-decoration: none">用户管理</a></td>
                </tr>
                <tr>
                  <td></td>
                </tr>
                <tr>
                  <td align="center" height="18"><a href="superadmin.php?action=logout" onmouseout=dL(this) onmouseover=hL(this) style="text-decoration: none">退出登录</a></td>
                </tr>
              </table>
            </td>
            <td width="30" height="105"></td>
          </tr>
          <tr>
            <td width="29" height="80"></td>
            <td width="56" height="80"></td>
            <td width="30" height="80"></td>
          </tr>
        </table>
      </div>
    </td>
    <td width="1" background="../images/line.gif"></td>
    <td align="center">
      <table border="0" cellpadding="0" cellspacing="0" width="95%">
        <tr>
          <td width="100%" height="20"></td>
        </tr>
        <tr>
          <td width="100%" height="100%" align="center">
<?

}

function content2() {

?>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<?

}

function showmessage($msg) {

?>
            <table width="460" border="0" cellspacing="0" cellpadding="0">
              <tr>
                 <td background="../images/graph_border1.gif" height="25" valign="top">
                   <b style="font-family: 宋体;line-height: 21px">&nbsp;&nbsp;系 统 消 息</b>
                 </td>
              </tr>
              <tr>
                <td background="../images/graph_border2.gif">
                  <table width="460" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="11">&nbsp;</td>
                      <td align="left" width="30" valign="top"><img src="../images/message.gif" width="30" height="30"></td>
                      <td align="center" valign="middle"><br><?echo$msg;?><br></td>
                      <td width="5"></td>
                      <td width="11" background="../images/graph_border5.gif">&nbsp;</td>
                      <td width="9"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border4.gif" height="10"></td>
              </tr>
            </table>
<?

}

function manage($hd,$items=30){

global $config;

if($config[multiuser])
  $info[0]="<font color=\"#32A1DB\">允许</font>";
else
  $info[0]="<font color=\"#EE0000\">禁止</font>";

$info[1]=0;
$handle=opendir("../$config[data]/");
for($i=0;$i<=2;$i++)
  readdir($handle);
while($user=readdir($handle)) {
  if(!strpos($user,"."))
    $info[1]++;
}

$start=file("../$config[data]/start.dat");
$start=intval($start[0]);
$day=(date("Y")-1)*365+date("z")-$start;
$info[2]=round($info[1]*10/$day)/10;

$info[3]=round($info[1]*(500+100*$config[detail])/1024/10)*10;

?>
            <table width="460" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td background="../images/graph_border1.gif" height="25" valign="top"> 
                  <b style="font-family: 宋体;line-height: 21px">&nbsp;&nbsp;快 捷 方 式</b>                
                </td>
              </tr>
              <tr> 
                <td background="../images/graph_border2.gif"> 
                  <table width="460" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="11">&nbsp;</td>
                      <td align="center">
                        <br>
                        <table border="0" width="80%" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="35%" align="left">当前多用户功能状态</td>
                            <td width="20%" align="center"><?echo$info[0];?></td>
                            <td width="35%" align="center">注册用户总数</td>
                            <td width="10%" align="right"><font color="#32A1DB"><?echo$info[1];?> 个</font></td>
                          </tr>
                          <tr>
                            <td width="35%" align="left">平均每天增加用户</td>
                            <td width="20%" align="center"><font color="#32A1DB"><?echo$info[2];?> 个</font></td>
                            <td width="35%" align="center">占用磁盘空间</td>
                            <td width="10%" align="right"><font color="#32A1DB"><?echo$info[3];?> K</font></td>
                          </tr>
                        </table>
                        <br>
                        <table border="0" width="100%" cellspacing="0" cellpadding="0">
                          <tr>
                            <td>
                              <form method="POST" action="superadmin.php" name="deluser">
                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td align="center">
                                      删除用户
                                      <input type="text" name="user" size="10" class="input" onMouseOver ="this.style.backgroundColor='#F0F1FF'" onMouseOut ="this.style.backgroundColor=''">
                                      <input type="submit" value="执 行" name="Summit1" class="button" onMouseOver ="this.style.backgroundColor='#EEF7FF'" onMouseOut ="this.style.backgroundColor=''">
                                    </td>
                                  </tr>
                                </table>
                                <input type="hidden" name="action" value="manage"><input type="hidden" name="task" value="deluser">
                              </form>
                            </td>
                            <td>
<!--
                              <form method="POST" action="superadmin.php" name="getpasswd">
                                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td align="center">
                                      取得密码
                                      <input type="text" name="user" size="10" class="input" onMouseOver ="this.style.backgroundColor='#F0F1FF'" onMouseOut ="this.style.backgroundColor=''">
                                      <input type="submit" value="执 行" name="Summit2" class="button" onMouseOver ="this.style.backgroundColor='#EEF7FF'" onMouseOut ="this.style.backgroundColor=''">
                                    </td>
                                  </tr>
                                </table>
                                <input type="hidden" name="action" value="manage"><input type="hidden" name="task" value="getpasswd">
                              </form>
-->
                            </td>
                          </tr>
                        </table>
                        <br>
                      </td>
                      <td width="5"></td>
                      <td width="11" background="../images/graph_border5.gif"></td>
                      <td width="9"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border3.gif" height="35" valign="bottom">
                  <b style="font-family: 宋体;line-height: 21px">&nbsp;&nbsp;用户账号管理&nbsp;</b>
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border2.gif">
                  <table width="460" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="11">&nbsp;</td>
                      <td background="../images/tablebg.gif" align="center"> 
                        <form method="POST" action="superadmin.php" name="data_backup">
                          <table width="98%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="20" align="center">用户名</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;&nbsp;起 始&nbsp;&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;&nbsp;名&nbsp;&nbsp;称&nbsp;&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;访问量&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;日 均&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;闲 置&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">&nbsp;操作&nbsp;</td>
                              <td height="20" width="1"></td>
                              <td height="20" align="center">备份</td>
                            </tr>
<?

$count=0;

$handle=opendir("../$config[data]/");
if(!$hd)
  $hd=1;
for($i=0;$i<=$hd;$i++)
  readdir($handle);

while($count<=($items-1) and $user=readdir($handle)) {
  $hd++;
  if(is_dir("../$config[data]/$user")) {
    $count++;
    $dir="../$config[data]/$user";
    @include"$dir/config.inc.php";
    @$start=file("$dir/start.dat");
    $startday=intval($start[0]);
    $start=substr($start[0],-10);
    $name=autocut($config[user_name],18);
    @$click=file("$dir/click.dat");
    $year=trim(substr($click[1],-3))+2000;  //处理上次点击的2位数年份
    $month=trim(substr($click[2],-3));
    $day=trim(substr($click[3],-3));
    $click=intval($click[0]);
    @$avg=round($click/((date("Y")-1)*365+date("z")-$startday));
    if(!$month)
      $unused="<font color=\"#EE0000\" style=\"font-size: 12px\">∞</font>";
    else
      $unused=intval((date("Y")-1)*365+date("z"))-datecount($year,$month,$day-1);

    echo"                            <tr>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\"><a href=\"../index.php?user=$user\" target=\"_blank\" title=\"查看".$user."的流量统计\">$user</a></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\">$start</td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\" style=\"font-size: 12px\"><a href=\"$config[user_base]\" title=\"访问$config[user_name]\" target=\"_blank\">$name</a></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\">$click</a></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\">".$avg."</a></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\" class=\"small\">".$unused." <font style=\"font-size: 12px\">天</font></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\"><a href=\"superadmin.php?action=manage&task=deluser&user=$user\" style=\"color: #EE0000\">删除</a></td>\n";
    echo"                              <td height=\"20\" width=\"1\" bgcolor=\"#F7EF72\"></td>\n";
    echo"                              <td height=\"20\" align=\"center\"><input type=\"checkbox\" name=\"userlist[".$count."]\" value=\"$user\"></td>\n";
    echo"                            </tr>\n";
    }
}

?>
                            <tr>
                              <td colspan="11" align="center">
                                <input type="submit" value="按此备份选定用户数据…若未选定用户则备份管理员数据" name="Summit3" class="button" style="width: 350px" onMouseOver ="this.style.backgroundColor='#EEF7FF'" onMouseOut ="this.style.backgroundColor=''">
                              </td>
                              <td colspan="2" align="center">全选</td>
                              <td colspan="2" align="center">
                                <input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)">
                              </td>
                            </tr>
                            <tr>
                              <td height="10"  colspan="15" align="center"><a href="javascript:history.go(-1)" style="color: #32A1DB">[上一页]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="superadmin.php?action=manage&hd=<?echo$hd;?>" style="color: #32A1DB">[下一页]</a></td>
                            </tr>
                          </table>
                          <input type="hidden" name="action" value="backup">
                        </form>
                      </td>
                      <td width="5"></td>
                      <td width="11" background="../images/graph_border5.gif">&nbsp;</td>
                      <td width="9"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td background="../images/graph_border4.gif" height="10"></td>
              </tr>
            </table>
<?

closedir($handle);

}

function data_backup($user,$data_dir){
$count=0;
if($user) {
  $dir="../".$data_dir."/".$user;
  $username=$user;
}else {
  $dir="../".$data_dir;
  $username="admin";
}

if(is_dir($dir)) {

  $handle=opendir($dir);
  while($file=readdir($handle)) {
    if(is_file($dir."/".$file)) {
      $filelist[$count]=$dir."/".$file;
      $filelist_processed[$count]="{{data}}/".$user."/".$file;
      $count++;
    }
  }
  closedir($handle); 

  $data="";

  for($i=0;$i<$count;$i++) {
    $fp=fopen($filelist[$i],"r");
    $file_content=fread($fp,filesize($filelist[$i]));
    fclose($fp);
    $data=$data.$filelist_processed[$i]."|@:@|".$file_content."|%::%|";
  }

  return $data;

}
}

function autocut($chars,$maxlength){
if(strlen($chars)>=$maxlength) {
  $chars=substr($chars,0,$maxlength-3)."..";
  return $chars;
}else {
  return $chars;
}
}

function datecount($year,$month,$day){
$monthday=array(31,28,31,30,31,30,31,31,30,31,30,31);
if(is_int($year/4))
  $monthday[1]=29;
$result=($year-1)*365;

for($i=0;$i<($month-1);$i++)
  $result+=$monthday[$i];
$result+=$day;

return $result;
}


###########################################################################################

if(file_exists("../config.inc.php"))
  include"../config.inc.php";
else
  die("缺少系统配置文件 config.inc.php，管理程序无法运行！");

if(!$password)
  $password=$HTTP_COOKIE_VARS["st_admin_pwd"];
if($password==$config[passwd])
  setcookie("st_admin_pwd",$password,0);
else {
  content1();
  login();
  content2();
  exit;
}

if($action=="reset") {

  content1();
  $error=0;

  if($confirmed=="yes") {

    $items2init=array("agent","click","day","detail","hour","month","pageview");
    for($i=0;$i<7;$i++) {

      $filename="../$config[data]/$items2init[$i].dat";
      $fp=@fopen($filename,"w");
      if(@!fwrite($fp," "))
        $error++;
      @fclose($fp);

    }

    $fp=@fopen("../$config[data]/start.dat","w");
    if(@!fwrite($fp,((date("Y")-1)*365+date("z")-1).".date ".date("Y-m-d")))
      $error++;
    @fclose($fp);
    
    if(!$error)
      showmessage("恭喜您！数据重置成功，统计将从今天重新开始。<br>");
    else
      showmessage($error." 个数据文件写入失败，数据无法重置。<br>请运行安装向导以检查存在的问题。<br><br><a href=\"setup.php\" target=\"_blank\">我要进入安装向导</a><br>");

  }else {

    showmessage("重置数据将使统计重新开始，原有数据将被清除！<br>此操作不可恢复。您确定要这样吗？<br><br><a href=\"superadmin.php?action=reset&confirmed=yes\" style=\"color: #EE0000\">我知道了，我要重置数据</a><br><a href=\"javascript:history.go(-1);\">我按错了，返回上一页</a><br>");
    content2();

  }

}elseif($action=="manage") {

  content1();
  if($task=="deluser") {

    if($confirmed=="yes") {

      if(is_dir("../$config[data]/$user")) {
      	$files2del=array("agent.dat","click.dat","day.dat","detail.dat","hour.dat","month.dat","pageview.dat","start.dat","config.inc.php");
      	for($i=0;$i<count($files2del);$i++)
     	  @unlink("../$config[data]/$user/".$files2del[$i]);
      	if(@!rmdir("../$config[data]/$user")) {
      	  showmessage("文件/目录读写错误，删除用户不成功！<br><br><a href=\"javascript:history.go(-2);\">返回上页</a><br>");
      	  content2();
      	  exit;
      	}
      }else {
        showmessage("用户名不存在，请检查后重试！<br><br><a href=\"javascript:history.go(-2);\">返回上页</a><br>");
        content2();
        exit;
      }

    }elseif(ereg("^[a-z0-9]+$",$user)) {

      showmessage("删除用户 <b>".$user."</b> 的账号，将导致该用户所有数据被清除！<br>此操作不可恢复。您确定要这样吗？<br><br><a href=\"superadmin.php?action=manage&task=deluser&user=$user&confirmed=yes\" style=\"color: #EE0000\">我知道了，我要删除该用户</a><br><a href=\"javascript:history.go(-1);\">我按错了，返回上一页</a><br>");
      content2();
      exit;

    }

  }elseif($task=="getpasswd") {

    if(@!include"../$config[data]/$user/config.inc.php")
      showmessage("读取用户配置文件错误，无法取得密码。<br><br><a href=\"javascript:history.go(-1);\">返回上页</a><br>");
    else
      showmessage("用户 <b>".$user."</b> 的密码为 <b>".$config[user_passwd]."</b>。<br><br><a href=\"javascript:history.go(-1);\">返回上页</a><br>");    
    content2();
    exit;

  }

  manage($hd);
  content2();
  
}elseif($action=="backup") {

  $filewrite=data_backup("",$config[data]);
  for($i=1;$i<=30;$i++) {
    if($userlist[$i])
      $filewrite=$filewrite.data_backup($userlist[$i],$config[data]);
  }
  
  header("Content-type: application/std");
  header("Content-Disposition: attachment; filename=".date(ymdHis).".std");
  header("Content-Description: ST_Data_Backup");

  echo$filewrite;

}elseif($action=="restore") {

  content1();
  
  if($file) {

    $fp=fopen($file,"r");
    $data=fread($fp,filesize($file));
    fclose($fp);
    $data=ereg_replace("\{\{data\}\}","../".$config[data],$data);
    $file=explode("|%::%|",$data);
    for($i=0;$i<(count($file)-1);$i++) {
      $file_detail=explode("|@:@|",$file[$i]);
      $dir=ereg_replace("(.+)\/(.+)\/(.*)\/(.+)$","\\1/\\2/\\3",$file_detail[0]);
      if(!is_dir($dir))
        @mkdir($dir,0777);
      $fp=@fopen($file_detail[0],"w");
      @flock($fp,3);
      if(@!fwrite($fp,$file_detail[1]))
        $error="数据恢复中途出错，请检查相应目录是否可写。";
      @fclose($fp);

    }

    if($error)
      showmessage($error."<br>");
    else
      showmessage("恭喜您，数据恢复成功！<br>");

  }else {

    $message="<b>注意：</b>本功能可将由“用户管理”中备份得到的.std文件<br>恢复至服务器。该文件所包含相关用户的数据将被覆盖，<br>即相关用户在备份时间之后的统计数据将会丢失。请谨慎<br>使用！同时强烈建议您在使用本功能之前运行安装向导以<br>检查数据目录是否都可正确写入，以确保数据恢复成功。<br>\n";
    $message=$message."                        <form name=\"Backup\" method=\"post\" action=\"superadmin.php\" enctype=\"multipart/form-data\">\n";
    $message=$message."                          文件名\n";
    $message=$message."                          <input type=\"file\" name=\"file\" class=\"input\" onMouseOver =\"this.style.backgroundColor='#EEF7FF'\" onMouseOut =\"this.style.backgroundColor=''\">\n";
    $message=$message."                          <input type=\"submit\" name=\"Submit\" value=\"提交\" class=\"button\" onMouseOver =\"this.style.backgroundColor='#EEF7FF'\" onMouseOut =\"this.style.backgroundColor=''\">\n";
    $message=$message."                          <input type=\"hidden\" name=\"action\" value=\"restore\">\n";
    $message=$message."                        </form>\n                      ";

    showmessage($message);

  }

}elseif($action=="logout") {

  if($password==$config[passwd])
    setcookie("st_admin_pwd");
  content1();
  showmessage("您已退出登录状态！<br>感谢您使用Stat Therefor 2002。<br><br><a href=\"superadmin.php\">重新登录</a><br>");
  content2();

}else {

  content1();
  showmessage("您已成功登录，请点击左侧菜单以执行相应操作。<br>");
  content2();

}


?>