⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rs_del_all.jsp

📁 JSP页面和oracle9i数据库的源代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ 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="";}
boolean page_ok=false;
if(session.isNew()){response.sendRedirect("../index.jsp");}
else
{	if(!page_type.equals("srs"))
	{	response.sendRedirect("../index.jsp");
	}	
	else
	{	page_ok=true;
	}
}
%>
<title>删除人事资料</title>
<script language="javascript">
function del_check()
{	if(confirm("删除后数据将无法恢复,您真的确定删除吗?")==true)
	{	return true;}
	else
	{	return false;}
}
</script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style4 {font-size: 14px}
.style2 {font-size: 24px;
	color: #FFFFFF;
}
.style5 {color: #FFFFFF; font-size: 14px; }
body {
	background-image: url(../img/011qq.gif);
}
-->
</style>
</head>
<body>
<%if(page_ok==true){%>
<jsp:useBean id="conn" scope="page" class="beans.conn"/>
<div align="center">
  <%@ page import="java.util.Calendar"%>
  <%String meb=response.encodeURL("rs_del_all.jsp");%>
  <%	String del_check="select * from ZGXX";
	conn.setcondition(del_check);
	ResultSet rs_del_check=conn.getrs();
	String startNO=request.getParameter("pageNO");
	if(startNO==null){startNO="0";}
	int startNO_c=Integer.parseInt(startNO);
	String del_bh=null;
	if(startNO_c==0){}
	else
	{	for(int m=0;m<(startNO_c-1)*10;m++){rs_del_check.next();}
		for(int k=0;k<10;k++)
		{	if(!rs_del_check.next()){break;}
			del_bh=request.getParameter(rs_del_check.getString("BH"));
			if(del_bh!=null)
			{	String del_condition="delete from zgxx where bh='"+del_bh+"'";
				conn.setcondition(del_condition);
				String del_result=conn.update();
				if(del_result.equals("更新成功"))
				{	del_condition="delete from shgx where bh='"+del_bh+"'";
					conn.setcondition(del_condition);
					del_result=conn.update();
					del_condition="delete from jtcy where bh='"+del_bh+"'";
					conn.setcondition(del_condition);
					del_result=conn.update();
					del_condition="delete from grjl where bh='"+del_bh+"'";
					conn.setcondition(del_condition);
					del_result=conn.update();
					del_condition="delete from bzk where bh='"+del_bh+"'";
					conn.setcondition(del_condition);
					del_result=conn.update();
				}
			}
		}
	}
%>
    <a <%String meb_main=response.encodeURL("../index/rs_index.jsp");%>href="<%=meb_main%>">返回主菜单</a>
  <%	String bh=request.getParameter("bh");
	if(bh==null){bh="";}
	String condition="select * from ZGXX";
	conn.setcondition(condition);
	ResultSet rs_all=conn.getrs();
	rs_all.last();
	int all=rs_all.getRow();
	String pageNO=request.getParameter("pageNO");
	if(pageNO==null){pageNO="1";}
	int pageNO_c=Integer.parseInt(pageNO);
	int pagecount=10,pageall=0,k=0;
	if(all<=pagecount){pageall=1;}
	else
	{	int lastcount=0;
		lastcount=all%pagecount;
		if(lastcount==0){pageall=all/pagecount;}
		else{pageall=all/pagecount+1;}
	}
	if(pageNO_c>pageall){pageNO="1";pageNO_c=1;}
	out.print("数据库内共有"+all+"个职工记录");
	rs_all.beforeFirst();
	if(all==0){}
	else
	{%>	
</div>
<table align="center">
  <tr align="center" valign="top">
    <td valign="baseline" nowrap><%if(all!=0){out.print("第");out.print(pageNO_c);out.print("页:");}%></td>
    <td valign="baseline" nowrap>
      <%if(pageall>1){%>
      <form action="<%=meb%>" method="post">
        <div align="center"> 跳转到
            <select name="pageNO">
              <%for(k=1;k<=pageall;k++){%>
              <option value="<%=k%>">第<%=k%>页</option>
              <%}%>
            </select>
            <input name="确定" type="submit" value="确定">
        </div>
      </form>
      <%}%></td>
    <td valign="baseline" nowrap>
      <%if(pageNO_c>1){String page_send=Integer.toString(1);%>
      <form name="first" method="post" action="<%=meb%>?pageNO=<%=page_send%>">
        <input name="first" type="submit" id="first" value="第一页" style="BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 2px solid; BORDER-LEFT: rgb(255,255,255) 2px solid; BORDER-RIGHT: rgb(255,255,255) 2px solid; BORDER-TOP: rgb(255,255,255) 2px solid">
      </form>
      <%}%>
    </td>
    <td valign="baseline" nowrap>
      <%if(pageNO_c>1){String page_send=Integer.toString(pageNO_c-1);%>
      <form name="before" method="post" action="<%=meb%>?pageNO=<%=page_send%>">
        <input name="before" type="submit" id="before" value="上一页"style="BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 2px solid; BORDER-LEFT: rgb(255,255,255) 2px solid; BORDER-RIGHT: rgb(255,255,255) 2px solid; BORDER-TOP: rgb(255,255,255) 2px solid">
      </form>
      <%}%>
    </td>
    <td valign="baseline" nowrap>
      <%if(pageNO_c<pageall){String page_send=Integer.toString(pageNO_c+1);%>
      <form name="next" method="post" action="<%=meb%>?pageNO=<%=page_send%>">
        <input name="next" type="submit" id="next" value="下一页"style="BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 2px solid; BORDER-LEFT: rgb(255,255,255) 2px solid; BORDER-RIGHT: rgb(255,255,255) 2px solid; BORDER-TOP: rgb(255,255,255) 2px solid">
      </form>
      <%}%>
    </td>
    <td valign="baseline" nowrap>
      <%if(pageNO_c<pageall){String page_send=Integer.toString(pageall);%>
      <form name="last" method="post" action="<%=meb%>?pageNO=<%=page_send%>">
        <input name="last" type="submit" id="last" value="最后页"style="BACKGROUND-COLOR: rgb(255,255,255); BORDER-BOTTOM: rgb(80,139,220) 2px solid; BORDER-LEFT: rgb(255,255,255) 2px solid; BORDER-RIGHT: rgb(255,255,255) 2px solid; BORDER-TOP: rgb(255,255,255) 2px solid">
      </form>
      <%}%>
    </td>
    <td valign="baseline" nowrap>
      <%if(all!=0){out.print("共");out.print(pageall);out.print("页");}%></td>
  </tr>
</table>
	<form <%String page_sendto=Integer.toString(pageNO_c);%>action="<%=meb%>?pageNO=<%=page_sendto%>" method="post" name="del_tj" id="del_tj" onSubmit="return del_check()">
		  <table border="1" align="center" cellspacing="1" bordercolor="#FF99CC">
	<%	for(k=0;k<(pageNO_c-1)*pagecount;k++){rs_all.next();}%>
	<%	for(k=0;k<pagecount;k++)
		{	if(!rs_all.next()){break;}
			if(!bh.equals(rs_all.getString("BH")))
			{%>	
			<tr>
			  <td nowrap bgcolor="#FF99CC"><input name="<%=rs_all.getString("BH")%>" type="checkbox" id="<%=rs_all.getString("BH")%>" value="<%=rs_all.getString("BH")%>"></td>
			  <td height="20" nowrap bgcolor="#FF99CC"><div align="left" class="style4"><span class="style1">编号:</span></div></td>
			  <td height="20" nowrap><%=rs_all.getString("BH")%></td>
			  <td height="20" nowrap bgcolor="#FF99CC"><div align="left" class="style4"><span class="style1">姓名:</span></div></td>
			  <td height="20" nowrap><%=rs_all.getString("XM")%></td>
			  <td height="20" nowrap bgcolor="#FF99CC"><div align="left" class="style4"><span class="style1">性别:</span></div></td>
			  <td height="20" nowrap><%=rs_all.getString("XB")%></td>
			  <td height="20" nowrap bgcolor="#FF99CC"><div align="left" class="style4"><span class="style1">年龄:</span></div></td>
			  <td height="20" nowrap><%	Calendar birthday=Calendar.getInstance();	

⌨️ 快捷键说明

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