rs_cx_card.jsp
来自「JSP页面和oracle9i数据库的源代码」· JSP 代码 · 共 1,807 行 · 第 1/5 页
JSP
1,807 行
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!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=gb2312">
<%
String page_type=(String)session.getAttribute("page_type");
String page_name=(String)session.getAttribute("page_name");
if(page_type==null){page_type="";}
if(session.isNew()){response.sendRedirect("../index.jsp");}
else
{ if(!(page_type.equals("rs")) && !page_type.equals("srs"))
{response.sendRedirect("../index.jsp");}
}
%>
<title>查询人事卡片</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<script Language="JavaScript">
function tj_bh()
{
if (document.cx_tj.bh.value=="")
{
alert("请输入一个编号");
document.cx_tj.bh.focus();
return false ;
}
return true;
}
function tj_xm()
{
if (document.cx_tj.xm.value=="")
{
alert("姓名不能为空");
document.cx_tj.xm.focus();
return false ;
}
}
function tj_jtzz()
{
if (document.cx_tj.jtzz.value=="")
{
alert("家庭住址不能为空");
document.cx_tj.jtzz.focus();
return false ;
}
}
function tj_jtdh()
{
if (document.cx_tj.jtdh.value=="")
{
alert("家庭电话不能为空");
document.cx_tj.jtdh.focus();
return false ;
}
var jtdh=document.cx_tj.jtdh.value;
if(!isAllNumber(jtdh))
{
document.cx_tj.jtdh.value="";
alert("请输入一个全部由数字组成的家庭电话!");
document.cx_tj.jtdh.focus();
return false ;
}
return true;
}
function isAllNumber(jtdh)
{
var test = true;
for(var j=0;j<jtdh.length;j++)
{
if(jtdh.substring(j,j+1) != "0"&&
jtdh.substring(j,j+1) != "1"&&
jtdh.substring(j,j+1) != "2"&&
jtdh.substring(j,j+1) != "3"&&
jtdh.substring(j,j+1) != "4"&&
jtdh.substring(j,j+1) != "5"&&
jtdh.substring(j,j+1) != "6"&&
jtdh.substring(j,j+1) != "7"&&
jtdh.substring(j,j+1) != "8"&&
jtdh.substring(j,j+1) != "9")
test=false;
}
return test;
}
function tj_dzyj()
{
if (document.cx_tj.dzyj.value=="")
{
alert("电子邮件不能为空");
document.cx_tj.dzyj.focus();
return false ;
}
var dzyj=document.cx_tj.dzyj.value;
if(!isture_dzyj(dzyj))
{
document.cx_tj.dzyj.value="";
alert("请输入一个正确的电子邮件地址!");
document.cx_tj.dzyj.focus();
return false ;
}
return true;
}
function isture_dzyj(dzyj)
{
var m=0;k=0;l=0;
for(var j=0;j<dzyj.length;j++)
{ if(dzyj.substring(j,j+1)=="@")
{ m++;
if(m==1){l=j+1;}
}
}
if(m>1||m==0)
{return false;}
else
{ for(j=0;j<l-1;j++)
{
if( (dzyj.substring(j,j+1)>"z"||dzyj.substring(j,j+1)<"A") &&
(dzyj.substring(j,j+1)>"9"||dzyj.substring(j,j+1)<"0") &&
dzyj.substring(j,j+1)!="_" && dzyj.substring(j,j+1)!="-")
{return false;}
}
for(j=l;j<dzyj.length-1;j++)
{ if( (dzyj.substring(j,j+1)>"z"||dzyj.substring(j,j+1)<"A") &&
(dzyj.substring(j,j+1)>"9"||dzyj.substring(j,j+1)<"0") &&
dzyj.substring(j,j+1)!="."&&dzyj.substring(j,j+1)!="_" &&
dzyj.substring(j,j+1)!="-")
{return false;}
}
if(dzyj.substring(j,j+1)>"z"||dzyj.substring(j,j+1)<"A")
return false;
}
return true;
}
function tj_sjhm()
{ var result=false;
if (document.cx_tj.sjhm.value=="")
{
alert("手机号码不能为空");
document.cx_tj.sjhm.focus();
}
else
{ if(onsjhm())
result=true;
}
return result;
}
function onsjhm()
{
var sjhm=document.cx_tj.sjhm.value;
if(!isAllNumber(sjhm))
{
document.cx_tj.sjhm.value="";
alert("请输入一个全部由数字组成的手机号码!");
document.cx_tj.sjhm.focus();
return false;
}
return true;
}
function isAllNumber(sjhm)
{
var test = true;
for(var j=0;j<sjhm.length;j++)
{
if(sjhm.substring(j,j+1) != "0"&&
sjhm.substring(j,j+1) != "1"&&
sjhm.substring(j,j+1) != "2"&&
sjhm.substring(j,j+1) != "3"&&
sjhm.substring(j,j+1) != "4"&&
sjhm.substring(j,j+1) != "5"&&
sjhm.substring(j,j+1) != "6"&&
sjhm.substring(j,j+1) != "7"&&
sjhm.substring(j,j+1) != "8"&&
sjhm.substring(j,j+1) != "9")
test=false;
}
return test;
}
function tj_zhtj()
{ if(!onnl())
{return false;}
if(document.cx_tj.csny.checked)
{ if(!oncsny())
{ return false;
}
}
if(document.cx_tj.cjgzsj.checked)
{ if(!oncjgzsj())
{ return false;
}
}
if(document.cx_tj.jbdwsj.checked)
{ if(!onjbdwsj())
{ return false;
}
}
return true;
}
function onnl()
{
var nl_min=document.cx_tj.nl_min.value;
var nl_max=document.cx_tj.nl_max.value;
if(!isAllNumber(nl_min))
{
document.cx_tj.nl_min.value="";
alert("请输入一个全部由数字组成的年龄下限!");
document.cx_tj.nl_min.focus();return false;
}
if(!isAllNumber(nl_max))
{
document.cx_tj.nl_max.value="";
alert("请输入一个全部由数字组成的年龄上限!");
document.cx_tj.nl_max.focus();return false;
}
if(nl_min=="" || nl_max=="")
{ if(nl_min=="" && nl_max==""){}
else
{ alert("如要限定年龄条件,年龄的上下限都要填写!");
return false;
}
}
if(document.cx_tj.nl_min.value!=""&&document.cx_tj.nl_max.value!=""&&isAllNumber(nl_max))
{ if(document.cx_tj.nl_min.value.length<document.cx_tj.nl_max.value.length){}
if(document.cx_tj.nl_min.value.length>document.cx_tj.nl_max.value.length)
{ alert("注意:年龄上限必须大于年龄下限!");
return false;
}
if( document.cx_tj.nl_min.value.length==document.cx_tj.nl_max.value.length)
{ if(document.cx_tj.nl_min.value>document.cx_tj.nl_max.value)
{ alert("注意:年龄上限必须大于年龄下限!");
return false;
}
}
}
return true;
}
function isAllNumber(nl_min)
{
var test = true;
for(var j=0;j<nl_min.length;j++)
{
if(nl_min.substring(j,j+1) != "0"&&
nl_min.substring(j,j+1) != "1"&&
nl_min.substring(j,j+1) != "2"&&
nl_min.substring(j,j+1) != "3"&&
nl_min.substring(j,j+1) != "4"&&
nl_min.substring(j,j+1) != "5"&&
nl_min.substring(j,j+1) != "6"&&
nl_min.substring(j,j+1) != "7"&&
nl_min.substring(j,j+1) != "8"&&
nl_min.substring(j,j+1) != "9")
test=false;
}
return test;
}
function isAllNumber(nl_max)
{
var test = true;
for(var j=0;j<nl_max.length;j++)
{
if(nl_max.substring(j,j+1) != "0"&&
nl_max.substring(j,j+1) != "1"&&
nl_max.substring(j,j+1) != "2"&&
nl_max.substring(j,j+1) != "3"&&
nl_max.substring(j,j+1) != "4"&&
nl_max.substring(j,j+1) != "5"&&
nl_max.substring(j,j+1) != "6"&&
nl_max.substring(j,j+1) != "7"&&
nl_max.substring(j,j+1) != "8"&&
nl_max.substring(j,j+1) != "9")
test=false;
}
return test;
}
function oncsny()
{ var d=0;
var csny_min_year=document.cx_tj.csny_min_year.value;
var csny_max_year=document.cx_tj.csny_max_year.value;
var csny_min_month=document.cx_tj.csny_min_month.value;
var csny_max_month=document.cx_tj.csny_max_month.value;
var csny_min_day=document.cx_tj.csny_min_day.value;
var csny_max_day=document.cx_tj.csny_max_day.value;
if(document.cx_tj.csny.checked)
{
if(!isAllNumber(csny_min_year))
{ alert("请输入一个全部由数字组成的出生年下限!");return false;
}
if(!isAllNumber(csny_max_year))
{ alert("请输入一个全部由数字组成的出生年上限!");return false;
}
if(document.cx_tj.csny_min_year.value=="" || document.cx_tj.csny_max_year.value=="")
{ alert("你已选定出生日期条件,请输入出生年下限和出生年上限!");return false;
}
if(!(csny_min_year%100))
{ if(!(csny_min_year%400))
var d=2;
else
var d=1;
}
else
{ if(!(csny_min_year%4))
var d=2;
else
var d=1;
}
if(d!=0)
{ if(csny_min_month=="4"||
csny_min_month=="6"||
csny_min_month=="9"||
csny_min_month=="11"||
csny_min_month=="2")
{if(csny_min_day>30)
{ alert(csny_min_month+"月没有"+csny_min_day+"号");
document.cx_tj.csny_min_day.value="1";return false;
}
if(csny_min_month=="2")
{ if(csny_min_day==30)
{ alert("2月没有"+csny_min_day+"号");document.cx_tj.csny_min_day.value="1";return false;}
if(d==1)
{ if(csny_min_day==29)
{alert(csny_min_year+"年的2月没有"+csny_min_day+"号");document.cx_tj.csny_min_day.value="1";return false;}
}
}
}
}
d=0;
if(!(csny_max_year%100))
{ if(!(csny_max_year%400))
var d=2;
else
var d=1;
}
else
{ if(!(csny_max_year%4))
var d=2;
else
var d=1;
}
if(d!=0)
{ if(csny_max_month=="4"||
csny_max_month=="6"||
csny_max_month=="9"||
csny_max_month=="11"||
csny_max_month=="2")
{if(csny_max_day>30)
{ alert(csny_max_month+"月没有"+csny_max_day+"号");
document.cx_tj.csny_max_day.value="1";return false;
}
if(csny_max_month=="2")
{ if(csny_max_day==30)
{ alert("2月没有"+csny_max_day+"号");document.cx_tj.csny_max_day.value="1";return false;}
if(d==1)
{ if(csny_max_day==29)
{alert(csny_max_year+"年的2月没有"+csny_max_day+"号");document.cx_tj.csny_max_day.value="1";return false;}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?