forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoodsType.jsp
More file actions
95 lines (95 loc) · 3.61 KB
/
goodsType.jsp
File metadata and controls
95 lines (95 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="conn" scope="page" class="com.tools.ConnDB"/>
<%
ResultSet rs_superType=conn.executeQuery("select ID,superType from V_Type group by ID,superType order by superType desc");
%>
<table width="186" height="47" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="47"><img src="images/left_type.gif" width="186" height="47"></td>
</tr>
</table>
<table width="186" height="312" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder">
<tr>
<td height="400" valign="top"><table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
<tr><td height="9pt"></td></tr>
<%
int ID_superType=0;
String superType="";
int m=1;
while(rs_superType.next()){
ID_superType=rs_superType.getInt(1);
superType=rs_superType.getString(2);
String sql="select * from V_Type where ID="+ID_superType;
ResultSet rs_subType=conn.executeQuery(sql);
String subType="";
int subID=0;
//获取记录总数
rs_subType.last();
int subType_RC=rs_subType.getRow();
rs_subType.first();
%>
<tr>
<td><%
if(subType_RC<=0){
%>
<img src="images/jian_null.gif" width="38" height="16" border="0"> <%=superType%>
<%
}else{
%>
<a href="Javascript:ShowTR(img<%=m%>,OpenRep<%=m%>)"><img src="images/jia.gif" border="0" alt="展开" id="img<%=m%>"></a> <a href="Javascript:ShowTR(img<%=m%>,OpenRep<%=m%>)"><%=superType%></a>
<%
}
%> </td>
<%if (subType_RC>0){%>
<tr id="OpenRep<%=m%>" style="display:none;">
<td colspan="6"><%do{
subType=rs_subType.getString(3);
subID=rs_subType.getInt(4);
%>
<table width="100%" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td height="25" align="center"><table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr onMouseOver="this.style.background='#EEEEEE'" onMouseOut="this.style.background=''">
<td width="15%"> </td>
<td width="10%" align="center"><img src="images/folder.gif" width="16" height="16" border="0"> </td>
<td width="75%"><a href="type.jsp?Type=<%=subID%>"><%=subType%></a></td>
</tr>
</table></td>
</tr>
</table>
<% m++; //注意,该条语句一定不能少
}while(rs_subType.next());
%> </td>
<%}%>
</tr>
<% }%>
</table> </td>
</tr>
<tr>
<td valign="top"><table width="100%" height="119" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="60" align="center"><img src="images/ggzs_blue.gif" width="176" height="50"></td>
</tr>
<tr>
<td height="60" align="center"><img src="images/ggzs_green.gif" width="176" height="50"></td>
</tr>
<tr>
<td height="60" align="center"><img src="images/ggzs_blue.gif" width="176" height="50"></td>
</tr>
</table></td>
</tr>
</table>
<script language="javascript">
ShowTR(img1,OpenRep1); //设置第1个节点为展开状态
function ShowTR(objImg,objTr){
if(objTr.style.display == ""){
objTr.style.display = "none";
objImg.src = "images/jia.gif";
objImg.alt = "展开";
}else{
objTr.style.display = "";
objImg.src = "images/jian.gif";
objImg.alt = "折叠";
}
}
</script>