rs_add_shgx.jsp

来自「JSP页面和oracle9i数据库的源代码」· JSP 代码 · 共 200 行

JSP
200
字号
<%@ 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">
<title>添加社会关系</title>
<style type="text/css">
<!--
body {
	background-image: url(../img/071.gif);
}
-->
</style></head>
<%
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("srs"))
	{response.sendRedirect("../index.jsp");}	
}
%>
<script language="javascript">
function  check_bh()
{	var true_false=true;
	if(document.intobh.bh.value=="")
    {	alert("请填写'所要添加家庭成员信息的职工编号!'");
        true_false=false;
    }
	return true_false;
}
function  check()
{	var true_false=true;
	if(document.add.gxxm.value=="")
    {	alert("请填写'关系人姓名'");
        true_false=false;
    }
	if(document.add.ybrgx.value=="")
    {	alert("请填写'与本人关系关系'");
        true_false=false;
    }
	if(document.add.zzmm.value=="0")
    {	alert("请选择'政治面目'");
        true_false=false;
    }
	if(document.add.gzdw.value=="")
    {	alert("请填写'工作单位'如果没有请填写'无'");
        true_false=false;
    }
	if(document.add.zwgz.value=="")
    {	alert("请填写'职务工种'如果没有请填写'无'");
        true_false=false;
    }
	if(document.add.bz.value=="")
    {	alert("请填写'备注'如果没有请填写'无'");
        true_false=false;
    }
	return true_false;
}
</script>
<style>
<!--
a {text-decoration: none}
.f1          { font-size: 9pt; font-family: Verdana; line-height: 15pt }
.f2          { font-size: 8pt; font-family: Verdana; line-height: 12pt }
.style1 {
	font-size: medium;
	font-weight: bold;
}
.style2 {font-size: 14px}
.style14 {color: #FF66CC}
-->
</style>
</head>
<body>
<jsp:useBean id="conn" scope="page" class="beans.conn"/>
<jsp:include page="../index/shgx_entry_menu.jsp"></jsp:include>
<%@ page import="java.util.Calendar"%>
<%@ page import="java.text.*"%>
<%	String meb=response.encodeURL("rs_add_shgx.jsp");%>
<p align="center" class="f1"><span class="style1">添加社会关系页面</span><br>   
<%	ResultSet rs=null;
	String bh=request.getParameter("bh");
	int all=0;
	if(bh==null){bh="";}
	else
	{	String condition_bh="select * from zgxx where bh='"+bh+"'";
		conn.setcondition(condition_bh);
		ResultSet rs_zgxx=conn.getrs();
		rs_zgxx.last();
		int all_zgxx=rs_zgxx.getRow();
		condition_bh="select * from txzgxx where bh='"+bh+"'";
		conn.setcondition(condition_bh);
		ResultSet rs_txzgxx=conn.getrs();
		rs_txzgxx.last();
		int all_txzgxx=rs_txzgxx.getRow();
		all=all_zgxx+all_txzgxx;
		if(all>1)
		{out.print("<center>出现职工编号重复错误!请予管理员联系!</center>");}
		else
		{	if(all==0){if(bh.equals("")){out.print("<center>您还没有输入编号,请输入!</center>");}else{out.print("<center>没有编号为"+bh+"的职工,请重新填写</center>");}}
			if(all==1)
			{	if(all_zgxx==1){rs=rs_zgxx;}
				if(all_txzgxx==1){rs=rs_txzgxx;}
			}
		}
	}
	if(bh.equals("")||all!=1)
	{	
%>
<form action="<%=meb%>" method="post" name="intobh" id="intobh" onSubmit="return check_bh()">
  <div align="center">请填写所要添加'社会关系信息'的'职工'的编号
    <input name="bh" type="text" id="bh" style=" BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 1px solid; BORDER-LEFT: rgb(80,139,220) 1px solid; BORDER-RIGHT: rgb(80,139,220) 1px solid; BORDER-TOP: rgb(80,139,220) 1px solid" size="15" maxlength="15">    
      <input type="submit" name="Submit3" value="确定">
</div></form>
<%	}
	else
	{	rs.first();
%> 
<form <%String meb_rs_add_shgx_sav=response.encodeURL("rs_add_shgx_sav.jsp");%>action="<%=meb_rs_add_shgx_sav%>" method="post" name="add" id="add" onSubmit="return check()">
<table border="0" cellspacing="2" cellpadding="0" align="center">
  <!--DWLayoutTable-->
  <tr>
    <td width="84" nowrap class="f1"><div align="right" class="style2">职工编号:</div></td>
    <td colspan="2" nowrap><div align="left"><span class="style14"><%=rs.getString("bh")%>
          <input name="bh" type="hidden" id="bh" value="<%=bh%>">
    </span></div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right" class="style2">职工姓名:</div></td>
    <td colspan="2" nowrap>	<div align="left"><%=rs.getString("xm")%>
        <input name="xm" type="hidden" id="xm" value="<%=rs.getString("xm")%>">
</div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right" class="style2">关系人姓名:</div></td>
    <td colspan="2" nowrap>
      <div align="left">
        <input name="gxxm" type="text" style=" BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 1px solid; BORDER-LEFT: rgb(80,139,220) 1px solid; BORDER-RIGHT: rgb(80,139,220) 1px solid; BORDER-TOP: rgb(80,139,220) 1px solid" maxlength="4">
      </div></td>
  </tr>
  <tr>
    <td nowrap class="f1"><div align="right" class="style2">与本人关系:</div></td>
    <td colspan="2" nowrap>
      <div align="left">
        <input name="ybrgx" type="text" style=" BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 1px solid; BORDER-LEFT: rgb(80,139,220) 1px solid; BORDER-RIGHT: rgb(80,139,220) 1px solid; BORDER-TOP: rgb(80,139,220) 1px solid" maxlength="4">
      </div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right" class="style2">政治面貌:</div></td>
    <td colspan="2" nowrap><div align="left">
      <select name="zzmm" id="select22">
          <option value="0">--未选择--</option>
          <option value="党员">党员</option>
          <option value="团员">团员</option>
          <option value="群众">群众</option>
          <option value="少先队员">少先队员</option>
      </select>
    </div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right" class="style2">工作单位:</div></td>
    <td colspan="2" nowrap>
      <div align="left">
        <input name="gzdw" type="text" style=" BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 1px solid; BORDER-LEFT: rgb(80,139,220) 1px solid; BORDER-RIGHT: rgb(80,139,220) 1px solid; BORDER-TOP: rgb(80,139,220) 1px solid" maxlength="10">
      </div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right">
      <div align="right" class="style2">职务工种:</div></td>
    <td colspan="2" nowrap>
      <div align="left">
        <input name="zwgz" type="text" style=" BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 1px solid; BORDER-LEFT: rgb(80,139,220) 1px solid; BORDER-RIGHT: rgb(80,139,220) 1px solid; BORDER-TOP: rgb(80,139,220) 1px solid" maxlength="10">
      </div></td>
  </tr>
  <tr>
    <td nowrapclass="f1"><div align="right" class="style2">备注:</div></td>
    <td colspan="2" nowrap><div align="left">
      <input name="bz" type="text" id="bz" maxlength="35">
</div></td>
  </tr>
  <tr>
    <td nowrap><div align="center">
      <input name="Submit" type="submit" id="Submit" value="提交" width="388">
    </div></td>
    <td width="98" nowrap >        
          <div align="center">           </div></td>
    <td width="76" nowrap ><div align="center">
      <input type="reset" name="Submit2" value="重置">
    </div></td>
  </tr>
</table>
<br>
</form>
<%	}%>
</body>
<jsp:include page="../checkout.jsp"></jsp:include>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?