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

📄 list.jsp

📁 运用jdk
💻 JSP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*"%>
<%


	com.util.DealString ds = new com.util.DealString();
	com.db.CommonBean myBean = new com.db.CommonBean();
	String delid = ds.toString(request.getParameter("id")) ;

	//删除
	if(!delid.equals(""))myBean.getDataBySql("delete from kjc_publish where id="+delid);

	String sql = " select a.* from kjc_publish a "
				+" where a.model='6' "
				+" order by a.addtime desc";
	Vector vect = myBean.getDataBySql(sql);
	myBean.closeConn ( ) ;
%>
<html>
<head>
<link rel=stylesheet href="../index.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>相关文件</title>
</head>
<body>
<table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="40">&nbsp;</td>
    <td width="910"><table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="20" class="title_s">&nbsp;您已登陆: <%=ds.toString((String)session.getAttribute("NAME"))%> </td>
        </tr>
        <tr>
          <td height="5" bgcolor="#A3BED9"></td>
        </tr>
        <tr>
          <td height="1" bgcolor="#0A1870"></td>
        </tr>
    </table></td>
    <td width="50">&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="40">&nbsp;</td>
    <td width="910">
      <table class="main_w" width="100%"  border="1" cellpadding="4" cellspacing="0" bordercolor="FFFFFF" bgcolor="E7F2FF">
        <tr bgcolor="#FFFFFF" class="title_s">
          <td height="20" colspan="8"><div align="center">已有相关文件列表
          </div>            <div align="center"></div></td>
        </tr>
        <tr>
          <td width="25" align=center>序号</td>
          <td width="*" height="20" align=center>相关文件标题</td>
          <td width="50" height="20" align=center>发布人</td>
          <td width="60" height="20" align=center>发布日期</td>
          <td width="40" height="20" align=center>文件数</td>
          <td height="20" align=center colspan="2">操作</td>
        </tr>
		<%
		int t = 0 ;
		String uid = ds.toString((String)session.getAttribute("ID"));
		for(int i=0;i<vect.size();i++){
			Hashtable hash = (Hashtable)vect.get(i);
			String id = (String)hash.get("id");String froms = (String)hash.get("froms");


			if(froms==null)froms="";
			String fromsname = "";
			if(!froms.equals(""))fromsname = myBean.toName("kjc_people","id","name",froms);
			
			String title = (String)hash.get("title") ;


			//统计附件数
			sql = "select count(id) as count from kjc_file where objectid="+id ;
			String count_file = ds.toString((String)(((Hashtable)(((Vector)myBean.getDataBySql(sql)).get(0))).get("count")));
		t++;
		%>
        <tr>
          <td height="20"><%=(i+1)%></td>
          <td height="20"><a href="show.jsp?id=<%=id%>"><%=title%></a></td>
          <td height="20" align=center><%=fromsname%></td>
          <td height="20" align=center><%=(String)hash.get("addtime")%></td>
          <td height="20" align=center><%=count_file%></td>
          <td height="20" align=center width=25><%if(froms.equals(uid)){%><a href="new.jsp?id=<%=id%>&mod=mod">修改</a><%}else{%>&nbsp;<%}%></td>
          <td height="20" align=center width=25><%if(froms.equals(uid)){%><a href="list.jsp?id=<%=id%>">删除</a><%}else{%>&nbsp;<%}%></td>
        </tr>
		<%
		}
		%>
    </table></td>
    <td width="50">&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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