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

📄 list.jsp

📁 一个实现邮件收发功能的客户端程序
💻 JSP
📖 第 1 页 / 共 2 页
字号:
}


//=================
function setMailID(id)
{
	if(event.ctrlKey)
	{
		EmailID=id;
		if(form1.msgID.value !='')
			form1.msgID.value+=','+id;
		else
			form1.msgID.value=id;
	}
	else
	{
		EmailID=id;
		form1.msgID.value=id;
	}
}

//================
//排序
function doSort(fld)
{
	if(ListForm.field.value==fld){
		if(ListForm.orderType.value=='asc')
			ListForm.orderType.value='desc';
		else
			ListForm.orderType.value='asc';
	}
	ListForm.field.value=fld;
	ListForm.method="post";
	ListForm.submit();
}

//document.onselectstart =function () {return false;}

function Exec_Click(n){
	var SelectedId = '';
	var arrUsers = temp;
	var i = 0 ;

	if(form1.delid.value=='')// &&SelectedId == '')
	{
		alert('请先选择邮件!') ;
		return ;
	}
	SelectedId = form1.delid.value;
	if(SelectedId.indexOf(",")==0)
		SelectedId = SelectedId.substring(1);
	form1.delid.value = "";
	//alert(SelectedId)
	//  }
	switch(n) {
		case 0://移动到废件箱
			//form1.Actions.value=0;
			form1.msgID.value=SelectedId;
			form1.action='del1.jsp';
			form1.submit();
			break;
		case 1://彻底删除
			if(confirm('邮件将不可恢复,是否真的要永久删除此邮件?')){
				//form1.Actions.value=1;
				form1.msgID.value=SelectedId;
				form1.action='del.jsp';
				form1.submit();
			}
			break;
		case 2://查看邮件内容
		case 3://回复邮件
		case 4://转发邮件
			if(SelectedId.indexOf(',') == -1){
				switch(n) {
					case 2://查看邮件内容
						var urls='ShowMail.jsp?id='+SelectedId+'&uls=0';
						OpenWin(urls,'ShowMail',700,450);
						break;
					case 3://回复邮件
						self.location='replyForm.jsp?actions=RE&id='+SelectedId+"&uri=inbox";
						break;
					case 4://转发邮件
						self.location='replyForm.jsp?actions=FWD&id='+SelectedId+"&uri=inbox";
						break;
				}
			}
			else{
				alert('一次只能选择一个邮件!') ;
				return ;
			}
			break;
		case 5://移动邮件
			form1.Tombx.value=document.all('lstFolderList').value;
			form1.msgID.value=SelectedId;
			form1.action='MoveToMailBox.jsp';
			form1.method='post';
			form1.submit();
			break;
	}
}

