📄 registerdo.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:requestEncoding value="gb2312"/>
<!------设置数据源------>
<sql:setDataSource dataSource="jdbc/sqlserver" var="sqlDS"/>
<html>
<head>
<title>新用户注册</title>
</head>
<body bgcolor="#DCDADA">
<c:if test="${(not empty param.user_name) and (not empty param.password)
and (not empty param.order_no) and (not empty param.sysuser_role)}">
<c:set var="rowCount" value="0"/>
<!--如果是教师或教务管理用户-->
<c:if test="${param.sysuser_role==2 or param.sysuser_role==3}">
<c:set var="selectSQL"
value="select teacher_id from teacher where teacher_id=${param.order_no}"/>
<sql:query sql="${selectSQL}"
var="selectRS" dataSource="${sqlDS}"/>
<c:set var="rowCount" value="${selectRS.rowCount}"/>
</c:if>
<!--如果是学生用户-->
<c:if test="${param.sysuser_role==4}">
<c:set var="selectSQL"
value="select * from student where student_id=${param.order_no}"/>
<sql:query sql="${selectSQL}"
var="selectRS" dataSource="${sqlDS}"/>
<c:set var="rowCount" value="${selectRS.rowCount}"/>
</c:if>
<c:if test="${rowCount>=1}">
<!--插入用户数据-->
<c:set var="insertSQL" value="insert into sysuser(sysuser_name,
sysuser_password,sysuser_role,foreign_id,sysuser_status) values(
?,?,?,?,0)"/>
<sql:update sql="${insertSQL}"
var="infec" dataSource="${sqlDS}">
<sql:param value="${param.user_name}"/>
<sql:param value="${param.password}"/>
<sql:param value="${param.sysuser_role}"/>
<sql:param value="${param.order_no}"/>
</sql:update>
<c:if test="${infec==1}">
注册用户成功,请等待审核。
</c:if>
<c:if test="${infec!=1}">
注册用户失败。
</c:if>
</c:if>
<c:if test="${rowCount<1}">
系统中没有所注册的用户对应的教师或学生信息!
</c:if>
</c:if>
<br><a href="../login.jsp">返回</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -