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

📄 message_receive.jsp

📁 在系统开发过程中用到了javabean和jsp技术
💻 JSP
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.util.Date,java.text.*,oa.main.DealString"%>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title> 短消息</title>
<link href="../css/css1.css" type=text/css rel=stylesheet>
<link rel="stylesheet" href="../css/sms.css" type="text/css">
<script language="javascript" src="../scripts/department.js"></script>
</head>
<%
oa.bean.SmsBean myBean = null;
try{
	myBean = new oa.bean.SmsBean(); 
	DealString ds=new DealString();
	//取得菜单类别
	String strType = ds.toString((String)request.getParameter("txt_type"));
	//职工编号
	String strPersonNo = ds.toString((String)request.getParameter("txt_personno"));
	//if(strPersonNo.equals(""))
	{
		strPersonNo = (String)session.getAttribute("zgbh");
	}
	//增删改类型
	String strEdit = ds.toString((String)request.getParameter("txt_edit"));
	//错误码
	String errcode = ds.toString((String)request.getParameter("errcode"));
	if(errcode.equals(""))errcode = "0";
	if(!errcode.equals("0")){
		response.sendRedirect("../err.jsp?ip=person/person.jsp&txt_type="+strType+"&errcode="+errcode);
		return;
	}
%>
<center>
<body class="bgl">
<br>
<br>
<script>
//浮动层
		var IE5=(document.getElementById&&document.all)?true:false;
		var W3C=(document.getElementById)?true:false;
		var currIDb=null,currIDs=null,xoff=0,yoff=0;zctr=0;totz=0;

	
	function trackmouse(evt)
	{
		if((currIDb!=null)&&(currIDs!=null))
		{
			var x=(IE5)?event.clientX+document.body.scrollLeft:evt.pageX;
			var y=(IE5)?event.clientY+document.body.scrollTop:evt.pageY;
			currIDb.style.left=x+xoff+'px';
			currIDs.style.left=x+xoff+10+'px';
			currIDb.style.top=y+yoff+'px';
			currIDs.style.top=y+yoff+10+'px';
			return false;
		}
	}

	function stopdrag()
	{
		currIDb=null;
		currIDs=null;
		NS6bugfix();
	}

	function grab_id(evt)
	{
		xoff=parseInt(this.IDb.style.left)-((IE5)?event.clientX+document.body.scrollLeft:evt.pageX);
		yoff=parseInt(this.IDb.style.top)-((IE5)?event.clientY+document.body.scrollTop:evt.pageY);
		currIDb=this.IDb;currIDs=this.IDs;
	}

	function NS6bugfix()
	{
		if(!IE5)
		{
			self.resizeBy(0,1);
			self.resizeBy(0,-1);
		}
	}

	function incrzindex()
	{
		zctr=zctr+2;
		this.subb.style.zIndex=zctr;
		this.subs.style.zIndex=zctr-1;
	}

	function createPopup(id,title,width,height,x,y,isdraggable,boxcolor,barcolor,shadowcolor,text,textcolor,textptsize,textfamily,strid,isread)
	{
		if(W3C)
		{
			zctr+=2;
			totz=zctr;
			var txt='';
			txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+10)+'px; top:'+(y+10)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=0); visibility:hidden">&nbsp;</div>';
			txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 1px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:show; height:'+height+'px; background-color:'+boxcolor+'; visibility:hidden">';
			txt+='<div style="filter:alpha(opacity=100,FinishOpacity=40,Style=1);width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5?width-4:width)+'"><tr style="cursor:hand;"><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px sans-serif; color:'+textcolor+'"><img src="../../image/detail.gif">&nbsp;'+title+'</div></td><td align="right"><a title="关闭" style="cursor:hand;" onmousedown="document.getElementById(\''+id+'_s\').style.visibility=\'hidden\';document.getElementById(\''+id+'_b\').style.visibility=\'hidden\';edit(\''+strid+'\',\''+isread+'\');return false"><img src="../../image/close_o.gif" border="0" height="15" width="15"></a></td></tr></table></div>';
			txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:2px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';"><table><tr><td width=2></td><td>'+text+'</td></tr></table></div></div>';document.write(txt);
			
			this.IDh=document.getElementById(id+'_h');			
			this.IDh.IDb=document.getElementById(id+'_b');
			this.IDh.IDs=document.getElementById(id+'_s');
			this.IDh.IDb.subs=this.IDh.IDs;
			this.IDh.IDb.subb=this.IDh.IDb;
			this.IDh.IDb.IDov=document.getElementById(id+'_ov');
			if(IE5)
			{
				this.IDh.IDb.IDov.style.width=width-6;
				this.IDh.IDb.IDov.style.height=height-22;
				this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
				this.IDh.IDb.IDov.style.overflow="auto";
			}
			else
			{
				this.IDh.IDs.style.MozOpacity=.5;
			}
			this.IDh.IDb.onmousedown=incrzindex;
			if(isdraggable)
			{
				this.IDh.onmousedown=grab_id;
				this.IDh.onmouseup=stopdrag;
			}
		}
	}

	if(W3C)
			document.onmousemove=trackmouse;
		if(!IE5&&W3C)
			window.onload=NS6bugfix;
