<%@ page language="java"  pageEncoding="UTF-8"%>
<%@page import="com.sysadmin.dao.hibernate.SystemDAO"%>
<%@page import="com.sysadmin.domain.System"%>
<%@page import="com.stfoa.dao.hibernate.CompanyDAO"%>
<%@page import="com.stfoa.common.util.SysConfUtil"%>
<%@page import="com.stfoa.common.util.WebUtil"%>
<%@include file="/include/taglibs.jsp"%>
<html>
<head>
<%
SystemDAO sysdao = new SystemDAO();
System sys =  sysdao.findById(4);
%>
<title><%=ValidateUtil.isNull(sys.getSystemTitle())?"协同管理-人力资源管理系统":sys.getSystemTitle()%></title>
<link href="<%=request.getContextPath()%>/css/login.css" rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath()%>/css/click.css" rel="stylesheet" type="text/css">
<%@include file="/include/jquery.jsp"%>
<script>
<!--
function loginsubmit(){
 document.forms[0].submit();
}
//-->
</script>
<%
String LoginId =  request.getParameter("LoginId");
String logintype = request.getParameter("logintype");
if(LoginId==null){
 LoginId = (String)request.getAttribute("LoginId");
 if(LoginId==null){
  LoginId = "";
 }
}
if(logintype==null){
   logintype = (String)request.getAttribute("logintype");
 if(logintype==null){
   logintype = "";
 }
}
 %>
<logic:present name="validuser" scope="request">
   <SCRIPT type="text/javascript">
      alert('<%=(String)request.getAttribute("validuser")%>');
   </SCRIPT>
 </logic:present>  
</head>
<script language="javascript" event="onkeydown" for="document">  
if(event.keyCode==13)  
{  
  document.all('button_submit').click();  
} 
</script>  
<style type="text/css">
 .maindiv{
  width:60%;border:1px solid #000000;top:15%;left:20%;right:20%; position:absolute;padding:10px;
 }
 .maindiv800{
  width:80%;border:1px solid #000000;top:2%;left:10%;right:10%; position:absolute;padding:10px;
 }
</style>
<script type="text/javascript">
$(document).ready(function(){
 if(window.screen.width<1000){
  document.all.div_main.className='maindiv800';
 }
});
</script>
<script type="text/javascript">
function login(){
 $('#button_submit').attr("disabled", true); 
 if(!$.browser.msie){
	alert('请使用IE浏览器登录本系统！');
	 $('#button_submit').attr("disabled", false); 
	return;
 }	
 if(loginform.LoginId.value==''){
  alert('请输入登录名！');
  $('#button_submit').attr("disabled", false); 
  loginform.LoginId.focus();
  return;
 }
 if(loginform.Password.value==''){
  alert('请输入密码！');
  $('#button_submit').attr("disabled", false); 
  loginform.Password.focus();
  return;
 }
 <%if(sys.getSecurityStatus()==1){ %>
  if(loginform.validata.value==''){
	alert('请输入验证码！');
	 $('#button_submit').attr("disabled", false); 
	loginform.validata.focus();
	return;
  }
<%}%>
 loginform.submit();
}
function changeImage(obj){
 obj.src="image.jsp?"+Math.random();
}
</script>
<body style="background-color:white;" onload="if(loginform.LoginId.value==''){document.all.LoginId.focus()}else{document.all.Password.focus()};" onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) oncontextmenu="return false">
<div align=center id=div_main class="maindiv">
<table width="100%" height="15%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="middle"><%@ include file="top.jsp" %>
    </td>
  </tr>
</table>
  <!--分割线 -->
