<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	$opendb = new mydb();
	require_once('inc/char_set.php');
	$config_sql="select * from ls_config";
	
	$config_query=$opendb->query($config_sql);
	//var_dump($opendb);
	$config_rows=mysql_fetch_assoc($config_query);
	
	if(!isset($_SESSION['retryTimes']))
	{$_SESSION['retryTimes']=1;}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $engineName?></title>
<link type="text/css" rel="stylesheet" href="css/admin2.css" />
<script type="text/JavaScript">
function CheckBrowser() 
{
  var app=navigator.appName;
  var verStr=navigator.appVersion;
  if (app.indexOf('Netscape') != -1) {
	alert(" 你使用的是Netscape浏览器，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。");
  } 
  else if (app.indexOf('Microsoft') != -1) {
	if (verStr.indexOf("MSIE 3.0")!=-1 || verStr.indexOf("MSIE 4.0") != -1 || verStr.indexOf("MSIE 5.0") != -1 || verStr.indexOf("MSIE 5.1") != -1)
	  alert("   您的浏览器版本太低，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。");
  }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { nm=val.name; if ((val=val.value)!="") {
	  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
		if (p<1 || p==(val.length-1)) errors+='- '+nm+' 必须是邮箱地址.\n';
	  } else if (test!='R') { num = parseFloat(val);
		if (isNaN(val)) errors+='- '+nm+' 必须包含数字.\n';
		if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
		  min=test.substring(8,p); max=test.substring(p+1);
		  if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
	} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' 不能为空：\n'; }
  } if (errors) alert('请更正下列错误:\n'+errors);
  document.MM_returnValue = (errors == '');
}
</script>
</head>
<body onload="document.getElementById('username').focus()">
<div class="container">
  <div class="top">
  <?php 
  if($config_rows['company_logo']!='' && file_exists("company_logo/".$config_rows['company_logo'])){
  	echo "<img src='company_logo/".$config_rows['company_logo']."' height='60' /> ".$config_rows['companyNameCn'];
  }else{
	  echo $config_rows['companyNameCn'];
  }
  ?>
  </div>
  <div class="beijing">
    <div class="zb">
      <div class="db">
        <div id="feedback_form" class="formSpna">
          <form action="Checklogin.php" method="post" name="form1" onsubmit="return check(this);">
            <ul class="m_form fl" id="leavewordform">
              <li>
                <label><img src="login-img/ht_06.png" /></label>
                <input class="iptTxt" type="text" id="username" name="username" value="<?=$username?>" placeholder="用户名" />
                </li>
              <li>
                <label><img src="login-img/ht_07.png" /></label>
                <input class="iptTxt" type="password" id="txtname" name="password" size="24" maxlength="20" value=""  placeholder="密码" />
                <a name="gobottom">&nbsp;</a></li>
                <? 	if($_SESSION['retryTimes']>$codeRetryTimes)   //超过规定次数进行验证码验证
				{
			?>	
              <li>
                <label><img src="login-img/ht_10.png" /></label>
                <input class="iptTxt1" type="text" id="txtname" name="code" size="10" style=" color:#999" value="" placeholder="不区分大小写">
                <span><a href=""><img src="inc/code.php" border="0" valign="bottom"></a></span>
                </li>
              <li>
              <? }?>
                <input class="btnSubmit" type="submit" value="登陆后台" />
              </li>
            </ul>
          </form>
          <div class="wjmm"><a href="forgetpassword.php">忘记密码</a></div>
        </div>
      </div>
    </div>
  </div>
  <div class="footer">
    <div class="foot">
      <div class="biao"> <span><a href="http://www.lanscend.com" target="_blank">蓝信科技</a> | 用心提供全方位互联网服务</span> </div>
      <div class="dizhi">
        <p>网址：<a href="">www.lanscend.com</a> <a href="">www.lanscend.net</a> <a href="">www.lanscend.cn</a><br />
          电话 / 传真：0311-87085738， 87082120   邮箱：<a href="">support@lanscend.com</a></p>
      </div>
    </div>
  </div>
</div>
</body>
</html>
