<?php
define('EmpireCMSAdmin','1');
define('EmpireCMSAPage','login');
define('EmpireCMSNFPage','1');
require("../class/connect.php");
require("../class/functions.php");
//风格
$loginadminstyleid=EcmsReturnAdminStyle();
//变量处理
$empirecmskey1='';
$empirecmskey2='';
$empirecmskey3='';
$empirecmskey4='';
$empirecmskey5='';
if($_POST['empirecmskey1']&&$_POST['empirecmskey2']&&$_POST['empirecmskey3']&&$_POST['empirecmskey4']&&$_POST['empirecmskey5'])
{
	$empirecmskey1=RepPostVar($_POST['empirecmskey1']);
	$empirecmskey2=RepPostVar($_POST['empirecmskey2']);
	$empirecmskey3=RepPostVar($_POST['empirecmskey3']);
	$empirecmskey4=RepPostVar($_POST['empirecmskey4']);
	$empirecmskey5=RepPostVar($_POST['empirecmskey5']);
	$ecertkeyrndstr=$empirecmskey1.'#!#'.$empirecmskey2.'#!#'.$empirecmskey3.'#!#'.$empirecmskey4.'#!#'.$empirecmskey5;
	esetcookie('ecertkeyrnds',$ecertkeyrndstr,0);
}
elseif(getcvar('ecertkeyrnds'))
{
	$certr=explode('#!#',getcvar('ecertkeyrnds'));
	$empirecmskey1=RepPostVar($certr[0]);
	$empirecmskey2=RepPostVar($certr[1]);
	$empirecmskey3=RepPostVar($certr[2]);
	$empirecmskey4=RepPostVar($certr[3]);
	$empirecmskey5=RepPostVar($certr[4]);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>帝国小说管理系统 EBook</title>

<style type="text/css">

body {color:#000000; text-align: left; font-family:"\5B8B\4F53", Arial;font-size:12px; background:#3a6ea5;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,blockquote,p,a,span,table,tr,td,tbody{padding:0; margin:0;}   
table,td,tr,th{font-size:12px;}
li{list-style-type:none;}
table{margin:0 auto;}
img{vertical-align:middle;border:0;}
ol,ul{list-style:none;}   
caption,th{text-align:left;}   
h1,h2,h3,h4,h5,h6{font-size:12px; font-weight:normal;}
a{color: #07519A;text-decoration: none;}
a:hover{color: #c30;text-decoration: underline;}
.clear{clear:both; height:0; line-height:0; font-size:0; overflow:hidden;}



.main{width:380px; position:absolute; left:50%; top:50%; margin-left: -201px; margin-top: -208px}

.tb{height:13px; line-height:13px; width:380px; background:url(loginimg/bs.gif) no-repeat;}
.fb{height:13px; line-height:13px; width:380px; background:url(loginimg/bx.gif) no-repeat;}
.zm{width:380px; background:url(loginimg/bz.gif) repeat-y;}

.right{width:380px; padding:0 0 20px 50px;}
.right img{padding:20px 0 20px 0;}

input	{ font: 10pt Tahoma, Verdana; }
.sle {
	FONT-SIZE: 10pt;
	width:173px;
	padding:2px 5px;
}

.b-form2 {
	font-size:10pt;
	color: #444444;
	padding:2px 5px;
	text-decoration: none;
	background-color: #FFFFFF;
	border: 1px solid #cccccc;
	background-attachment: fixed;
	background-repeat: no-repeat;

}
</style>
<base onmouseover="window.status='帝国网站管理系统(EmpireCMS) － 最安全、最稳定的开源CMS系统';return true">
<script>
if(self!=top)
{
	parent.location.href='index.php';
}
function CheckLogin(obj){
	if(obj.username.value=='')
	{
		alert('请输入用户名');
		obj.username.focus();
		return false;
	}
	if(obj.password.value=='')
	{
		alert('请输入登录密码');
		obj.password.focus();
		return false;
	}
	if(obj.loginauth!=null)
	{
		if(obj.loginauth.value=='')
		{
			alert('请输入认证码');
			obj.loginauth.focus();
			return false;
		}
	}
	if(obj.key!=null)
	{
		if(obj.key.value=='')
		{
			alert('请输入验证码');
			obj.key.focus();
			return false;
		}
	}
	return true;
}
</script>
</head>





<body text="383636" bgcolor="#FFFFFF" onload="document.login.username.focus();">







<div class="main">
  <div class="tb"></div>
  <div class="zm">
	<div class="right">
	  <img src="loginimg/guanli.gif" width="210" height="23" border="0" alt="">

	  <form name="login" id="login" method="post" action="ecmsadmin.php" onsubmit="return CheckLogin(document.login);">
	    <input type="hidden" name="enews" value="login">
		<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="50" height="35">用户名: </td>
            <td colspan="2"> <input name="username" type="text" class="b-form2" size="24"> 
            </td>
          </tr>
          <tr> 
            <td height="35">密&nbsp;&nbsp;码:&nbsp;</td>
            <td colspan="2"> <input name="password" type="password" class="b-form2" size="24"> 
            </td>
          </tr>
		  <?php
		  if($ecms_config['esafe']['loginauth'])
		  {
		  ?>
          <tr> 
            <td height="35">认证码:&nbsp;</td>
            <td colspan="2"><input name="loginauth" type="password" id="loginauth" class="b-form2" size="24"></td>
          </tr>
          <?php
		  }
		  ?>
          <tr>
            <td height="35">提&nbsp;&nbsp;问:&nbsp;</td>
            <td colspan="2"><select name="equestion" class="sle" id="equestion" onchange="if(this.options[this.selectedIndex].value==0){showanswer.style.display='none';}else{showanswer.style.display='';}">
                <option value="0">无安全提问</option>
                <option value="1">母亲的名字</option>
                <option value="2">爷爷的名字</option>
                <option value="3">父亲出生的城市</option>
                <option value="4">您其中一位老师的名字</option>
                <option value="5">您个人计算机的型号</option>
                <option value="6">您最喜欢的餐馆名称</option>
                <option value="7">驾驶执照的最后四位数字</option>
              </select></td>
          </tr>
          <tr id="showanswer">
            <td height="35">答&nbsp;&nbsp;案:&nbsp;</td>
            <td colspan="2"><input name="eanswer" type="text" id="eanswer" class="b-form2" size="24"></td>
          </tr>
          <?php
		  if(empty($public_r['adminloginkey']))
		  {
		  ?>
          <tr> 
            <td height="35">验证码:&nbsp;</td>
            <td width="83"> <input name="key" type="text" class="b-form2" size="9"> 
            </td>
            <td width="97"><img src="ShowKey.php" name="KeyImg" id="KeyImg" align="bottom" onclick="KeyImg.src='ShowKey.php?'+Math.random()" alt="看不清楚,点击刷新"></td>
          </tr>
          <?php
		  }
		  ?>
		  <tr> 
            <td height="20">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr> 
            <td height="35">&nbsp;</td>
            <td colspan="2" valign="bottom"> <input name="imageField" type="image" src="loginimg/login_bt.gif" width="100" height="35" border="0"> 
            </td>
          </tr>
        </table>

			  <input name="empirecmskey1" type="hidden" id="empirecmskey1" value="<?php echo $empirecmskey1;?>">
              <input name="empirecmskey2" type="hidden" id="empirecmskey2" value="<?php echo $empirecmskey2;?>">
              <input name="empirecmskey3" type="hidden" id="empirecmskey3" value="<?php echo $empirecmskey3;?>">
              <input name="empirecmskey4" type="hidden" id="empirecmskey4" value="<?php echo $empirecmskey4;?>">
              <input name="empirecmskey5" type="hidden" id="empirecmskey5" value="<?php echo $empirecmskey5;?>">
	  
	  </form>
	</div>
  </div>
  <div class="fb"></div>
</div>


<script>
if(document.login.equestion.value==0)
{
	showanswer.style.display='none';
}
</script>
</body>
</html>