<%@ 페이지 가져오기 = "SQLDATA" %>
<%@ 페이지 가져오기="java.sql.*" %>
<%@ 페이지 contentType="text/html;charset=gb2312" %>
<jsp:useBean id="sqlbean" 클래스="SQLDATA" 범위="세션"/>
<html>
<body background="../images/back.jpg">
<p align="center"><font size="6" face="楷体_GB2312">毛泽东思想概论</font></p>
<%
문자열 aa,bb,cc,dd,ee,ff;
ResultSet rs=sqlbean.executeQuery("SELECT * FROM MAOGAI");
int i=1,j=0;
동안(rs.next())
{
aa=rs.getString("SECTIONTYPE");
bb=rs.getString("SECTIONNAME");
cc=rs.getString("INDEXFILE");
ee=rs.getString("ZIPFILE");
ff=rs.getString("온라인파일");
dd=rs.getString("세션ID");
if(aa.indexOf('章')>-1)
{
if(j==1)
{
나는=나는+1;
out.println("</table></div>");
}
j=0;
out.println(" ");
out.println("<div align='center'>");
out.println("<센터>");
out.println("<테이블 테두리='0' 너비='90%' 높이='0' 세포 간격='0' cellpadding='0'>");
out.println("<tr>");
out.println("<td height='0'><img name='img"+String.valueOf(i)+"' border='0' src='../images/fclosed.gif' onclick=' ShowAndHide(div"+String.valueOf(i)+","+"img"+String.valueOf(i)+")'>");
out.print(bb+"</td></tr></table></center></div>");
}
또 다른
{
if(j==0)
{
j=1;
out.println("<div style='display:none' id=div"+String.valueOf(i)+" align='center'>");
out.println("<센터>");
out.println("<테이블 테두리='0' 너비='90%' 높이='0' 세포 간격='0' cellpadding='0'>");
out.println("<tr><td height='30'> <img border='0' src='../images/file.gif'>");
out.print("<a href='windowsopen.jsp?indexfile=maogai/"+cc+"&sessionid="+dd+"&zipfile="+ee+"&onlinefile="+ff+"'>"+bb+"</a> </td></tr>");
}
또 다른
{
out.println("<tr><td height='30'> <img border='0' src='../images/file.gif'>");
out.print("<a href='windowsopen.jsp?indexfile=maogai/"+cc+"&sessionid="+dd+"&zipfile="+ee+"&onlinefile="+ff+"'>"+bb+"</a> </td></tr>");
}
}
}
%>
</body>
</html>
<스크립트 언어=자바스크립트>
함수 ShowAndHide(divname,imgname)
{
if (divname.style.display == "블록")
{
divname.style.display = "없음";
imgname.src="../images/fclosed.gif";
self.focus();
}
또 다른
{
divname.style.display = "블록";
imgname.src="../images/fopen.gif";
self.focus();
}
}
</script>
转:http://www.cnjsp.org