<%@page import="ng.db.DBHelper"%>
|
<%@page import="javax.swing.text.html.HTML"%>
|
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
|
<%
|
request.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
response.setContentType("text/html; charset=utf-8");
|
%>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
<head>
|
<style type="text/css">
|
.btn{
|
margin-top: -50px;
|
}
|
|
|
</style>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>北玻登录</title>
|
<link rel="stylesheet" href="../css/login.css">
|
<link rel="shortcut icon" href="../img/3.ico" />
|
</head>
|
|
<%@include file="mysqlconnect.jsp"%>
|
<%
|
String yuyan1="cn";
|
String yuyan2=request.getParameter("yuyan");
|
if(yuyan2==""||yuyan2==null){
|
|
}else{
|
yuyan1=yuyan2;
|
}
|
String yemian="index.jsp";
|
String[] group=new String[6];
|
//连接数据库
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con1=DriverManager.getConnection( urlglass,user,password);
|
|
CallableStatement cs = con1.prepareCall("{call yuyan(?,?)}");
|
cs.setString(1, yemian);
|
cs.setString(2, yuyan1);
|
ResultSet rs = cs.executeQuery();
|
int i=0;
|
while(rs.next())
|
{
|
group[i]=rs.getString(1);
|
i++;
|
}
|
}
|
%>
|
|
<body style='background-color:#D5EAFF' onkeypress="handleKey()" onload="document.form1.userName.focus()">
|
|
<div class="content">
|
<div align="center">
|
<img src='../img/2.ico' style='top:8px;left:2px;width:150px; height:100px;' />
|
</div>
|
<form method="post" action="" name="form1">
|
<!-- <img src="../img/2.ico" style="align:middle; top:10;left:10;width:100px; height: 60px;" /> -->
|
<!--登录页面下拉选择语言功能的实现-->
|
|
<div id="box">
|
|
<div style="width: 650px;height: 30px;background-color:white; ">
|
|
<div style="float: left; height: 30px;line-height: 30px; width:100px;background-color: white;text-align: center;">
|
|
<%-- <a href='#'><% out.println(group[2]); %></a> --%>
|
</div>
|
<div style="height:30px;width:550px;line-height: 30px; ">
|
<%-- <a href="#" style="margin-left: 20px;color: white;">
|
<% out.println(group[3]); %>
|
</a> --%>
|
<SELECT NAME="language" name="language" id="language" onchange="changeLanguage()">
|
<option value="cn">Chinese</option>
|
<option value="en">English</option>
|
</SELECT>
|
</div>
|
</div>
|
<div>
|
<div>
|
<h1>
|
北玻自动化MES管理系统
|
<%-- <% out.println(group[4]); %> --%>
|
</h1>
|
</div>
|
<div>
|
|
<table>
|
<tr>
|
<td>
|
<%-- <% out.println(group[0]); %> --%>
|
</td>
|
<td>
|
<img src="../img/user.png" width="20" height="20" alt=""/>
|
<input style="height: 32px; width: 280px;line-height: 20px;" type="text" placeholder='请输入您的账号' name="userName" />
|
</td>
|
</tr>
|
<tr>
|
<td></td>
|
<td></td>
|
</tr>
|
<tr>
|
<td>
|
<%-- <% out.println(group[1]); %> --%>
|
</td>
|
<td>
|
<img src="../img/pwd.png" width="18" height="20" alt=""/>
|
<input style="height: 32px; width: 280px;line-height: 20px;" clearable placeholder='请输入您的密码' type="password" name="pwd" />
|
<!-- <div class="inline label account">
|
<img src="../img/account.png">
|
</div> -->
|
</td>
|
</tr>
|
|
<tr>
|
<td>
|
|
</td>
|
<td>
|
<input style="display:none; height: 10px;line-height: 10px;" type="text" name="yuyan" value="cn" />
|
<!-- <div class="custom-control custom-checkbox small">
|
<input type="checkbox" class="custom-control-input" id="customCheck">
|
<label class="custom-control-label" for="customCheck">记住密码</label>
|
|
</div> -->
|
</td>
|
|
</tr>
|
<tr>
|
<td></td>
|
<td><input id="boxcip" style="display:none;height: 10px;line-height: 10px;" type="text" name="cip" /></td>
|
</tr>
|
<tr>
|
<td>
|
|
</td>
|
<td>
|
|
<button type='submit' class='btn' name='dl' style='border:none;width: 60px;height: 30px;line-height: 15px;background-color:rgb(100, 184, 236) ;color: white;' /><% out.println(group[2]); %></button>
|
|
<button type='button' name='zc' class='btn' onclick="zhuce()" style='border:none;width: 60px;height: 30px;line-height: 15px;background-color:rgb(100, 184, 236) ;color: white;' /><% out.println(group[3]); %></button>
|
</td>
|
<td>
|
|
</td>
|
</tr>
|
</table>
|
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</body>
|
|
<script type="text/javascript">
|
function changeLanguage(){
|
var what=document.getElementById("language").value;
|
window.location.href="index.jsp?yuyan="+what+"";
|
}
|
window.onload=function(){
|
function GetQueryString(yuyan) {
|
var reg = new RegExp("(^|&)" + yuyan + "=([^&]*)(&|$)","i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r!=null){
|
var a = unescape(r[2]);
|
if(a=="en"){
|
var what=document.getElementById("language");
|
var opts=what.getElementsByTagName("option");
|
opts[1].selected=true;
|
}
|
}else{
|
return null;
|
}
|
}
|
GetQueryString("yuyan");
|
}
|
|
function zhuce() {
|
|
window.open("./admin/register.jsp");
|
}
|
</script>
|
|
<%
|
|
String uname=request.getParameter("userName");
|
String pwd=request.getParameter("pwd");
|
String yuyan=request.getParameter("yuyan");
|
String ym="Login.jsp";
|
String tip=request.getLocalAddr() ;
|
int fanhui=0;
|
int fanhui1=0;
|
String xingming="";
|
String aid="";
|
String anquanma="";
|
String dengji="";
|
String bumen="";
|
|
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
if(uname!=null&&pwd!=null){
|
if(uname!=""&&pwd!=""){
|
Connection con=DriverManager.getConnection( urlglass,user,password);
|
|
CallableStatement cs = con.prepareCall("{call denglu(?,?,?,?,?,?,?,?)}");
|
cs.setString(1, uname);
|
cs.setString(2, pwd);
|
cs.setString(3, ym);
|
cs.setString(4, tip);
|
cs.registerOutParameter( 5 , java.sql.Types.INTEGER);
|
cs.registerOutParameter( 6 , java.sql.Types.INTEGER);
|
cs.registerOutParameter( 7 , java.sql.Types.INTEGER);
|
cs.registerOutParameter( 8 , java.sql.Types.INTEGER);
|
|
cs.execute();
|
fanhui=cs.getInt(5);
|
xingming=cs.getString(6);
|
aid=cs.getString(7);
|
bumen=cs.getString(8);
|
|
|
|
|
if(fanhui==5000){
|
CallableStatement css = con.prepareCall("{call anquan(?,?,?,?,?,?)}");
|
css.setString(1, aid);
|
css.setString(2, tip);
|
css.setString(3, ym);
|
css.registerOutParameter( 4 , java.sql.Types.INTEGER);
|
css.registerOutParameter( 5 , java.sql.Types.INTEGER);
|
css.registerOutParameter( 6 , java.sql.Types.INTEGER);
|
css.execute();
|
fanhui1=css.getInt(4);
|
anquanma=css.getString(5);
|
dengji=css.getString(6);
|
if(fanhui1==5000){
|
out.print("<script type='text/javascript'>localStorage.clear();window.location.href='bdg.jsp?loginname="+uname+"&xingming="+xingming+"&bumen="+bumen+"&dengji="+dengji+"&anquanma="+anquanma+"&adminid="+aid+"&yuyan="+yuyan+"';</script>");
|
}
|
else{
|
out.print("<script type='text/javascript'>alert('安全码无效')</script>");
|
}
|
}
|
else{
|
out.print("<script type='text/javascript'>alert('用户名或者密码错误')</script>");
|
}
|
//关闭连接
|
|
con.close();
|
}
|
|
else{
|
out.print("<script type='text/javascript'>alert('不能为空')</script>");
|
}
|
}
|
}
|
|
|
|
|
|
%>
|
|
</html>
|