<%@ page contentType="text/html;charset=GBK" %>
<%@ include file="../checkLogin.jsp" %>
<%@ page import="gbase.db.*,java.util.*,gbase.util.*"%>
<%@ page import="gbase.html.*,gbase.init.*,gbase.db.*,java.sql.*"%>
<%
	
	String message="操作失败";
	String action = request.getParameter("action")==null?"":request.getParameter("action");
	String url="web_barinfo_list.jsp";
	
	String id=request.getParameter("id")==null?"":request.getParameter("id");
        String name=request.getParameter("name")==null?"":request.getParameter("name");
        String content=request.getParameter("content")==null?"":request.getParameter("content");
	ConvertSql theConvertSql=new ConvertSql();
        content=theConvertSql.convertSqlValue(content);
        String sql="";
        DBOperation theDBOperation = new DBOperation();
        
	if(action.equals("update"))
	  { 
	  sql="update bar_menu set content='"+content+"' where  web_account='"+web_account+"' and id="+id+"";
	  }
	
	//out.println(sql);
	
        try {
        int i=theDBOperation.executeSql(sql);
        if(i>0)
          {
          HtmlGenerater theHtmlGenerater=new HtmlGenerater();
          theHtmlGenerater.geneFirstHtml(web_account);
          if(action.equals("delete")){
          id="";
          }
          theHtmlGenerater.geneBarByContentIdHtml(web_account,id,"",""); 
          message = "操作成功!";
          }
        else
          message = "操作失败!";
      }
      catch (Exception ex) {
        message = "操作失败!";
      }
	
%>
<script language="javascript">
	function process ( message,url){
		alert(message);
		self.location = url;
	}
</script>
<html>
	<head>
		<title></title>
	</head>
	<body onload="javascript: process('<%=message%>','<%=url%>');">
	</body>
</html>