function check(obj)
{
	var slt = form1.delid.value;

	if(obj.checked==true)
	{
		if(slt.indexOf(obj.value+",")<0)slt = slt+","+obj.value;
	}
	else
	{
		if(slt.indexOf(","+obj.value)>=0)slt = slt.replace(","+obj.value,"");
	}
	form1.delid.value = slt;
	//alert(form1.delid.value);
}
function checkAll(obj,value)
{
	for(var i=0;i<obj.length;i++)
	{
		if(value=="1")
		{
			if(obj[i].checked==false)obj[i].click();
		}
		else
		{
			if(obj[i].checked==true)obj[i].click();
		}
	}
}
function ck(obj)
{

	if(obj==undefined)return;
	if(form1.delall.checked)
	{
		form1.delall.value = "1";
		checkAll(obj,'1');
		//alert(form1.delid.value);
		
	}
	else
	{
		form1.delall.value = "0";
		checkAll(obj,'0');
		//alert(form1.delid.value);
	}
}
function showSet() {
	window.showModalDialog("set.jsp","addAccessory","dialogWidth:350px;dialogHeight:300px;help:no;status:no");
}
try {
<%if("inbox".equals(box)) {%>
parent.setStyle(0);
<%}else if("draftbox".equals(box)) {%>
parent.setStyle(1);
<%}else if("sendbox".equals(box)) {%>
parent.setStyle(2);
<%}else if("delbox".equals(box)) {%>
parent.setStyle(3);
<%}%>
}
catch(e) {
}
function refresh() {
	var url=location.href;
	var i=0;
	var j=0;
	var n=Math.random();
	j=url.lastIndexOf("?");
	if(j<0)
		location.replace(url+"?random="+n+"#");
	else {
		if(url.indexOf("random=")>0) {
			url=url.substr(0,url.indexOf("random="));
			location.replace(url+"random="+n+"#");
		}
		else {
			location.replace(url+"&random="+n+"#");
		}
	}
}
//-->
</SCRIPT>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#F2F1F2" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" scroll="no">
<TABLE cellSpacing=1 cellPadding=2>
  <TBODY>
  <tr>
  <td nowrap>
  <input type="button" value="看信" class="submit_1" onmouseover="this.className='submit_1_1'" onmouseout="this.className='submit_1'" onclick="location.replace('receive.jsp')">
  <input type="button" value="写信" class="submit_2" onmouseover="this.className='submit_2_1'" onmouseout="this.className='submit_2'" onclick="location.href='write.jsp'">
  <%if(!"delbox".equals(box)){%>
  <input type="button" value="删除" class="submit_3" onmouseover="this.className='submit_3_1'" onmouseout="this.className='submit_3'" onclick="doMoveToDel2()">
  <%}else{%>
  <input type="button" value="删除" class="submit_3" onmouseover="this.className='submit_3_1'" onmouseout="this.className='submit_3'" onclick="doDel2()">
  <%}%>
  <input type="button" value="设置" class="submit_4" onmouseover="this.className='submit_4_1'" onmouseout="this.className='submit_4'" onclick="showSet()">
  <input type="button" value="刷新" class="submit_6" onmouseover="this.className='submit_6_1'" onmouseout="this.className='submit_6'" onclick="refresh()">
  </td>
  <td>&nbsp;<img src="images/top_split.gif"/>&nbsp;
  </td>
  <td nowrap>
  <input type="button" value="转移到:" class="submit_5" onmouseover="this.className='submit_5_1'" onmouseout="this.className='submit_5'" onclick="doMove2()">
  </td>
  <td nowrap>
  <select name='newBox'>
  <%
  java.util.List boxlist=EmailManage.getMailBoxInfo(user.getUserName(),user.getServerDomain());
  for(int i=1;i<boxlist.size();i++) {
  	java.util.Map map=(java.util.Map)boxlist.get(i);
	if(!box.equals((String)map.get("id"))) {
  %>
  <option value='<%=map.get("id")%>'><%=map.get("name")%></option>
  <%}
  }%>
  </select>
  </td>
  </tr>
</tbody>
</table>
<table width="100%" height="95%"  border="0" cellpadding="0" cellspacing="0" bgcolor="ECF4F5">
  <FORM id='ListForm' name="ListForm" METHOD='POST' ACTION='list.jsp'>
	<input type="hidden" name="box" value="<%=box%>">
	<input type="hidden" name="easyJWebCommand" value="list">
	<input type="hidden" name="subCommand" value="">
	<input type="hidden" name="cid"   value="">
	<input type="hidden" name="mulitCid"   value="">	
	<input type="hidden" name="page"   value="<%=currentPage%>">
	<input name="field" type="hidden" value="">
    <input name="orderType" type="hidden" value="">
	<%--%>
	<tr>
          <td height="20" align="center">
		  <table height="20">
              <tr>
                <td nowrap class='coolbutton' onClick='doReply()' style="cursor:hand"><img src='images/replytogroup.gif' width='20' height='18' border='0' align='absmiddle'>回复</td>
                <td nowrap class='coolbutton' onClick='doForward()' style="cursor:hand"><img src='images/forward.gif' width='20' height='18' border='0' align='absmiddle'>转发</td>
				<%if(isMyMail) {%>
                <td align="center" nowrap class='coolbutton' onClick="doEdit()" style="cursor:hand"><img src='images/pm.gif' width='20' height='18' border='0' align='absmiddle'> 修改 </td><%}%>
				<td align="center" nowrap class='coolbutton' onClick='doMove();' style="cursor:hand">转移到
				<img src='images/right.gif' width='9' height='13' border='0' align='absmiddle'>
				</td>
				<td nowrap>
				<select name='newBox'>
				<%
				java.util.List boxlist=EmailManage.getMailBoxInfo(user.getUserName(),user.getServerDomain());
				for(int i=0;i<boxlist.size();i++) {
					java.util.Map map=(java.util.Map)boxlist.get(i);
				%>
				<option value='<%=map.get("id")%>'><%=map.get("name")%></option>
				<%}%>
				</select>
				</td>
                <td align="center" nowrap class='coolbutton' onClick='doDel()' style="cursor:hand"><img src='images/delete2.gif' width='20' height='18' border='0' align='absmiddle'> 永久删除 </td>
                <td nowrap class='coolbutton' onClick='doMoveToDel()' style="cursor:hand"><img src='images/delete2.gif' width='20' height='18' border='0' align='absmiddle'>删除</td>
                <td align="center" style="cursor:hand">选中全部
                <input type="checkbox" name="delall"  value="0" onClick="selectAll(this.checked);"></td>
              </tr>
      </table></td>
    </tr>
	<%--%>
	   <tr height="100%">
<td valign="top" height="100%">
<div style="overflow: auto;height:95%;width:100%;">
          <%--
		  %>
          <TABLE WIDTH='99%' height="100%" BORDER='1' bordercolor="C7D0D2" align='center' CELLPADDING='4' CELLSPACING='0' style="border-collapse: collapse" class="table1" background="images/table_headbg.gif">
            <th>
              <TR align="center" valign="middle"> 
                <Td height="20" nowrap><div style="height:20;width:100%;" align="center" >选择</div></td>
                <TD height="20" nowrap > <div style="height:20;width:100%;cursor:hand"  title="点击按是否已读排序" onClick="doSort('isRead')" align="center" >状态</div></TD>
                <TD height="20" nowrap ><div style="height:20;width:100%;" align="center" >附件</div></TD>
                <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按发件人排序" onClick="doSort('sendCID')" align="center">发件人</div></TD>
                <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按主题排序" onClick="doSort('subject')" align="center">主题 
                  </div></TD>
                <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按日期排序" onClick="doSort('sendTime')" align="center">日期</div></TD>
                <TD height="20" nowrap> <div style="height:20;width:100%;cursor:hand"  title="点击按大小排序" onClick="doSort('emailSize')" align="center">大小</div></TD>
              </TR>
            </th>
			<%--%>
          <TABLE WIDTH='100%' align='center' CELLPADDING='2' CELLSPACING='1' class="tableBorder">
            <tr align="center" class="tableHead">
                <TD width="5%" height="20" nowrap>
				选择<input type="checkbox" name="delall" value="0" onClick="selectAll(this.checked);"></TD>
                <TD width="5%" height="20" nowrap title="点击按是否已读排序" onClick="doSort('isRead')">状态</TD>
                <TD width="5%" height="20" nowrap>附件</TD>
                <TD width="25%%" height="20" nowrap title="点击按发件人排序" onClick="doSort('sendCID')">发件人</TD>
                <TD width="30%%" height="20" nowrap title="点击按主题排序" onClick="doSort('subject')">主题</TD>
                <TD width="20%" height="20" nowrap title="点击按日期排序" onClick="doSort('sendTime')">日期</TD>
                <TD width="15%" height="20" nowrap title="点击按大小排序" onClick="doSort('emailSize')">大小</TD>
            </tr>
            <%if(list!=null&&list.size()>0)
			for( int i=0;i<list.size();i++) {
				Map info=(Map)list.get(i);
				%>
            <TR bgcolor='F1F6F8'  id='<%=info.get("id")%>' > 
              <td align="center"> <input type="checkbox"   name="cids"  value="<%=info.get("id")%>" onClick="if(this.checked)selectRow(this.value);"> 
              </td>
              <TD align="center"><%if("true".equals(info.get("isNew"))){%> <img src="images/new2.gif" border="0"> <%}%> </TD>
              <TD align="center" style='word-break:break-all'><%if("true".equals(info.get("attachement"))){%><img src="images/paperclip.gif" border="0"> <%}%></TD>
              <TD><span style="word-break:break-all"><%=info.get("sender")%></span></TD>
              <TD><font color="#0000FF"><a href="show.jsp?cid=<%=info.get("id")%>&box=<%=box%>"><span style="word-break:break-all"><%="".equals(info.get("title"))?"[空]":info.get("title")%></span></a></font></TD>
              <TD align='center'><span style="word-break:break-all"><%=info.get("vdate")%></span></TD>
              <TD align='center'><span style="word-break:break-all"><%=info.get("mailSize")%></span></TD>
            </TR>
            
			<%}%>
          </TABLE>
</div>
 </td>
</tr>
	   
	   
        <tr>
          <td height="40" class="TableTitle" valign='top'><table bgcolor="#C1F9FD" class='cooltbl-b' width='100%' cellspacing='0' id='table_bar'>
              <tr bgcolor="#C1F9FD">
                <td height="100%" align='left' bgcolor="#FFFFFF"><table bgcolor="#FFFFFF" id='table_page' width="100%">
                    <tr>
                      <td nowrap><b><%=boxName%>: <%=rows%> 封邮件</b></td>
                      <td nowrap>&nbsp;</td>
                      <td nowrap><b> <%=newNum%>封邮件未读</b></td>
                      <td align='left' nowrap><%=showPageHtml%>
                        <table align="right" >
                        
                        </table></td>
                    </tr>
                </table></td>
              </tr>
			
          </table></td>
        </tr>
  </form>
</table>
</body>
</html>

⌨️ 快捷键说明

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