</script>
<TABLE class="tab" border="0" width="95%" cellspacing="0" cellpadding="0" height="22" bgcolor=#ffffff>
  <TR align=center>			
    <TD>
	  <FONT color="#000099" size=3><b>已收到短消息</b></FONT> 
	</TD>
  </TR>
</TABLE>

<table class="tab" width="95%" align="center" cellSpacing=1 cellPadding=5 bgColor=#999999
style="word-break:break-all;">
  <TR bgcolor="#2969b5" height="22">
	<td width=20>&nbsp;</td>
    <TD align=center width="30"><font color="#ffffff"><B>序号</B></font></td>
    <TD align=center width="60"><font color="#ffffff"><B>发送者</B></font></td>
    <TD align=center><font color="#ffffff"><B>消息标题</B></font></td>
	<TD align=center width="110"><font color="#ffffff"><B>发送时间</B></font></td>
	<TD align=center width="60"><font color="#ffffff"><B>当前状态</B></font></td>
	<TD align=center width="110"><font color="#ffffff"><B>操作</B></font></td>
  </TR>
  <TR bgColor=#ffffff>
    <TD colSpan=6 height=15 align=right>〖<a onclick="changepage11();" style="cursor:hand;"><font color=#cc0000>查看已发送短消息</font></a>〗</TD>
	<TD align="center"><FONT color="#FF6600">
	  <A onclick="changepage11('1');" style="cursor:hand;"></A> </FONT>
	<FONT color="#FF6600">
	  <A onclick="add('0');" style="cursor:hand;">发送短消息</A> </FONT></TD>
  </TR>
  <%
  myBean.setReceiveUID(strPersonNo);
  Vector vect = myBean.getReceiveSMS();
  for(int i=1;i<=vect.size();i++)
  {
	  Hashtable hash = (Hashtable)vect.get(i-1);
	  String id = (String)hash.get("ID");
	  String name = (String)hash.get("NAME");
	  String title = (String)hash.get("TITLE");
	  String content = (String)hash.get("CONTENT");
	  String sendtime = (String)hash.get("SENDTIME");
	  String isread = (String)hash.get("ISREAD");
  	  String zgbh = (String)hash.get("ZGBH");


	  String col = "#ffffff";
	  if(i%2==0)col = "#d0e7ff";

	  String color = "#ff0000";
	  String is = "未收阅";
	  if(isread.equals("1"))
	  {
		  color = "#338800";
		  is = "已收阅";
	  }
  %>
  <TR bgcolor="<%=col%>">
  <td><input type=checkbox name=checkboxid id="<%=id%>" value="<%=isread%>"></td>
    <TD align=center><a><%=i%></a></td>
    <TD><a onclick="add('<%=zgbh+","+name%>')" style="cursor:hand;"><%=name%></a>
	<script>
		createPopup('box<%=i%>','消息内容',260,180,213,141,true,'#CCCCCC','#003391','800000','<img src="../../image/shuji.gif" border="0" width="18" height="17">&nbsp;<font color="#0033CC">来自:</font><font color="#0033CC"><%=name%></font><br><font color="#0033CC">当前状态:</font><font color="#0033CC"><%=is%></font><br><font color="#0033CC">发送时间:</font><font color="#0033CC"><%=sendtime%></font><br><font color="#0033CC">消息标题:</font><font color="#0033CC"><%=title%></font><br><font color="#0033CC">消息内容:</font><font color="#0033CC"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;<%=content.replaceAll("&","&amp;").replaceAll(">","&gt;").replaceAll("<","&lt;").replaceAll("\r\n","<br>").replaceAll(" ","&nbsp;")%></font><br>','FFFFFF',9,'宋体','<%=id%>','<%=isread%>');
	</script>
	</td>
	<TD><a onclick="view('box<%=i%>');" style="cursor:hand;" onmouseover="this.style.color='#0000ff';this.style.textDecoration ='underline';" onmouseout="this.style.color='#000000';this.style.textDecoration ='none';"><%=title%></a></td>
	<TD><%=sendtime%></td>
	<TD align="center"><FONT color="<%=color%>"><%=is%></font></td>
	<td align="center">
	<FONT color="#338800">
	  <a onclick="del('<%=id%>','<%=isread%>');" style="cursor:hand;">【删除】</a>
    </FONT>
	</td>
	</tr>
<%
  }
if(vect.size()>=1){%>	
	<tr>
		<TD align=left colspan=20>
<%if(vect.size()>=2){%>
			<input type=button value="全选" name=selall onclick="selectall();" style="cursor:hand;">&nbsp&nbsp&nbsp
<%}%>
			<input type=button value="删除" onclick="return remove();" style="cursor:hand;">&nbsp;&nbsp;
			<input type=button value="清空收到的消息" onclick="clearmsg();" style="cursor:hand;"></td>
	</tr>
<%}%>

	

 </table>
<br><br>
</center>
<script>
	function changepage11()
	{
		document.all.txt_type.value = "5";
		document.all.txt_edit.value = "2";// 1:添加 2:修改 3:删除 4:列表查看 5:日历查看
		document.all.form1.action = "person.jsp";//将txt_type.value, txt_edit.value提交给person.jsp
		document.all.form1.submit();
	}
	function view(id)
	{
		var id1 = id + "_s";
		var id2 = id + "_b";
		var downrows = document.all.tags("div");
		for(var i=0;i<downrows.length;i++)
		{
			if(downrows[i].id==id1)
			{
				downrows[i].style.visibility="visible";
			}
			if(downrows[i].id==id2)
			{
				downrows[i].style.visibility="visible";
			}
		}
	}
	function add(strValues)
	{
		document.all.txt_type.value = "5";
		document.all.txt_edit.value = "3";
		document.all.txt_rcxh.value = "";
		//document.all.txt_receiver.value = strValues;
		if (strValues!=0)
			document.all.form1.action = "person.jsp?txt_receiver="+strValues;//将txt_type, txt_edit, txt_rcxh的值提交给person.jsp
		document.all.form1.submit();
	}

	function del(rcxh,isread)
	{
		var strconfirm="";
		if(isread=="1")
			strconfirm="真的要删除吗?";
		else
			strconfirm="此条短信还未被您收阅,真的要删除吗?";
		if(confirm(strconfirm))
		{
			document.all.txt_type.value = "5";
			document.all.txt_edit.value = "5";
			document.all.txt_rcxh.value = rcxh;
			document.all.txt_paixu.value="1";
			document.all.form1.action = "../../PerSvlt";
			document.all.form1.submit();
		}
	}

	function edit(rcxh,isread)
	{
		if(isread=="0")
		{
			document.all.txt_type.value = "5";
			document.all.txt_edit.value = "7";
			document.all.txt_rcxh.value = rcxh;
			parent.left.document.all.cyclecount.value--;
			document.all.form1.action = "../../PerSvlt";//将txt_type, txt_edit, txt_rcxh的值提交给person.jsp
			document.all.form1.submit();
		}
	}
	function selectall()
	{
		var num = document.all.checkboxid.length;
		if(document.all.selall.value == "全选")
		{
			for(var i=0;i<num;i++)
			{
				document.all.checkboxid[i].checked = true;	
			}
			document.all.selall.value = "取消全选";
		}
		else
		{
			for(var i=0;i<num;i++)
			{
				document.all.checkboxid[i].checked = false;	
			}
			document.all.selall.value = "全选";
		}
	}
	function remove()
	{
		var delid = "";
		var num = <%=vect.size()%>;
		if(num==1)
	    {
			if(document.all.checkboxid.checked==true)
				delid = document.all.checkboxid.id;
		}
		if(num>=2)
		{
			var numid = document.all.checkboxid.length;
			for(var i=0;i<numid;i++)
			{
				if(document.all.checkboxid[i].checked == true)
				{
					if(delid == "")
					{
						delid = document.all.checkboxid[i].id;
					}
					else
					{
						delid = delid+","+document.all.checkboxid[i].id;
					}
				}
			}
		}
		if(delid=="")
		{
			alert("请选择要删除的消息记录!");
			return false;
		}
		if(!confirm("是否真的要删除?"))
		{
			return false;
		}
		document.all.txt_type.value = "5";
		document.all.txt_edit.value = "1";
		document.all.txt_rcxh.value = delid;
		document.all.txt_paixu.value="1";
		document.all.form1.action = "../../PerSvlt";
		document.all.form1.submit();
	}
	function clearmsg(){
		if(!confirm("是否真的要删除所有已收到的消息?"))
		{
			return false;
		}
		document.all.txt_type.value = "5";
		document.all.txt_edit.value = "2";
		document.all.txt_paixu.value="1";
		document.all.form1.action = "../../PerSvlt";
		document.all.form1.submit();
	}
</script>

<SCRIPT language=javascript>  
	//鼠标滚动代码------------------------------------------------
	//----------------------------------------------------------
			lastScrollX = 0; 
			lastScrollY = 0; 
 
			function heartBeat() 
			{ 
				diffY = document.body.scrollTop; 
				diffX = document.body.scrollLeft;
				
				if(diffY != lastScrollY) 
				{                 
					percent = .1 * (diffY - lastScrollY);                 
					if(percent > 0) percent = Math.ceil(percent);                 
					else percent = Math.floor(percent); 

					var divs = document.all.tags("div");
					for(var i=0;i<divs.length;i++)
						divs.item(i).style.pixelTop += percent;  
					
					lastScrollY = lastScrollY + percent;    
				} 
				if(diffX != lastScrollX) 
				{
					percent = .1 * (diffX - lastScrollX); 
					if(percent > 0) percent = Math.ceil(percent); 
					else percent = Math.floor(percent);

					var divs = document.all.tags("div");
					for(var i=0;i<divs.length;i++)
						divs.item(i).style.pixelLeft += percent; 

					lastScrollX = lastScrollX + percent; 
				} 
			} 
			
			
			action = window.setInterval("heartBeat()",1); 
</SCRIPT>




</BODY>
<%}finally{
	if(myBean!=null)myBean.closeConn();
}%>
</HTML>

⌨️ 快捷键说明

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