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

📄 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();
	String uid = ds.toString((String)session.getAttribute("ID"));
	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 sql1 = " select a.*,b.name,c.id as backid,c.ifread,c.backs"
				+" from kjc_publish a,kjc_people b,kjc_back c "
				+" where a.model='1' "
				+"   and a.froms=b.id "
				+"   and a.id=c.objectid "
				+"   and c.backer="+(String)session.getAttribute("ID") + " "
				+" order by a.endtime desc,c.ifread,c.backs desc";
	Vector vect1 = myBean.getDataBySql(sql1);


	//我发送的
	String sql2 = " select a.*,b.name"
				+" from kjc_publish a,kjc_people b "
				+" where a.model='1' "
				+"   and a.froms=b.id "
				+"   and a.froms="+(String)session.getAttribute("ID") + " "
				+" order by a.endtime desc";


				
	String sql5 = "select a.name from kjc_role a,kjc_people b"
				+" where a.id=b.role "
				+"   and b.id="+uid;

	Vector vect2 = myBean.getDataBySql(sql2);
	Vector vect5 = myBean.getDataBySql(sql5);

	
%>
<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="10">&nbsp;</td>
    <td width="*"><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="30">&nbsp;</td>
  </tr>
</table>


<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10">&nbsp;</td>
    <td width="*">
      <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="10"><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="70" height="20" align=center>发布人</td>
          <td width="70" height="20" align=center>发布日期</td>
          <td width="70" height="20" align=center>有效日期</td>
          <td width="50" height="20" align=center>附件数</td>
          <td width="50" height="20" align=center>状态</td>
          <td height="20" align=center colspan="2">操作</td>
        </tr>
		<%
		int t = 0 ;
		for(int i=0;i<vect1.size();i++){
			Hashtable hash = (Hashtable)vect1.get(i);
			String id = (String)hash.get("id");
			String title = (String)hash.get("title") ;
			String froms = (String)hash.get("froms");
			String backid = (String)hash.get("backid");
			String name = (String)hash.get("name");
			String addtime = (String)hash.get("addtime");
			String endtime = (String)hash.get("endtime");
			String ifread = ds.toString((String)hash.get("ifread"));
			String backs = ds.toString((String)hash.get("backs"));

			//状态
			String status = ""; 
			if(!backs.equals(""))status = "<font color=#FF9933>已回</font>" ;
			else if(ifread.equals("1"))status = "<font color=#669933>已读</font>" ;
			else status = "<font color=red>未读</font>" ;

			//统计附件数
			String 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")));

			//显示为空
			if(title.equals(""))title = "&nbsp;";
			if(froms.equals(""))froms = "&nbsp;";
			if(name.equals(""))name = "&nbsp;";
			if(addtime.equals(""))addtime = "&nbsp;";
			if(endtime.equals(""))endtime = "&nbsp;";
		t++;
		%>
        <tr>
          <td height="20" align=center><%=(i+1)%></td>
          <td height="20"><a href="show.jsp?id=<%=id%>&backid=<%=backid%>"><%=title%></a></td>
          <td height="20" align=center><%=name%></td>
          <td height="20" align=center><%=addtime%></td>
          <td height="20" align=center><%=endtime%></td>
          <td height="20" align=center><%=count_file%></td>
          <td height="20" align=center><%=status%></td>
		  <td height="20" align=center colspan=2><a href="newback.jsp?id=<%=id%>&backid=<%=backid%>&title=<%=title%>">回复</a></td>
        </tr>
		<%
		}
		%>
		
<%if(vect5.toString().indexOf("普通教师")==-1){%>		
		<tr bgcolor="#FFFFFF" class="title_s">
          <td height="20" colspan="10"><div align="center">我发送的通知</div></td>
        </tr>
        <tr>
          <td align=center>序号</td>
          <td height="20" align=center>通知标题</td>
          <td height="20" align=center>发送给</td>
          <td height="20" align=center>发布日期</td>
          <td height="20" align=center>有效日期</td>
          <td height="20" align=center>附件数</td>
          <td align=center>反馈</td>
          <td align=center colspan="2">操作</td>
        </tr>
		<%
		t = 0 ;
		for(int i=0;i<vect2.size();i++){
			Hashtable hash = (Hashtable)vect2.get(i);
			String id = (String)hash.get("id");
			String title = (String)hash.get("title") ;
			String froms = (String)hash.get("froms");
			String name = (String)hash.get("name");
			String addtime = (String)hash.get("addtime");
			String endtime = (String)hash.get("endtime");
			
			//显示统计数
			String 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")));
			sql = "select count(id) as count from kjc_back where objectid="+id ;
			String count_back = ds.toString((String)(((Hashtable)(((Vector)myBean.getDataBySql(sql)).get(0))).get("count")));

			//显示为空
			if(title.equals(""))title = "&nbsp;";
			if(froms.equals(""))froms = "&nbsp;";
			if(name.equals(""))name = "&nbsp;";
			if(addtime.equals(""))addtime = "&nbsp;";
			if(endtime.equals(""))endtime = "&nbsp;";
		t++;
		%>
        <tr>
          <td height="20" align=center><%=(i+1)%></td>
          <td height="20"><a href="show.jsp?id=<%=id%>"><%=title%></a></td>
          <td height="20" align=center><%=count_back%>人</td>
          <td height="20" align=center><%=addtime%></td>
          <td height="20" align=center><%=endtime%></td>
          <td height="20" align=center><%=count_file%></td>
		  <td height="20" align=center><a href="listback.jsp?id=<%=id%>&title=<%=title%>">查看</a></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="30">&nbsp;</td>
  </tr>
</table>





</body>
</html>
<%	myBean.closeConn ( ) ;%>

⌨️ 快捷键说明

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