grouplist.jsp

来自「一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs」· JSP 代码 · 共 136 行

JSP
136
字号
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.gs.util.*"%>
<%@page import="java.sql.*"%>
<%
try
{
//*****变量声明			
	String tempQuery = null;
	Statement stmt = null;
	String page_code="";
	
	ResultSet rs=null;
	int i=0;			
	int lognum=0;
	String logic_mark="";//组逻辑: 对应单元格编号		
	page_code=request.getParameter("page_code");
	
//*****连接数据库
	Connection con = Common.getConnection();
	//Statement s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); 
	stmt = con.createStatement();
	
	tempQuery="select logic_mark from universal_pageelement_define where page_code='"+page_code+"' and logic_mark is not null group by logic_mark";
	//out.println(tempQuery);
	rs = stmt.executeQuery(tempQuery);	
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<LINK href="style/webstyle.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form method="POST" action="" name=form1>
<input name=page_code value="<%=page_code%>" type="hidden">
  <p align="center">
  <b>&nbsp;组逻辑列表</b></p>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
      <td width="33%">选择</td>
      <td width="33%">对应单元格</td>
    </tr>
    <%
    while(rs.next()){
    lognum++;
    %>
    <tr>
      <td width="33%">  <input type="radio" value="<%=rs.getString(1)%>" checked name="C1"></td>
      <td width="33%"><%=rs.getString(1)%> </td>
    </tr>
    <%
    }
    %>
  </table>
  <p align="center">&nbsp;<input type="button" value="删除" name="B2" onclick="check(2)">
  <input type="button" value="修改" name="B3" onclick="check(3)"></p>
  <p align="center">单元格编号:<input type="text" name="T1" size="20"> <input type="button" value="添加" name="B1" onclick="check(1)"></p>
</form>
<script>
function check(num){	
var logic_mark,i
var lognum=<%=lognum%>
	if(num==1){
		if(document.form1.T1.value==""){alert("单元格编号不能为空!");return true;}		
		location="groupFrame.jsp?page_code=<%=page_code%>&logic_mark="+document.form1.T1.value;
	}
	if(num==2){
		if(!confirm('你确定要删除该组逻辑记录吗?')){
			return true;
		}
		if(lognum==0){
			alert("您不能删除空记录!");
			return true;
		}
		else{
			logic_mark=""		 
			if(document.form1.C1.length==null){
				logic_mark=document.form1.C1.value;
			}
			else{
				for(i=0;i<document.form1.C1.length;i++){		
					if(document.form1.C1[i].checked){
						logic_mark=document.form1.C1[i].value;
						i=document.form1.C1.lenght+1;
					}
				}
			}
		}
		document.form1.action="groupdell.jsp?logic_mark="+logic_mark;
		//alert(document.form1.C1.value);
		document.form1.submit();
	}
	if(num==3){
		if(lognum==0){
			alert("您不能修改空记录!");
			return true;
		}
		else{
			logic_mark=""		 
			if(document.form1.C1.length==null){
				logic_mark=document.form1.C1.value;
			}
			else{
				for(i=0;i<document.form1.C1.length;i++){			
					if(document.form1.C1[i].checked){
						logic_mark=document.form1.C1[i].value;
						i=document.form1.C1.lenght+1;
					}
				}
			}
		}
		location="groupFrame.jsp?page_code=<%=page_code%>&logic_mark="+logic_mark;
		
		
	}
}
</script>
</body>
</html>	
<%
	rs.close();
	stmt=null;
	con.close();
}
catch(Exception e)
{	
	out.println("<center>您的操作失败了!<br><br>错误原因:"+e.getMessage());
}
finally{
	try{
		//if(con != null) con.close();
	 }
	catch(Exception sqle){}
}
%>

⌨️ 快捷键说明

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