<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.flow.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
    //获取提交的参数
    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"));
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));  
    int iFormID = SzConvert.toInt(request.getParameter("FormID"));
    int iInfoID = SzConvert.toInt(request.getParameter("InfoID"));
    
%>
<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%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">  
  <input type="hidden" name="FormID" value="<%=iFormID%>"> 
  <input type="hidden" name="InfoID" value="<%=iInfoID%>">
</form>
<%
    LcAssistant sssistant  = new  LcAssistant();
    boolean flag = false;
    String sUrl = "index.jsp";
    String sMessage = "";
    if (sOPERATOR.equals("delete")) {        
        String id_str[] = request.getParameterValues("chkId");
        flag = sssistant.delete(id_str);
    } else {
        if (sOPERATOR.equals("add")) {
            flag = sssistant.add(request);
        } else if (sOPERATOR.equals("update")) {
            flag = sssistant.update(request);
        } else if (sOPERATOR.equals("press")) {
        	flag = sssistant.pass(request, session);
        	sUrl = "index_manage.jsp";
        }
    }
    sMessage = SzOut.getMessage();

    if (flag) {
        out.println(SzPageHelp.jsAlert("操作成功"));
        //out.println(SzPageHelp.jsGoUrl(sUrl));
        if (sOPERATOR.equals("press")) {
        	out.println(SzPageHelp.jsCloseWindow());	
        } else {
        	out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));	
        }
        
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>
