<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="gbase.html.HtmlGenerater,gbase.init.*,gbase.db.*,java.sql.*"%>
<%@ include file="../checkLogin.jsp" %>
<%
	
	String message="²Ù×÷Ê§°Ü";
	String id=request.getParameter("id")==null?"":request.getParameter("id");
	
        String str_page_size=request.getParameter("page_size")==null?"0":request.getParameter("page_size");
        if(str_page_size.equals(""))str_page_size="0";
        String str_row_size=request.getParameter("row_size")==null?"0":request.getParameter("row_size");
        if(str_row_size.equals(""))str_row_size="0";
        int page_size=Integer.parseInt(str_page_size);
        int row_size=Integer.parseInt(str_row_size);
        
        String name=request.getParameter("name")==null?"":request.getParameter("name");
        String menu_type=request.getParameter("menu_type")==null?"0":request.getParameter("menu_type");
        String content_type=request.getParameter("content_type")==null?"0":request.getParameter("content_type");
        String web_template_id=request.getParameter("web_template_id")==null?"0":request.getParameter("web_template_id");
        String web_template_id2=request.getParameter("web_template_id2")==null?"0":request.getParameter("web_template_id2");
        if(web_template_id2.equals(""))web_template_id2="0";
        WebConfig theWebConfig=new WebConfig();
        WebInfo webInfo=theWebConfig.getWebInfo(web_account);
        String web_title=webInfo.getWeb_name()+":"+name;
        String httpUrl="";
        if((!content_type.equals("2")) && (!content_type.equals("3"))){  
        httpUrl=cms_url+web_account+"/template/"+web_template_id+".jsp?bar_id="+id+"&web_account="+web_account+"&bar_name="+name+"&web_title="+web_title;
        }
        else
        {
        DBOperation theDBOperation=new DBOperation();
        String sql ="";
        ResultSet rs=null;
        if(content_type.equals("2"))
          sql= "select * from web_titleinfo where bar_id="+id+"";
        else if(content_type.equals("3"))
          sql= "select * from web_imageinfo where bar_id="+id+"";
        rs =theDBOperation.getResultSet(sql);
        rs.last();
        int sum_count=rs.getRow();
        int need_page = 1;
        int sum_page=0;
        if(content_type.equals("3"))
         sum_page=(sum_count-1)/(page_size*row_size)+1;
        else
         sum_page=(sum_count-1)/page_size+1;
        if(sum_count==0)sum_page=1;
        httpUrl=cms_url+web_account+"/template/"+web_template_id+".jsp?bar_id="+id+"&web_account="+web_account+"&bar_name="+name+"&web_title="+web_title+"&need_page="+need_page+"&sum_page="+sum_page+"&page_size="+page_size+"&row_size="+row_size;
        }
       
	
%>
<script language="javascript">
	function process(httpUrl){
		window.location=httpUrl;
	}
</script>
<html>
	<head>
		<title></title>
	</head>
	<body onload="javascript: process('<%=httpUrl%>');">
	</body>
</html>