<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.system.SzOut" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.organize.*" %>
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
%>
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="type" value="<%=sType%>">
</form>
<%
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));

    SzPopedom szPopedom = new SzPopedom();
    boolean flag = false;
    String sUrl = "index.jsp";
    String sMessage = "";
    String sKEY = SzConvert.toZeroStr(request.getParameter("KEY"));
    flag = szPopedom.control(request, session);
    
    if (sOPERATOR.equals("deleteByModule")) {
        sUrl = "index_module.jsp";
    } else if (sOPERATOR.equals("deleteByPopedom")) {
        sUrl = "index_popedom.jsp";
    } 
    //更新权限
    SzPopedom.updatePopodomStatic();

    sMessage = SzOut.getMessage();

    if (flag) {
    	//自动刷新左侧菜单
    	out.println("<script language='javascript'>");
    	//out.println("window.top.szMenuFrame.reload();");
    	//取得
    	String sMKBH_TOP = SzConvert.toZeroStr((String)session.getAttribute("SzMKBH_TOP"));
    	out.println("parent.frames('szMenuFrame').document.location='../../main/menu.jsp?MKBH_TOP=" + sMKBH_TOP + "&Link_Default=../organize/popedom/index.jsp';");
    	out.println("</script>");
    	
        out.println(SzPageHelp.jsAlert("操作成功"));
        //out.println(SzPageHelp.jsGoUrl(sUrl));
        out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>
