<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
<head>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<!-- <link href="/CSS&JS/style_checkcode.css" rel="stylesheet" type="text/css">-->
|
|
<title>注册</title>
|
<style type="text/css">
|
*{
|
margin: 0;
|
padding: 0;
|
}
|
a{
|
text-decoration: none;
|
outline: medium none;
|
color: #CF0;
|
}
|
#wrap {
|
height: 80%;
|
width: 100%;
|
background-repeat: no-repeat;
|
background-position: center center;
|
position: relative;
|
}
|
#head {
|
height: 10%;
|
width: 100%;
|
background-color: #66CCCC;
|
text-align: center;
|
position: relative;
|
}
|
#foot {
|
width: 100%;
|
height: 10%;
|
background-color: #CC9933;
|
position: relative;
|
}
|
#wrap .logGet {
|
height: 458px;
|
width: 368px;
|
position: absolute;
|
background-color: #FFFFFF;
|
top: 200px;
|
left: 38%;
|
|
|
}
|
.inputo{
|
margin-top: 20px;
|
width: 100%;
|
height: 45px;
|
background-color: rgb(100, 184, 236);
|
border: none;
|
color: white;
|
font-size: 18px;
|
}
|
.logC a:hover {
|
color: #63B1FF;
|
text-shadow: 1px 1px 1px #000000;
|
}
|
|
.logGet .logD.logDtip .p1 {
|
display: inline-block;
|
font-size: 28px;
|
margin-top: 10px;
|
width: 86%;
|
}
|
#wrap .logGet .logD.logDtip {
|
width: 86%;
|
border-bottom: 1px solid #ee7700;
|
margin-bottom: 35px;
|
margin-top: 0px;
|
margin-right: auto;
|
margin-left: auto;
|
}
|
.logGet .lgD img {
|
position: absolute;
|
top: 5px;
|
left: -19px;
|
}
|
.logGet .lgD input {
|
width: 100%;
|
height: 25px;
|
text-indent: 2.5rem;
|
}
|
#wrap .logGet .lgD {
|
width: 86%;
|
position: relative;
|
margin-bottom: 30px;
|
margin-top: 10px;
|
margin-right: auto;
|
margin-left: auto;
|
}
|
#wrap .logGet .logC {
|
width: 86%;
|
margin-top: 0px;
|
margin-right: auto;
|
margin-bottom: 0px;
|
margin-left: auto;
|
}
|
|
|
.title {
|
font-family: "宋体";
|
color: #FFFFFF;
|
position: absolute;
|
top: 50%;
|
left: 50%;
|
transform: translate(-50%, -50%); /* 使用css3的transform来实现 */
|
font-size: 36px;
|
height: 40px;
|
width: 30%;
|
}
|
|
.copyright {
|
font-family: "宋体";
|
color: #FFFFFF;
|
position: absolute;
|
top: 50%;
|
left: 50%;
|
transform: translate(-50%, -50%); /* 使用css3的transform来实现 */
|
height: 60px;
|
width: 40%;
|
text-align:center;
|
}
|
|
|
|
</style>
|
|
|
|
</script>
|
<link rel="shortcut icon" href="../../img/3.ico" />
|
</head>
|
|
<%@include file="../mysqlconnect.jsp"%>
|
<body style='background-color:#D5EAFF' onload="document.form1.userName.focus()" >
|
<%
|
String yuyan1="cn";
|
String yuyan2=request.getParameter("yuyan");
|
if(yuyan2==""||yuyan2==null){
|
|
}else{
|
yuyan1=yuyan2;
|
}
|
|
String yemian="Login.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++;
|
}
|
}
|
%>
|
|
<div class="wrap" id="wrap">
|
<div align="center" >
|
<img src='../../img/2.ico'; style='top:38px;align:center;position:absolute;left:700px;width:150px; height:100px;' />
|
</div>
|
<div class="logGet">
|
<!-- 头部提示信息 -->
|
<div align="center" class="logD logDtip">
|
<p class="p1">注册</p>
|
</div>
|
<!-- 输入框 -->
|
<form id="formLogin" method="post" action="" name="form1" >
|
<span style="color: red">${error}</span>
|
|
<div class="lgD">
|
|
<!-- <img src="img/logName.png" width="20" height="20" alt=""/>-->
|
姓名 <!-- <img src='../img/姓名.ico'; width="20" height="20" /> --><input type="text" name="xingming" id="xingming" maxlength=15 "
|
placeholder="请输入姓名" />
|
|
<div id="user_prompt"></div>
|
</div>
|
<div class="lgD">
|
|
|
|
部门: <td style="width:80px">
|
<input name="bumen" id="bumen" style='display:none' type="text" value="经营部" >
|
<input name='banzugonghao' type="text" value='' style='display:none'>
|
<input name='banzumingcheng' id='bzmc' style='display:none' readOnly="readonly" type="text" maxlength="10">
|
<select style='background-color:#D5EAFF;border:none;' name="" id="bm" onchange='erjixianshi(this)' style="width:80px;height:20px;border-style:none;outline: none;">
|
|
|
|
<%
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con=DriverManager.getConnection(urlglass,user,password);
|
//调用存储过程
|
CallableStatement cs = con.prepareCall("{call bumenchaxun}");
|
ResultSet rs = cs.executeQuery();
|
//循环打印数据
|
|
while(rs.next())
|
{
|
out.println("<option value='"+rs.getString(1)+"' >"+rs.getString(1)+"</option>");
|
|
}
|
|
|
}
|
%>
|
</select>
|
|
|
</td>
|
|
|
班组: <td style="width:80px">
|
|
<select style='background-color:#D5EAFF;border:none;' name="" id="bz" onchange='change_banzu()' style="width:80px;height:20px;border-style:none;outline: none;">
|
<option value='' id='xuanze' >请选择班组</option>
|
|
|
<%
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con=DriverManager.getConnection(urlglass,user,password);
|
//调用存储过程
|
CallableStatement cs = con.prepareCall("{call banzuchaxun()}");
|
ResultSet rs = cs.executeQuery();
|
//循环打印数据
|
|
while(rs.next())
|
{
|
out.println("<option value='"+rs.getString(2)+"' >"+rs.getString(1)+"</option>");
|
|
}
|
|
|
}
|
%>
|
</select>
|
|
|
</td>
|
|
|
|
|
</div>
|
|
<%-- <div class="lgD">
|
|
<!-- <img src="img/logName.png" width="20" height="20" alt=""/>-->
|
<!-- <input style="display:none;" type="text" required='required' maxlength="50" list="banzulist" name='banzubianhao' > -->
|
班组: <td><input type="text" required='required' maxlength="50" list="banzulist" >
|
<datalist id="banzulist" >
|
<select class="sb">
|
|
<%
|
Class.forName(driverClass1);{
|
Connection con=DriverManager.getConnection(url1,user1,password1);
|
CallableStatement cs = con.prepareCall("{call banzuchaxun()}");
|
ResultSet rs = cs.executeQuery();
|
while(rs.next()){
|
out.println("<option ' value='"+rs.getString(1)+"' >");
|
}
|
con.close();
|
}
|
%>
|
</select>
|
</datalist>
|
</td>
|
|
|
<div id="user_prompt"></div>
|
</div> --%>
|
<div class="lgD">
|
|
<!-- <img src="img/logName.png" width="20" height="20" alt=""/>-->
|
用户名:<input type="text" name="userName" id="name" maxlength=15
|
placeholder="请输入4到15位(字母,数字,下划线,减号)" />
|
|
<div id="user_prompt"></div>
|
</div>
|
|
|
<div class="lgD">
|
<!-- <img src="img/logPwd.png" width="20" height="20" alt=""/>-->
|
密码:<input type="password" name="pwd" id="pwd" maxlength=15
|
placeholder="请输入6-15位字母、数字、下划线" />
|
|
<div id="pwd_prompt"></div>
|
</div>
|
|
<div class="lgD">
|
|
|
<div id="repwd_prompt"></div>
|
</div>
|
|
|
<div class="logC">
|
<input name="submit" type="submit" onclick='return formSub()' value="注册" class="inputo" id="bot" /><br/>
|
|
|
</div>
|
|
|
</form>
|
</div>
|
</div>
|
|
|
|
|
</body>
|
|
<script src="../../js/jquery-3.4.1.js"></script>
|
|
<script type="text/javascript" charset="UTF-8">
|
|
|
|
|
/* function change_fktj()
|
{
|
|
|
|
}
|
*/
|
|
function erjixianshi(e)
|
{
|
/* alert(e.value); */
|
var obj=document.getElementById("bm");
|
|
var erjibianhao=$("#bz").find('option');
|
document.getElementById('bumen').value=obj.options[obj.selectedIndex].innerHTML;
|
for(var i=1;i<erjibianhao.length;i++)
|
{
|
|
if(e.value=="生产部")
|
{
|
erjibianhao[i].style.display="block";
|
}
|
else
|
{
|
erjibianhao[i].style.display="none";
|
}
|
|
}
|
}
|
|
|
function change_banzu()
|
{
|
|
var banzuid=document.getElementById("bz");
|
|
|
var banzugonghao=banzuid.options[banzuid.selectedIndex].value;
|
var banzumingcheng=banzuid.options[banzuid.selectedIndex].innerHTML;
|
|
|
$('[name="banzugonghao"]').val(banzuid.options[banzuid.selectedIndex].value);
|
|
$('[name="banzumingcheng"]').val(banzuid.options[banzuid.selectedIndex].innerHTML);
|
|
|
|
}
|
|
|
|
function formSub(){
|
|
var xingming = $.trim($("#xingming").val());
|
var name = $.trim($("#name").val());
|
var xyed3= /^(\w){6,15}$/;
|
var yhm= /^[a-zA-Z0-9_-]{4,15}$/;
|
var mobile2 = $("#name").val();
|
var phoneReg2 = !!mobile2.match(yhm);
|
var mobile1 = $("#pwd").val();
|
var phoneReg = !!mobile1.match(xyed3);
|
|
/* var select_id=document.getElementById("bz");
|
|
if(select_id.selectedIndex==0 || select_id.options[select_id.selectedIndex].innerHTML.trim()=='' ){
|
|
alert('请选择班组!')
|
return false;
|
} */
|
if(document.getElementById('bumen').value==''){
|
alert('还未选择部门');///这里你换成其他更友善的提示调用函数什么的都行
|
$("input#bm").focus();
|
return false;
|
}
|
if(name == "" || name==null){
|
alert("用户名不能为空")
|
return false;
|
}
|
if(phoneReg2 == false){
|
alert("用户名只能输入4到15位(字母,数字,下划线,减号) ");
|
|
return false;
|
}
|
|
if(phoneReg == false){
|
alert("密码只能输入6-15位字母、数字、下划线 ");
|
return false;
|
}
|
if(xingming == ""){
|
alert("姓名不能为空")
|
return false;
|
}
|
};
|
|
|
</script>
|
|
<%
|
|
String banzu="";
|
if(request.getParameter("submit")!=null){
|
String uname=request.getParameter("userName");
|
uname= new String(uname.getBytes("ISO-8859-1"), "utf-8");
|
String pwd=request.getParameter("pwd");
|
pwd= new String(pwd.getBytes("ISO-8859-1"), "utf-8");
|
String xingming=request.getParameter("xingming");
|
xingming= new String(xingming.getBytes("ISO-8859-1"), "utf-8");
|
String bumen=request.getParameter("bumen");
|
bumen= new String(bumen.getBytes("ISO-8859-1"), "utf-8");
|
String bumenbianhao=request.getParameter("bumenbianhao");
|
|
/*
|
} */
|
|
|
|
banzu=request.getParameter("banzumingcheng");
|
banzu= new String(banzu.getBytes("ISO-8859-1"), "utf-8");
|
|
|
String banzugonghao=request.getParameter("banzugonghao");
|
|
banzugonghao= new String(banzugonghao.getBytes("ISO-8859-1"), "utf-8");
|
int fanhui=0;
|
|
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
if(uname!=null&&pwd!=null){
|
|
Connection con=DriverManager.getConnection( urlglass,user,password);
|
|
CallableStatement cs = con.prepareCall("{call zhuce(?,?,?,?,?,?,?,?,?)}");
|
cs.setString(1, uname);
|
cs.setString(2, pwd);
|
cs.setString(3, xingming);
|
cs.setString(4, bumenbianhao);
|
cs.setString(5, bumen);
|
cs.setString(6, banzu);
|
cs.setString(7, request.getRemoteAddr());
|
cs.setString(8, banzugonghao);
|
cs.registerOutParameter( 9 , java.sql.Types.INTEGER);
|
cs.execute();
|
fanhui=cs.getInt(9);
|
if(fanhui==5000){
|
out.print("<script type='text/javascript'>alert('注册成功');window.close()</script>");
|
|
}else{
|
out.print("<script type='text/javascript'>alert('注册失败或不能重复注册');</script>");
|
}con.close();
|
}
|
|
|
|
}
|
|
|
}
|
|
|
%>
|
|
|
|
</html>
|