<?
/**
 * @version		1.0
 * @package		HonoWeb->HonoBBS
 * @copyright	Copyright (C) HonoWeb. All rights reserved.
 * @Website		www.honoweb.com.您好
 */
 ?>
<script language="javascript" src="<?=$BBSFolder?>/js/ajax.js"></script>
 <script language="javascript">
                function send_request_post_checkuser(url,querystring,func) {
                    create_request();
                    if(func=='login') http_request.onreadystatechange = processLogin;
                    if(func=='forgetPassword') http_request.onreadystatechange = processForgetPassword;
                    
                    http_request.open("POST", url, true);
                    http_request.setRequestHeader("Content-Type"," application/x-www-form-urlencoded"); 
                    http_request.send(querystring);
                }
                
            
                function processLogin() {
                        var form=document.getElementById("form1");
                        if (http_request.readyState == 4) { 
                            if (http_request.status == 200) { 
                        
                                if(http_request.responseText==1)
                                {
                                    
                                    top.location=location.href;
                                    
                                }
                                if(http_request.responseText==2)
                                {
                                    alert('Enter username or password error! ');
                                }
                                
                               
                            } else { //页面不正常
                                alert("error");
                            }
                        }
                    }
                
                function checkLogin() {
                    var form=document.getElementById("form1");
                   if(form.username.value=="")
                    {
                        alert("请输入用户名!");
                        form.username.focus();
                        return;
                    }
                    if(form.psw.value=="")
                    {
                        alert("请输入密码!");
                        form.psw.focus();
                        return;
                    }
                    querystring="username="+form.username.value+"&psw="+form.psw.value;
                     send_request_post_checkuser('<?=$BBSFolder?>/ajax/login.php',querystring,"login");
                }
                
            </script>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="centertable">
  <tr>
    <td height="20" align="center"  class="font1"><font class="font1_b">论坛信息统计</font>(<?=date('Y-n-j H:i:s')?>)</td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="2" class="bar" style="padding-left:10px;color:#FFF2B1;font-weight:bold;font-size:12px; ">&nbsp;</td>
      </tr>
      <tr>
        <td width="50%" height="120" align="center" class="lefttd"><table width="70%"  border="0" cellpadding="0" cellspacing="0" class="font1">
          <tr>
            <td height="20"> 成员数： 
			<font class="font1_b"><?
			$sql="select count(1) as num from  ".$TableUser;
			$row=$db->getRow($sql);
			echo $row['num'];
			?></font>
人			</td>
            <td> 最新成员：[
              <font class="font1_b"><?
			$sql="select username from  ".$TableUser." order by regtime desc limit 1";
			$row=$db->getRow($sql);
			echo $row['username'];
			?> </font>
 ] </td>
            </tr>
          <tr>
            <td height="20" colspan="2"><hr class="line_hr" size="1"></td>
            </tr>
          <tr>
            <td height="20"> 近日发帖： 
			<font class="font1_b"><?
			$sql="select count(1) as num from  ".$TableBbs_content." where TO_DAYS(publictime)=TO_DAYS('".date('Y-n-j H:i:s')."')";
			$row=$db->getRow($sql);
			echo $row['num'];
			?> </font></td>
            <td> 帖子总数： 
			<font class="font1_b"><?
			$sql="select count(1) as num from  ".$TableBbs_content;
			$row=$db->getRow($sql);
			echo $row['num'];
			?> </font></td>
            </tr>
          <tr>
            <td height="20"> 昨日发帖： 
			<font class="font1_b"><?
			$sql="select count(1) as num from  ".$TableBbs_content." where TO_DAYS(publictime)=TO_DAYS('".date('Y-n-j H:i:s')."')-1";
			$row=$db->getRow($sql);
			echo $row['num'];
			?> </font></td>
            <td> 回复总数： 
			<font class="font1_b"><?
			$sql="select count(1) as num from  ".$TableBbs_answer;
			$row=$db->getRow($sql);
			echo $row['num'];
			?> </font></td>
            </tr>
        </table></td>
        <td align="center" class="righttd" style="font-size:12px;">
		<?
		if(!isLogin())
		{
		?>
		<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="font1">
          <tr>
            <td>&nbsp;</td>
            <td height="20" colspan="3">
			<?
			
			if(isLogin())
			{
				echo "Welcome: <font class='font1_b'>".$_SESSION['SessionUser']['username']."</font> Enter <font class='font1_b'>".$bbs_config_Name."</font>";
			}
			
			?>
			</td>
            <td align="center">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td width="160" height="20"> 用户名： 
              <input name="username" type="text" id="username" style="width:93px; "></td><!--
            <td width="120" align="center">验证码：
              <input name="identify" type="text" id="identify" style="width:45px; "></td>
            <td width="50" align="center"><?  $_SESSION['identify'] = mt_rand(1000, 9999);?>
              <img src="include/antispam/index.php" ></td>-->
            <td align="center">&nbsp; </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="20"> 密　码： 
              <input name="psw" type="password" id="psw" style="width:93px; "></td>
            <td align="center"><input name="Submit2" type="button" class="button" value="登陆" onClick="checkLogin()"></td>
            <td align="center">&nbsp;</td>
            <td align="center">&nbsp;</td>
          </tr>
        </table>
		<?
		}else{
			echo "欢迎 <font class='font1_b'>".$_SESSION['SessionUser']['username']."</font> 进入 <font class='font1_b'>".$bbs_config_Name."</font>";
		}
		?>
		 </td>
      </tr>
    </table></td>
  </tr>
</table>
  <input type="hidden" name="loginstatus" >