<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="SC_Config.Asp"-->
<!--#include file="SC_Function.Asp"-->
<!--#include file="SC_About.Asp"-->
<!--#include file="SC_AboutSort.Asp"-->
<!--#include file="SC_Case.Asp"-->
<!--#include file="SC_CaseSort.Asp"-->
<!--#include file="SC_Download.Asp"-->
<!--#include file="SC_DownloadSort.Asp"-->
<!--#include file="SC_Recruitment.asp"-->
<!--#include file="SC_RecruitmentSort.Asp"-->
<!--#include file="SC_News.Asp"-->
<!--#include file="SC_NewsSort.Asp"-->
<!--#include file="SC_Product.Asp"-->
<!--#include file="SC_ProductSort.Asp"-->
<!--#include file="SC_video.Asp"-->
<!--#include file="SC_videoSort.Asp"-->
<!--#include file="SC_Index.Asp"-->

<%
'生成静态AJAX调用
Call SiteInfo()
Table = request("Table")
ID = request("ID")
FileName = request("FileName")
bkkey = request("bkkey")
If bkkey = "PC" Then Flag = " ViewFlag " : TemplatePath = TemplatePath
If bkkey = "Mobile" Then Flag = " MobileFlag " : TemplatePath = mTemplatePath

Select Case Table
	Case "About"
		Call html_To_About(ID, bkkey)
	Case "AboutSort"
		Call html_To_AboutSort("Index."&HTMLName, bkkey)
	Case "Case"
		Call html_To_Case(ID, bkkey)
	Case "CaseSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:CaseList([\s\S]*?)}([\s\S]*?){/bokecms:CaseList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/CaseList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		If ID <> "" Then
			SortPath = Conn.execute("Select * from BokeCMS_CaseSort where ID="&ID)("SortPath")
			datawhere =  " and instr(SortPath,'"&SortPath&"')>0"
		End If
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Case Where " & Flag & datawhere, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_CaseSort(ID, "Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_CaseSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "Download"
		Call html_To_Download(ID, bkkey)
	Case "DownSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:DownList([\s\S]*?)}([\s\S]*?){/bokecms:DownList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/DownloadList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		If ID <> "" Then
			SortPath = Conn.execute("Select * from BokeCMS_DownSort where ID="&ID)("SortPath")
			datawhere =  " and instr(SortPath,'"&SortPath&"')>0"
		End If
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Download Where "&Flag&datawhere, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_DownSort(ID, "Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_DownSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "Recruitment"
		Call html_To_Recruitment(ID, bkkey)
	Case "RecruitmentSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:RecruitmentList([\s\S]*?)}([\s\S]*?){/bokecms:RecruitmentList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/RecruitmentList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lNum = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Recruitment Where "&Flag&datawhere, conn, 1, 2
		rs.pagesize = lNum
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_RecruitmentSort("Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_RecruitmentSort("Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "News"
		Call html_To_News(ID, bkkey)'发送ID号和网站类型到SC_News.asp
	Case "NewsSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:NewsList([\s\S]*?)}([\s\S]*?){/bokecms:NewsList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/NewsList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		If ID <> "" Then
			SortPath = Conn.execute("Select * from BokeCMS_NewsSort where ID="&ID)("SortPath")
			datawhere = " and instr(SortPath,'"&SortPath&"')>0"
		End If
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_News Where "&Flag&datawhere, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_NewsSort(ID, "Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_NewsSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "Product"
		Call html_To_Product(ID, bkkey)
	Case "ProductSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:ProductList([\s\S]*?)}([\s\S]*?){/bokecms:ProductList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/ProductList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		If ID <> "" Then
			SortPath = Conn.execute("Select * from BokeCMS_ProductSort where ID="&ID)("SortPath")
			datawhere =  " and instr(SortPath,'"&SortPath&"')>0"
		End If
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Product Where "&Flag&datawhere, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_ProductSort(ID, "Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_ProductSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "Video"
		Call html_To_Video(ID, bkkey)
	Case "VideoSort"
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True 
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:VideoList([\s\S]*?)}([\s\S]*?){/bokecms:VideoList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/VideoList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing

		If ID <> "" Then
			SortPath = Conn.execute("Select * from BokeCMS_VideoSort where ID="&ID)("SortPath")
			datawhere =  " and instr(SortPath,'"&SortPath&"')>0"
		End If
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Video Where "&Flag&datawhere, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		Call CloseRs(rs)
		If totalpage = 0 then totalpage = totalpage + 1
		
		Call html_To_VideoSort(ID, "Index."&HTMLName, "", bkkey)
		For n = 1 To totalpage
			Call html_To_VideoSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next

	Case "Index"
		Call html_To_Index(FileName, bkkey)
End Select
%>