📄 addstu.jsp
字号:
<%@ page language="java"
import="java.util.*,edu.yinhe.mis.vo.StudentVO,edu.yinhe.mis.vo.TeacherVO,edu.yinhe.mis.vo.ClassesVO,edu.yinhe.mis.vo.DictionaryVO"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%
String path = request.getContextPath();
%>
<%
String options = request.getParameter("type");
if (options == null || options.equals("")) {
options = "jinben";
} else if (!options.equals("jinben")) {
options = "guanxi";
}
%>
<HTML>
<HEAD>
<LINK href="../css/CSS.css" type=text/css rel=stylesheet>
<LINK href="<%=path%>/admins/css/general.css" type=text/css rel=stylesheet>
<LINK href="<%=path%>/admins/css/main.css" type=text/css rel=stylesheet>
<script src="<%=path%>/admins/js/date.js" type=text/javascript charset="gbk"></script>
<script type="text/javascript" language="javascript">
function check1(){
var d=new Date();
var year=d.getYear();
var month=d.getMonth()+1;
var date=d.getDate();
var hour=d.getHours()
var minute=d.getMinutes();
var second=d.getSeconds();
if(parseInt(month)<10)
{
month="0"+month;
}
if(parseInt(date)<10)
{
date="0"+date;
}
if(parseInt(hour)<10)
{
hour="0"+hour;
}
if(parseInt(minute)<10)
{
minute="0"+minute;
}
if(parseInt(second)<10)
{
second="0"+second;
}
var sysdate=year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
var c= document.getElementById("cid").value;
var d=/^\d{15}(\d{2}[A-Za-z0-9])?$/,
q=d.test(c);
var ph = document.getElementById("homeTel").value;
var pk=/^0\d{2}-\d{8}|0\d{3}-\d{7}$/,
h=pk.test(ph);
var p = document.getElementById("phone").value;
var k=/^0\d{2}-\d{8}|0\d{3}-\d{7}$/,
o=k.test(p);
if(document.studentForm1.stuNo.value==''){
document.all.stuNo1.innerHTML="<font color=red>\*请填写学生学号!!</font>";
}else if(document.studentForm1.stuName.value==''){
alert("请填写学生姓名!!");
}else if(document.studentForm1.gender.value==''||document.studentForm1.gender.value=='请选择'){
alert("请选择性别!!");
}else if(document.studentForm1.classNo.value==''||document.studentForm1.classNo.value=='请选择'){
alert("请选择班级!!");
}else if(document.getElementById("phone").value!=''){
if(!o)
alert("电话格式不正确!!");
else if(document.studentForm1.teacherNo.value==''||document.studentForm1.teacherNo.value=='请选择'){
alert("请选择学生的班主任编号!!");
}else if(document.getElementById("homeTel").value!=''){
if(!h)
alert("家庭电话格式不正确!!");
else if(document.getElementById("birth").value>sysdate){
alert("你填写的时间有误,请确认后重填!!");
}else if(document.getElementById("cid").value!=''){
if(!q)
alert("身份证号不正确!!");
else{
document.studentForm1.submit();
}
}else{
document.studentForm1.submit();
}
}else if(document.getElementById("birth").value>sysdate){
alert("你填写的时间有误,请确认后重填!!");
}else if(document.getElementById("cid").value!=''){
if(!q)
alert("身份证号不正确!!");
else{
document.studentForm1.submit();
}
}else{
document.studentForm1.submit();
}
}else if(document.studentForm1.teacherNo.value==''||document.studentForm1.teacherNo.value=='请选择'){
alert("请选择学生的班主任编号!!");
}else if(document.getElementById("homeTel").value!=''){
if(!h)
alert("家庭电话格式不正确!!");
else if(document.getElementById("birth").value>sysdate){
alert("你填写的时间有误,请确认后重填!!");
}else if(document.getElementById("cid").value!=''){
if(!q)
alert("身份证号不正确!!");
else{
document.studentForm1.submit();
}
}else{
document.studentForm1.submit();
}
}else if(document.getElementById("birth").value>sysdate){
alert("你填写的时间有误,请确认后重填!!");
}else if(document.getElementById("cid").value!=''){
if(!q)
alert("身份证号不正确!!");
else{
document.studentForm1.submit();
}
}else{
document.studentForm1.submit();
}
}
function aa()
{ var d=new Date();
var year=d.getYear();
var month=d.getMonth();
var date=d.getDate();
var hour=d.getHours()
var minute=d.getMinutes();
var second=d.getSeconds();
if(parseInt(month)<10)
{
month="0"+month;
}
if(parseInt(date)<10)
{
date="0"+date;
}
if(parseInt(hour)<10)
{
hour="0"+hour;
}
if(parseInt(minute)<10)
{
minute="0"+minute;
}
if(parseInt(second)<10)
{
second="0"+second;
}
var sysdate=year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
alert(sysdate);
alert(document.getElementById("birth").value);
}
</script>
<script type="text/javascript">
var xmlHttp;
function creatXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest){
xmlHttp =new XMLHttpRequest();
}
}
function checks(stuNo){
var s=new RegExp("^[a-z0-9A-Z]{4,6}$");
o=stuNo.match(s);
if(!o){
document.all.stuNo1.innerHTML="<font color=red>\*学号只能是4~6位的数字或字母!!</font>";
document.all.stuNo.value="";
document.studentForm1.stuNo.fouce();
}else{
document.all.stuNo1.innerHTML="<font color=red>\</font> ";
creatXMLHttpRequest();
xmlHttp.onreadystatechange=processor;
xmlHttp.open("GET","<%=path%>/admins/core/student.html?method=validate&stuNo="+stuNo,true);
xmlHttp.send(null);
}}
function processor(){
var responseContext;
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
responseContext = xmlHttp.responseText;
if(responseContext.indexOf("true")!=-1){
document.all.stuNo1.innerHTML="<font color=blue>\*该学号有效!</font>";
} else{
document.all.stuNo1.innerHTML="<font color=red>\*该学号已存在,请重新填写学号!</font>";
document.all.stuNo.value="";
document.studentForm1.stuNo.fouce();
return;
}
}
}
}
</script>
<script type="text/javascript">
function check(obj){
var target=document.getElementById(obj);
var isDisplay=target.style.display;
if(isDisplay=="none"){
target.style.display="block";
}else{
target.style.display="none";
}
}
</script>
<script type="text/javascript">
function warn(){
if(document.studentForm1.dormNo.value!=""){
alert("你确认该寝室存在并把该学生放到该寝室吗?");
}
}
</script>
<script type="text/javascript">
function gs(){
var fileName=document.getElementById("stufile").value;
if(fileName.length==0||fileName.indexOf(".xls")==-1){
document.all.file1.innerHTML="<font color=red>\ *请选择正确的文件类型! 如果您还不知道传什么文件,请阅读使用说明!!</font>";
document.getElementById("stufile").value="";
return false;
}else{
document.all.file1.innerHTML="<font color=red>\</font>";
document.studentForm.stufile.fouce();
return true;
}
}
</script>
<script type="text/javascript">
function clearn(){
document.getElementsByName("stuNo").value="";
document.getElementsByName("stuName").value="";
document.getElementsByName("gender").value="";
document.getElementsByName("classNo").value="";
document.getElementsByName("phone").value="";
document.getElementsByName("teacherNo").value="";
document.getElementsByName("fatherName").value="";
document.getElementsByName("motherName").value="";
document.getElementsByName("homeTel").value="";
document.getElementsByName("nation").value="";
document.getElementsByName("birth").value="";
document.getElementsByName("polity").value="";
document.getElementsByName("cid").value="";
document.getElementsByName("dormNo").value="";
document.getElementsByName("stufile").value="";
document.all.stuNo1.innerHTML="<font color=red>\</font>";
}
function clearnf(){
document.all.file1.innerHTML="<font color=red>\</font>";
}
</script>
</HEAD>
<BODY>
<%
StudentVO svo = new StudentVO();
%>
<H1>
<SPAN>银河管理中心 - 学生管理 : 学生新增 </SPAN>
</H1>
<DIV class=tab-div >
<DIV id=tabbar-div>
<p>
<%
if (options.equals("jinben")) {
%>
<SPAN
class=tab-front id=shop_info-tab>单个增加</SPAN>
<a href="<%=path%>/admins/core/student/addstu.jsp?type=guanxi"><SPAN
class=tab-back>Excel导入</SPAN> </a>
<%
} else if (options.equals("guanxi")) {
%>
<a href="<%=path%>/admins/core/student/addstu.jsp?type=jinben"><SPAN
class=tab-back id=shop_info-tab>单个增加</SPAN> </a>
<SPAN class=tab-front>Excel导入</SPAN>
<%
}
%>
</p>
</DIV>
<DIV id=tabbody-div>
<%
if (options.equals("jinben")) {
%>
<form name="studentForm1"
action="<%=path%>/admins/core/student.html?method=addStudent"
method="post">
<table align="center" width="80%" >
<jsp:include page="/admins/core/student.html" flush="false">
<jsp:param name="method" value="queryDic1" />
</jsp:include>
<%ArrayList list1 = (ArrayList) request.getAttribute("arraylist1");%>
<jsp:include page="/admins/core/classes.html" flush="false">
<jsp:param name="method" value="findClasses" />
</jsp:include>
<%ArrayList listc = (ArrayList) request.getAttribute("clist");%>
<jsp:include page="/admins/core/student.html" flush="false">
<jsp:param name="method" value="queryTeacherTitle" />
</jsp:include>
<%ArrayList listt = (ArrayList) request.getAttribute("arraylist4");%>
<tr>
<td align="left" >
<div align="right">
学 号:
</div>
</td>
<td >
<label>
<input type="text" name="stuNo" maxlength="6" onblur="checks(this.value)">
</label>
<span id="stuNo1" name="stuNo1"></span>
</td>
</tr>
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -