<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_MENU"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.ejb.sys.SecurityService" %>

<%@ page import = "java.lang.Object"%>

<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
BPIP_MENU[] menu = null;
SecurityService MenuService =new SecurityService();

String strPARENTNO = request.getParameter("Menu_No");
String SelectedItems = request.getParameter("SelectedItems");
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<LINK type="text/css" rel="stylesheet" href="../../zrsysmanage/html5/css/style_tables.css">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<%}%>

<SCRIPT LANGUAGE="javascript">
function Check(theForm)
{
  if ((trim(theForm.MENUNAME.value)=="")){
    <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('菜单名称不能为空！', {icon: 7});
      <%}else{%>
       alert("菜单名称不能为空！");
       <%}%>
    theForm.MENUNAME.focus();
    return false;
  }
  RegForm.Act.value='edit';
  return true;
}
function Check1(theForm)
{

   <%if("6".equals(user.getUserWINDOWTYPE())){ %>
       layer.confirm('确定要删除当前选中的类别吗？', {
      btn: ['确定','取消'] //按钮
      }, function(index){
         RegForm.Act.value='delete';
         document.RegForm.submit();
      }, function(){
      });
      <%}else{%>
       if (confirm("确定要删除吗？"))
  {RegForm.Act.value='delete';
  return true;}
  else
  {return false;}
       <%}%>
}
</SCRIPT>
</HEAD>
<%
String strWhere = strWhere = " where MENUNO = '"+SelectedItems+"'";
menu = MenuService.GetMenuList(strWhere);
%>
<BODY class="BodyMain">
<FORM name="RegForm" method="post" action="../../actionmenu.do">
<input type="hidden" name="MENUNO" value="<%=SelectedItems%>">
<input type="hidden" name="PARENTNO" value="<%=strPARENTNO%>">
<input type="hidden" name="ISPOWER" value="<%=menu[0].getISPOWER()%>">
<input type="hidden" name="FLAG" value="<%=menu[0].getFLAG()%>">
<input type="hidden" name="ISOPEN" value="<%=menu[0].getISOPEN()%>">
<input type="hidden" name="Act" value="edit">


           <DIV id="divMessage" style='padding-left:0;padding-top:0;width:96%;height:100%;overflow:auto'>
           <br>&nbsp;
           <fieldset style="width: 98%">
           <legend>编辑菜单信息</legend>
           <table class="inputTable" cellspacing="0" cellpadding="0" align="center">
             <tr>
               <td class="inputTdtitle">菜单名称：</td>
               <td class="inputTd"><input class="text" type="text" name="MENUNAME" size="60" maxlength="25" value="<%=menu[0].getMENUNAME()%>"><Font class="WriteSign">*</Font></td>
             </tr>
             <tr>
               <td class="inputTdtitle">菜单类别：</td>
               <td class="inputTd">
                 <input type="radio" name="ISPOWERx" value=0 onclick="document.RegForm.ISPOWER.value='0'" <%if (menu[0].getISPOWER().equals("0")){%>checked<%}%>>类别　　
		 <input type="radio" name="ISPOWERx" value=1 onclick="document.RegForm.ISPOWER.value='1'" <%if (menu[0].getISPOWER().equals("1")){%>checked<%}%>>任务
               </td>
             </tr>
             <tr>
               <td class="inputTdtitle">链接路径：</td>
               <td class="inputTd"><input class="text" type="text" name="URL" size="60" maxlength="300" value="<%=menu[0].getURL()%>"></td>
              </tr>


             <tr>
               <td class="inputTdtitle">新窗口打开：</td>
               <td class="inputTd">
                 <input type="radio" name="ISOPENx" value=0 onclick="document.RegForm.ISOPEN.value='0'" <%if (menu[0].getISOPEN().equals("0")){%>checked<%}%>> 否&nbsp;&nbsp;&nbsp;　
		 <input type="radio" name="ISOPENx" value=1 onclick="document.RegForm.ISOPEN.value='1'" <%if (menu[0].getISOPEN().equals("1")){%>checked<%}%>> 是
               </td>
               </tr>
             <tr>
               <td class="inputTdtitle">菜单属性：</td>
               <td class="inputTd">
                  <input type="radio" name="Flagx" value=1 onclick="document.RegForm.FLAG.value='1'" <%if (menu[0].getFLAG().equals("1")){%>checked<%}%>>启用　　
		  <input type="radio" name="Flagx" value=0 onclick="document.RegForm.FLAG.value='0'" <%if (menu[0].getFLAG().equals("0")){%>checked<%}%>>禁止
               </td>
             </tr>
              <tr>
               <td class="inputTdtitle">排序号：</td>
               <td class="inputTd" ><input class="text" type="text" name="MNCODE" size="60" maxlength="3"  value="<%=menu[0].getMNCODE()%>">
               <br>说明：请按菜单编号的规范编排序号，如：系统管理001 字典管理001001 数据字典管理 001001001。
               </td>
            </tr>

          </table>
          <br>
          </fieldset>

                 <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保存","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("删除","JavaScript:if(Check1(document.RegForm)){document.RegForm.submit();}","buttonDelete.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("返回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
                 </tr></table>
                 </center>

          </DIV>

</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
menu = null;
MenuService = null;
%>
