<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../class/dpfun.php");
require("../member/class/user.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$lur=is_login();
$logininid=(int)$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=(int)$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
IsLegalDomain();
//我的状态
$user_r=$empire->fetch1("select pretime,preip,loginnum from {$dbtbpre}enewsuser where userid='$logininid'");
$gr=$empire->fetch1("select groupname from {$dbtbpre}enewsgroup where groupid='$loginlevel'");
//管理员统计
$adminnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsuser");
$date=date("Y-m-d");
$noplnum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewspl_".$public_r['pldeftb']." where checked=1");
//未审核会员
$nomembernum=$empire->gettotal("select count(*) as total from ".eReturnMemberTable()." where ".egetmf('checked')."=0");
//信息数量统计
$bnum=TbDataNum('bookname');
$nnum=TbDataNum('news');
$bdnum=BDNum();
//软件信息
$ebook=EBOOK();

//系统信息
	if(function_exists('ini_get')){
        $onoff = ini_get('register_globals');
    } else {
        $onoff = get_cfg_var('register_globals');
    }
    if($onoff){
        $onoff="打开";
    }else{
        $onoff="关闭";
    }
    if(function_exists('ini_get')){
        $upload = ini_get('file_uploads');
    } else {
        $upload = get_cfg_var('file_uploads');
    }
    if ($upload){
        $upload="可以";
    }else{
        $upload="不可以";
    }
	if(function_exists('ini_get')){
        $uploadsize = ini_get('upload_max_filesize');
    } else {
        $uploadsize = get_cfg_var('upload_max_filesize');
    }
	if(function_exists('ini_get')){
        $uploadpostsize = ini_get('post_max_size');
    } else {
        $uploadpostsize = get_cfg_var('post_max_size');
    }
//开启
$register_ok="开启";
if($public_r[register_ok])
{$register_ok="关闭";}
$addnews_ok="开启";
if($public_r[addnews_ok])
{$addnews_ok="关闭";}
//版本
@include("../class/EmpireCMS_version.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>帝国小说管理系统</title>
<link href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><div align="center"><strong> 
        <h3>欢迎使用帝国小说管理系统 (EmpireBook)</h3>
        </strong></div></td>
  </tr>
  <tr> 
    <td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="25">我的状态</td>
        </tr>
        <tr> 
          <td height="25" bgcolor="#FFFFFF"> <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="22">登录者:&nbsp;<b>
                  <?=$loginin?>
                  </b>&nbsp;&nbsp;,所属用户组:&nbsp;<b>
                  <?=$gr[groupname]?>
                  </b></td>
              </tr>
              <tr>
                <td height="22">这是您第 <b>
                  <?=$user_r[loginnum]?>
                  </b> 次登录，上次登录时间：
                  <?=$user_r[pretime]?date('Y-m-d H:i:s',$user_r[pretime]):'---'?>
                  ，登录IP：
                  <?=$user_r[preip]?$user_r[preip]:'---'?>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td  height="25" colspan=2><a href="#"><strong>系统信息</strong></a></td>
        </tr>
        <tr> 
          <td width="50%"><strong>网站信息</strong></td>
          <td width="50%"><strong>服务器信息</strong></td>
        </tr>
        <tr> 
          <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
              <tr> 
                <td height="23">管理员个数:</td>
                <td><a href="user/ListUser.php"><?=$adminnum?></a> 人</td>
              </tr>
              <tr> 
                <td height="23">登陆者IP:</td>
                <td><? echo egetip();?></td>
              </tr>
              <tr> 
                <td height="23">程序版本:</td>
                <td> <a href="http://dp1037.com" target="_blank"><strong>EmpireBook 
                  v<?=$ebook[ver]?> <?=$ebook[free]?></strong></a> <?=$ebook[time]?></td>
              </tr>
			  <tr> 
                <td height="23">书籍数量:</td>
                <td> 已审核 <b><?=$bnum[ok]?></b> 本，未审核 <b><?=$bnum[no]?></b> 本</td>
              </tr>
              <tr>
                <td height="23">章节数量:</td>
                <td> 已审核 <b><?=$bdnum[ok]?></b> 章，未审核 <b><?=$bdnum[no]?></b> 章</td>
              </tr>
			  <tr>
                <td height="23">文章数量:</td>
                <td> 已审核文章 <b><?=$nnum[ok]?></b> 篇，未审核文章 <b><?=$nnum[no]?></b> 篇</td>
              </tr>
            </table></td>
          <td valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="1" cellpadding="3">
              <tr> 
                <td width="25%" height="23">服务器软件:</td>
                <td width="75%"> 
                  <?=$_SERVER['SERVER_SOFTWARE']?>
                </td>
              </tr>
              <tr> 
                <td height="23">操作系统:</td>
                <td><? echo defined('PHP_OS')?PHP_OS:'未知';?></td>
              </tr>
              <tr> 
                <td height="23">PHP版本:</td>
                <td><? echo @phpversion();?></td>
              </tr>
              <tr> 
                <td height="23">MYSQL版本:</td>
                <td><? echo @mysql_get_server_info();?></td>
              </tr>
              <tr> 
                <td height="23">上传文件:</td>
                <td> 
                  <?=$upload?>
                  <font color="#666666">(最大文件：<?=$uploadsize?>，表单：<?=$uploadpostsize?>)</font> </td>
              </tr>
              <tr> 
                <td height="23">当前时间:</td>
                <td><? echo date("Y-m-d H:i:s");?></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
        <tr class="header"> 
          <td height="25" colspan="2">官方信息</td>
        </tr>
        <tr> 
          <td width="43%" bgcolor="#FFFFFF"> 
            <table width="100%" border="0" cellpadding="3" cellspacing="1">
              <tr bgcolor="#FFFFFF"> 
                <td width="28%" height="25">帝国官方主页</td>
                <td width="72%" height="25"><a href="http://dp1037.com/" target="_blank">http://dp1037.com/</a></td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td height="25">帝国官方论坛</td>
                <td height="25"><a href="http://bbs.dp1037.com" target="_blank">http://bbs.dp1037.com</a></td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td height="25">帝国产品中心</td>
                <td height="25"><a href="http://dp1037.com/products/" target="_blank">http://dp1037.com/products/</a></td>
              </tr>
            </table>
          </td>
          <td width="57%" height="100" valign="top" bgcolor="#FFFFFF"> 
            <IFRAME frameBorder="0" name="getinfo" scrolling="no" src="ginfo.php" style="HEIGHT:100%;VISIBILITY:inherit;WIDTH:100%;Z-INDEX:2"></IFRAME></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<?php
db_close();
$empire=null;
?>