<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="gbase.db.*,java.sql.*"%>
<%
	
	String message="操作失败";
	String url="index.jsp";
	  String user_id = request.getParameter("user_id") == null ? "" :
        request.getParameter("user_id");
    String password = request.getParameter("password") == null ? "" :
        request.getParameter("password");

	String sql = "select user_id,password,user_name from sys_user  where user_id='"+user_id+"' and password='"+password+"'";
        DBOperation theDBOperation = new DBOperation();
      try {
         ResultSet rs=theDBOperation.getResultSet(sql);
        if(rs.next() & rs.getString("password").equals(password))
        {  
           String user_name=rs.getString("user_name");
           url="index.jsp";
           session.setAttribute("user_id",user_id);
           session.setAttribute("user_name",user_name);
           session.setAttribute("login_ok","login_ok");
           }
        else
           url="relogin.jsp";
      }
      catch (Exception ex) {
        message = "操作失败!";
      }
	
%>
<script language="javascript">
	function process ( message,url){
		//alert(message);
		self.location = url;
	}
</script>
<html>
	<head>
		<title>部门新增</title>
	</head>
	<body onload="javascript: process('<%=message%>','<%=url%>');">
	</body>
</html>