<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.mail.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
	YjFold yjFold = new YjFold();
	String OPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
	if(OPERATOR.equals("add")){
		boolean flag = yjFold.add(request);
		if(flag){
			out.println("<script language='javascript'>alert('操作成功');</script>");
		}else{
			out.println("<script language='javascript'>alert('操作失败');history.go(-1);</script>");
		}
	}else if(OPERATOR.equals("delete")){
		boolean flag = yjFold.delete(request);
		if(flag){
			out.println("<script language='javascript'>alert('操作成功');</script>");
		}else{
			out.println("<script language='javascript'>alert('操作失败');history.go(-1);</script>");
		}
	}
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp"%>
<script language="javascript">
	function document.oncontextmenu(){
		return false;
	}
	function FormSave(){
		formUpdate.JJMC.value=formUpdate.JJMC.value.replace(/[\s\u3000]/g,'');
		if(formUpdate.JJMC.value==''){
			alert('文件夹名称不能为空');
			return false;
		}
		formUpdate.submit();
	}
</script>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.button("保存","javascript:FormSave();")%>
    </td>
  </tr>
</table>
<!-----信息维护------>
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <form name="formUpdate" method="post" action="mailFold.jsp?OPERATOR=add">
  <input type="hidden" name="JJDLID" value="<%=szDLID_SESSION%>">
  <tr>
    <td class="tdClassTitle">文件夹名称</td>
    <td width=200><input type="text" name="JJMC" class="txtClass1"></td>
  </tr>
  </form>
</table>
<!-----信息列表----->
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle">
    <td>文件夹名称</td>
    <td width="40">操作</td>
  </tr>
<%
	ArrayList<String[]> list = yjFold.getArrayList(iDLID_SESSION);
	int i = 0;
  for(String[] values:list) {
        i++;
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td><%=values[3]%>&nbsp;</td>    
    <td width="40">
      <a href="mailFold.jsp?OPERATOR=delete&KEY=<%=values[0]%>">删除</a>
    </td>
  </tr>
<%
    }
  if(i == 0){
  	out.println("<tr><td align=center colspan=2>没记录</td></tr>");
  }
%>
</table>
