<%@ halaman impor = "SQLDATA" %>
<%@ halaman import="java.sql.*" %>
<%@ halaman contentType="teks/html;charset=gb2312" %>
<jsp:useBean id="sqlbean" class="SQLDATA" scope="sesi"/>
<html>
<body background="../images/back.jpg">
<p align="center"><font size="6" face="楷体_GB2312">毛泽东思想概论</font></p>
<%
String aa,bb,cc,dd,ee,ff;
ResultSet rs=sqlbean.executeQuery("PILIH * DARI MAOGAI");
ke dalam i=1,j=0;
while(rs.next())
{
aa=rs.getString("SECTIONTYPE");
bb=rs.getString("NAMA BAGIAN");
cc=rs.getString("INDEXFILE");
ee=rs.getString("ZIPFILE");
ff=rs.getString("ONLINEFILE");
dd=rs.getString("SESSIONID");
if(aa.indexOf('章')>-1)
{
jika(j==1)
{
saya=saya+1;
keluar.println("</table></div>");
}
j=0;
keluar.println(" ");
out.println("<div align='center'>");
keluar.println("<pusat>");
out.println("<batas tabel='0' lebar='90%' tinggi='0' spasi sel='0' cellpadding='0'>");
keluar.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>");
}
kalau tidak
{
jika(j==0)
{
j=1;
out.println("<div style='display:none' id=div"+String.valueOf(i)+" align='center'>");
keluar.println("<pusat>");
out.println("<batas tabel='0' lebar='90%' tinggi='0' spasi sel='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>");
}
kalau tidak
{
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>");
}
}
}
%>
</tubuh>
</html>
<bahasa skrip=javascript>
fungsi ShowAndHide(namadiv,namaimg)
{
if (namadiv.gaya.display == "blok")
{
divname.style.display = "tidak ada";
imgname.src="../images/fclosed.gif";
diri.fokus();
}
kalau tidak
{
divname.style.display = "blok";
imgname.src="../images/fopen.gif";
diri.fokus();
}
}
</script>
转:http://www.cnjsp.org