<%
'生成招聘列表静态方法
Function html_To_Recruitment(ID, bkkey)
	Call SiteInfo()
	
	Set rs = server.CreateObject("adodb.recordset")
	rs.open "select * from BokeCMS_Recruitment where ID="&ID,conn,1,2
	RecruitmentName = rs("RecruitmentName")
	Origin = rs("Origin")
	Author = rs("Author")
	RecruitmentAddress = rs("RecruitmentAddress")
	RecruitmentNumber = rs("RecruitmentNumber")
	Emolument = rs("Emolument")
	Requirement = rs("Requirement")
	StartDate = rs("StartDate")
	EndDate = rs("EndDate")
	ClassSeo = rs("ClassSeo")
	AddTime = rs("AddTime")
	UpdateTime = rs("UpdateTime")
	
	SeoTitle = rs("RecruitmentName")
	SeoKeywords = rs("RecruitmentName")
	SeoDescription = rs("RecruitmentName")
	rs.close : set rs = nothing
	If bkkey = "PC" Then Flag = "ViewFlag"
	If bkkey = "Mobile" Then Flag = "MobileFlag"

	set rs = server.CreateObject("adodb.recordset")
	rs.open "select top 1 * from BokeCMS_Recruitment where ID<" & ID & " and "&Flag&" Order by ID desc", Conn, 1, 2
	if rs.eof then
		PrevLink = "#" : PrevName = "暂无"
	else
		PrevLink = rs("ClassSeo") & Separated & rs("ID") & "." & HTMLName : PrevName = rs("RecruitmentName")
	end if
	rs.close
	rs.open "select top 1 * from BokeCMS_Recruitment where ID>" & ID & " and "&Flag&" Order by ID asc", Conn, 1, 2
	if rs.eof then
		NextLink = "#" : NextName = "暂无"
	else
		NextLink = rs("ClassSeo") & Separated & rs("ID") & "." & HTMLName : NextName = rs("RecruitmentName")
	end if
	rs.close : set rs = nothing

	If bkkey = "PC" Then
		replace_code = ReadFromUTF(TemplatePath&"/html/RecruitmentView.html","utf-8")
		FilePath = "/"&RecruitmentDir&"/"&ClassSeo&Separated&ID&"."&HTMLName&""
		TemplatePath = TemplatePath
	End If
	If bkkey = "Mobile" Then
		replace_code = ReadFromUTF(mTemplatePath&"/html/RecruitmentView.html","utf-8")
		FilePath = "/wap/"&RecruitmentDir&"/"&ClassSeo&Separated&ID&"."&HTMLName&""
		TemplatePath = mTemplatePath
	End If

	If SiteStatus Then
		replace_code = Position(replace_code, "", 6, bkkey)
	
		replace_code = ReplaceCommon(replace_code, TemplatePath, bkkey)
		
		replace_code = replace(replace_code, "{bokecms:ID}", ID)
		replace_code = replace(replace_code, "{bokecms:RecruitmentName}", RecruitmentName)
		replace_code = replace(replace_code, "{bokecms:Origin}", Origin)
		replace_code = replace(replace_code, "{bokecms:Author}", author)
		replace_code = replace(replace_code, "{bokecms:RecruitmentAddress}", RecruitmentAddress)
		replace_code = replace(replace_code, "{bokecms:RecruitmentNumber}", RecruitmentNumber)
		replace_code = replace(replace_code, "{bokecms:Emolument}", Emolument)
		replace_code = replace(replace_code, "{bokecms:Requirement}", Requirement)
		replace_code = ParseTime(replace_code, StartDate, "StartDate")
		replace_code = ParseTime(replace_code, EndDate, "EndDate")
		
		replace_code = replace(replace_code, "{bokecms:SeoTitle}", SeoTitle)
		replace_code = replace(replace_code, "{bokecms:SeoKeywords}", SeoKeywords)
		replace_code = replace(replace_code, "{bokecms:SeoDescription}", SeoDescription)
		
		replace_code = ParseTime(replace_code, AddTime, "AddTime")
		replace_code = ParseTime(replace_code, UpdateTime, "UpdateTime")

		replace_code = replace(replace_code, "{bokecms:PrevName}", PrevName)
		replace_code = replace(replace_code, "{bokecms:PrevLink}", PrevLink)
		replace_code = replace(replace_code, "{bokecms:NextName}", NextName)
		replace_code = replace(replace_code, "{bokecms:NextLink}", NextLink)

		replace_code = HtmlTo(replace_code, "", "", bkkey, "")
	Else
		replace_code = ExplainJS
	End If
	
	If bkkey = "PC" Then replace_code = replace_code & ConstJs
	Call WriteToUTF(FilePath, replace_code)
End Function
%>