<hr color=brown>
<table width="100%" height="40%" border="0" cellpadding="0" cellspacing="0" class="login_table">
 <tr>
  <!--登录左侧图-->
  <td width="55%">
    <table width="300" height="232" border="0" align="center" cellpadding="0" cellspacing="4" style="background-repeat:no-repeat"
   <%
   String imageURL = new CompanyDAO().findById(9).getImageURL();
   if(ValidateUtil.isNull(imageURL)){ %>
   background="<%=SysConfUtil.getInstance().getDeployType()==1?(WebUtil.getRootPath(request)+"/help"):(sysdao.findById(7).getSystemUrl())%>/common/images/<%=new CompanyDAO().findById(9).getLogo()%>"
   <%}else{%> 
   background="${ctx}/images/customer/showImage.jsp?page=login"
   <%}%>
   >
    <tr>
      <td></td>
    </tr>
   </table>
  </td>
  <!--用户名密码输入 -->
  <td width="35%">
 <form name="loginform" action="<%=request.getContextPath()%>/login.do" method="post"> 
 <table width="250" align="center" cellpadding="0" cellspacing="0"  style="background-color:white;border:1px solid gray;margin-top:16px;">
     <tr>
       <td>
        <table width="250" height="32" border="0" align="center" cellpadding="0" cellspacing="0">
         <tr>
         <td  style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=ghostwhite,endColorStr=silver">
         <img src="images/loginkey.gif"></td>
         <td style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=ghostwhite,endColorStr=silver"><span style="color:#CF2029;font-weight:bold;font-size: 14px;">用户登录</span></td>
        </tr>
       </table>
       <table width="250" height="20" border="0" align="center" cellpadding="0">
         <tr>
         <td></td>
        </tr>
       </table>
       <table width="250" border="0" cellpadding="0" cellspacing="4">
         <tr>
           <td width="25%" align="right" class="gray">登录名：</td>
           <td width="75%" colspan='2'>
            <div style="line-height:19px; text-align:left; word-break:break-all; word-wrap:break-word;">
              <input class="it1" type="text" name="LoginId" value="<%=LoginId%>"
               style="FONT-SIZE: 15px; FONT-FAMILY: simsun, serif;height:21;font-weight:bold;width:180;" tabindex="1"
               onfocus="this.className='it2';" 
               onblur="this.className='it1';"
              />
             </div>
            </td>
          </tr>
          <tr>
            <td align="right" class="gray">密　码：</td>
            <td colspan='2'>
            <input class="it1" type="password" name="Password" tabindex="2" 
             style="FONT-SIZE: 15px; FONT-FAMILY: simsun, serif;height:21;font-weight:bold;width:180;" 
             onfocus="this.className='it2';" 
             onblur="this.className='it1';"/>
            </td>
          </tr>
          <%if(sys.getAuthorizeType()==1){ %>
          <tr>
            <td align="right" class="gray">认证码：</td>
            <td colspan='2'>
            <input class="it1" type="password" name="authorizeKey" tabindex="3" 
             style="FONT-SIZE: 15px; FONT-FAMILY: simsun, serif;height:21;font-weight:bold;width:180;" 
             onfocus="this.className='it2';" 
             onblur="this.className='it1';"/>
            </td>
          </tr>
          <%}%>
          <%if(sys.getSecurityStatus()==1){ %>
          <tr>
            <td align="right" class="gray">验证码：</td>
            <td colspan='2'>
            <input class="it1" type="text" name="validata" tabindex="4" 
             style="FONT-SIZE: 15px; FONT-FAMILY: simsun, serif;height:21;font-weight:bold;width:45;" 
             onfocus="this.className='it2';" 
             onblur="this.className='it1';"/>
            <img id="random" border=0 src="image.jsp" width="44" height="18"><a class="blue" href="javascript:changeImage(document.getElementById('random'))">看不清，换一个</a>
            </td>
          </tr>
          <%}%>
          <tr>
            <td align="center"></td>
            <td>
            <img id="button_submit" style="CURSOR: hand" src="images/loginsubmit.gif" border="0" onclick="login();"></td>
          </tr>
        </table>
         <table width="250" height="20" border="0" align="center" cellpadding="0">
         <tr>
         <td></td>
        </tr>
        </table>
        </td>
      </tr>
     </table>
    </form>
    </td>
    <td width="10%">
    </td>
  </tr>
</table>
<!--分割线 -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="line_table">
  <tr>
    <td></td>
  </tr>
</table>
<table width="100%"  valign="bottom" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="bottom"><%@ include file="bottom.jsp"%></td>
  </tr>
</table>
</div>
</body>
</html>
