<%@ page contentType="text/html;charset=UTF-8" %>
<%@ 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"));

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

    sMessage = SzOut.getMessage();

    if (flag) {
    	
        out.println(SzPageHelp.jsAlert("操作成功"));
        //out.println(SzPageHelp.jsGoUrl(sUrl));
        out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));
        
    	//自动刷新左侧菜单
    	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>");        
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>
