<%
'--JinCms Callings
'--Last Update:2015-06-01
'--My Blog:www.oywork.com

'Table Explain: 1.Jin_Article  2.Jin_Class  -.Jin_Custom  3.Jin_Flash  -.Jin_Links  -.Jin_Message  4.Jin_Page  5.Jin_Photos  6.Jin_Message  7.Jin_Jobs
'函数内各参数意义就不一一解释了,自己去看就知道了

'关闭数据集及数据库
Function RsClose() : Rs.close : set Rs=nothing : End Function
Sub Rs_aClose() : Rs_a.close : set Rs_a=nothing : End Sub
Function ConnClose() : Conn.close : Set Conn=nothing : End Function

'获取表中记录数
Function getTbCount(table,wherestr)
	set Rs_Count=server.createobject("adodb.recordset")
	set Rs_Count=conn.execute("select count(*) from "&table&" "&wherestr&" ")  
	getTbCount=Rs_Count(0) : Rs_Count.close : set Rs_Count=nothing
End Function

'检验值是否在表中存在
Function isexist(tb,zd,str,zdtype)
	If tb=1 Then : table="Jin_Article" : End If : If tb=2 Then table="Jin_Class" : End If : If tb=3 Then table="Jin_Flash" : End If : If tb=4 Then table="Jin_Page" : End If : If tb=5 Then table="Jin_Photos" : End If : If tb=6 Then table="Jin_Message" : End If : If tb=7 Then table="Jin_Jobs" : End If
	set Rs_exist=server.createobject("adodb.recordset")
	If zdtype=0 Then Rs_exist.open "select * from ["&table&"] where "&zd&"="&str&"",conn,0,1,1
	If zdtype=1 Then Rs_exist.open "select * from ["&table&"] where "&zd&"='"&str&"'",conn,0,1,1
	If Rs_exist.eof Then isexist=false Else isexist=true
	Rs_exist.close : set Rs_exist=nothing
End Function

'后台底部
Sub BackFoot()
	Response.Write "</body></html>"
	Response.Write connclose()
End Sub 

'万能调用-通过表某字段值来获取表某字段值
Function getTbValue(zd,tb,byzd,bystr,bytype)
	If tb=1 Then : table="Jin_Article" : End If : If tb=2 Then table="Jin_Class" : End If : If tb=3 Then table="Jin_Flash" : End If : If tb=4 Then table="Jin_Page" : End If : If tb=5 Then table="Jin_Photos" : End If : If tb=6 Then table="Jin_Message" : End If
	set Rs_Value=server.CreateObject("adodb.recordset")
	If bytype=0 Then Rs_Value.open "select * from ["&table&"] where "&byzd&" = "&bystr&"",conn,0,1,1
	If bytype=1 Then Rs_Value.open "select * from ["&table&"] where "&byzd&" = '"&bystr&"'",conn,0,1,1
	If Not Rs_Value.eof Then : If Rs_Value(zd)<>"" Then : getTbValue=Rs_Value(zd) : Else : getTbValue="" : End If : Else : getTbValue="" : End If
	Rs_Value.close : set Rs_Value=nothing
End Function

'获取自定义内容
Function CV(valueStr)
	set Rs=server.CreateObject("adodb.recordset")
	Rs.open "select * from [Jin_Custom] where Cname = '"&valueStr&"'",conn,0,1,1
	If not Rs.eof Then : If Rs("Ccontent")<>"" Then : CV=Rs("Ccontent") : Else : CV="" : End If : Else : CV="" : End If
	Rs.close:set Rs=nothing
End Function
Function CVE(valueStr)	'getCustomValue_En
	set Rs=server.CreateObject("adodb.recordset")
	Rs.open "select * from [Jin_Custom] where Cname = '"&valueStr&"'",conn,0,1,1
	If not Rs.eof Then : If Rs("Ccontent_en")<>"" Then : CVE=Rs("Ccontent_en") : Else : CVE="" : End If : Else : CVE="" : End If
	Rs.close:set Rs=nothing
End Function

'获取各表信息
'Jin_Page				获取单页相关信息
Function getPageValue(sysID,str)
	set Rs_b=Server.CreateObject("ADODB.recordset")
	Rs_b.open "select * from [Jin_Page] where sysID="&sysID&"",conn,0,1,1
	If not Rs_b.eof Then : If Rs_b(str)<>"" Then : getPageValue=Rs_b(str) : Else : getPageValue="" : End If : Else : getPageValue="" : End If
	Rs_b.close:set Rs_b=nothing
End Function
'Jin_Article			获取文章相关信息
Function getArticleValue(sysID,str)
	set Rs_b=Server.CreateObject("ADODB.recordset")
	Rs_b.open "select * from [Jin_Article] where sysID="&sysID&"",conn,0,1,1
	If not Rs_b.eof Then : If Rs_b(str)<>"" Then : getArticleValue=Rs_b(str) : Else : getArticleValue="" : End If : Else : getArticleValue="" : End If
	Rs_b.close:set Rs_b=nothing
End Function
'Jin_Photos				获取产品相关信息
Function getPhotoValue(sysID,str)
	set Rs_b=Server.CreateObject("ADODB.recordset")
	Rs_b.open "select * from [Jin_Photos] where sysID="&sysID&"",conn,0,1,1
	If not Rs_b.eof Then : If Rs_b(str)<>"" Then : getPhotoValue=Rs_b(str) : Else : getPhotoValue="" : End If : Else : getPhotoValue="" : End If
	Rs_b.close:set Rs_b=nothing
End Function
'Jin_Banner				获取Banner相关信息
Function getBannerValue(sysID,str)
	set Rs_b=Server.CreateObject("ADODB.recordset")
	Rs_b.open "select * from [Jin_Banner] where sysID="&sysID&"",conn,0,1,1
	If not Rs_b.eof Then : If Rs_b(str)<>"" Then : getBannerValue=Rs_b(str) : Else : getBannerValue="" : End If : Else : getBannerValue="" : End If
	Rs_b.close:set Rs_b=nothing
End Function
'Jin_Class				获取分类相关信息
Function getClassValue(sysID,str)
	set Rs_b=Server.CreateObject("ADODB.recordset")
	Rs_b.open "select * from [Jin_Class] where ID="&sysID&"",conn,0,1,1
	If not Rs_b.eof Then : If Rs_b(str)<>"" Then : getClassValue=Rs_b(str) : Else : getClassValue="" : End If : Else : getClassValue="" : End If
	Rs_b.close:set Rs_b=nothing
End Function
'Jin_Class				获取分类相关信息
Function getJobsValue(sysID,str)
	set Rs_a=Server.CreateObject("ADODB.recordset")
	Rs_a.open "select * from [Jin_Jobs] where sysID="&sysID&"",conn,0,1,1
	If not Rs_a.eof Then : If Rs_a(str)<>"" Then : getJobsValue=Rs_a(str) : Else : getJobsValue="" : End If : Else : getJobsValue="" : End If
	Rs_a.close:set Rs_a=nothing
End Function

'获得ID上级ID
Function getParentID(classid,num)
	ParentID=getTbValue("ParentStr",2,"ID",classid,0)
	ParentID=split(ParentID,",")
	If ubound(ParentID)=0 and ParentID(0)=0 then ParentID1=classid:ParentID2="":ParentID3="":ParentID4=""
	If ubound(ParentID)=0 and ParentID(0)<>0 then ParentID1=ParentID(0):ParentID2=classid:ParentID3="":ParentID4=""
	If ubound(ParentID)=1 then ParentID1=ParentID(0):ParentID2=ParentID(1):ParentID3=classid:ParentID4=""
	If ubound(ParentID)=2 then ParentID1=ParentID(0):ParentID2=ParentID(1):ParentID3=ParentID(2):ParentID4=classid
	If ubound(ParentID)=3 then ParentID1=ParentID(0):ParentID2=ParentID(1):ParentID3=ParentID(2):ParentID4=ParentID(3):ParentID5=classid
	If num=1 then getParentID=clng(ParentID1)
	If num=2 then getParentID=clng(ParentID2)
	If num=3 then getParentID=clng(ParentID3)
	'If num=4 then getParentID=clng(ParentID4)
End Function

'获取分类下第一个子分类的ID
Function getZID_First(PID)
	Set Rsc = Server.CreateObject("ADODB.Recordset")
	Sqlc = "SELECT top 1 * FROM Jin_Class WHERE ModuleID="&Web_ModuleID&" and ParentID="&PID&" ORDER BY RootID,OrdeRs"
	Rsc.Open Sqlc, Conn, 1, 1
	IF not Rsc.eof then
			getZID_First=Rsc("ID")
		Else
			getZID_First=""
		End if
	Rsc.close
	set Rsc=nothing
End Function

'调取新闻
Sub getNewsList(Topnum,Pid,ltype)
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select top "&Topnum&" * from [Jin_Article] where Verify And Pid="&Pid&" order by sysID Desc"
	Rs_a.Open Sql_a,Conn,1,1
	If Rs_a.recordcount>0 then     
		For k=1 to Rs_a.recordcount
		If ltype=1 then Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),14)&"</a></li>" & vbnewline
		If ltype=2 then Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),30)&"</a><span>"&OnlyDate(Rs_a("Addtime"))&"</span></li>" & vbnewline
		If ltype=3 then Response.Write "<p><span class=""date"">["&getDate(Rs_a("Addtime"),"Y-M-D")&"]</span><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),14)&"</a></p>" & vbnewline
		Rs_a.Movenext
		next
	Else
		Response.Write "暂无内容……"
	End If
	Rs_a.close
	Set Rs_a=nothing
End Sub

'热点推荐新闻调用
Sub getTopNews(Topnum,Pid,ltype)
	Select case ltype
	Case "Top"
		wherestr="And Top" : orderstr="order by sysID Desc"
	Case "Recommend"
		wherestr="And Recommend" : orderstr="order by sysID Desc"
	Case "Hits"
		wherestr="" : orderstr="order by Hits desc,sysID Desc"
	Case "Random"
		wherestr="" : orderstr="order by newid()"
	Case else
		wherestr="" : orderstr="order by sysID Desc"
	End Select
	If Pid<>"" Then wherestr=wherestr+"And Pid="&Pid&"" 
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select top "&Topnum&" * from [Jin_Article] where Verify "&wherestr&" "&orderstr&" "
	Rs_a.Open Sql_a,Conn,1,1
	If Rs_a.recordcount>0 then     
		For k=1 to Rs_a.recordcount
		Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),14)&"</a></li>" & vbnewline
		Rs_a.Movenext
		next
	Else
		Response.Write "暂无内容……"
	End If
	Rs_a.close
	Set Rs_a=nothing
End Sub



'**************************************************** JinCms 各板块调用区 *********************************************************'


'首页Banner
Sub IndexFlash(pid,topnum,istarget,lx)
	If Cnum(topnum)<>0 Then topstr="top "&topnum&"" else topstr=""
	If pid<>"" Then wherestr="And Pid="&Pid&"" Else wherestr=""
	set Rs=server.CreateObject("adodb.recordset")
	Rs.open "select "&topstr&" * from [Jin_Flash] where Verify "&wherestr&" Order by SortID,sysID desc",conn,0,1,1
	Do until Rs.eof
	If Rs("Url")<>"" Then urlstr=Rs("Url") else urlstr="javascript:;"
	If istarget=1 Then targetstr="target=_blank" else targetstr=""
		If lx=0 Then Response.Write "<li class=""slider-item active"" ><a class=""a-img-bg"" href="""&urlstr&""" title="""&Rs("Title")&""" "&targetstr&"><img src="""&web_root&""&Rs("Pic")&""" alt="""&Rs("Title")&"""  ></a></li>" & vbNewLine
		If lx=1 Then Response.Write "<li><a href="""&urlstr&""" title="""&Rs("Title")&""" "&targetstr&"><img src="""&web_root&""&Rs("Pic")&""" alt="""&Rs("Title")&""" ></a></li>" & vbNewLine
	Rs.movenext
	loop
	Rs.close:set Rs=nothing
End Sub

'首页新闻
Sub IndexNews(pid,topnum,titlelen)
	If pid<>"" Then wherestr="And Pid="&Pid&"" Else wherestr=""
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select top "&Topnum&" * from [Jin_Article] where Verify "&wherestr&" order by sysID desc "
	Rs_a.Open Sql_a,Conn,1,1
	If Rs_a.recordcount>0 then     
		For i=1 to Rs_a.recordcount
		If Rs_a("Pic")<>"" Then picurl=Rs_a("Pic") Else picurl=web_root&"Images/nonews.jpg"
		If i=1 Then 
		Response.Write "<li><img src="""&picurl&""" ><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""" style=""width:60%;""><b>"&CutStr(Rs_a("Title"),titlelen)&"</b></a><div class=""memo"">"&CutStr(RemoveHtml(Rs_a("Content")),42)&"</div></li>" & vbnewline
		Else
		Response.Write "<li><div class=""time"">"&getDate(Rs_a("Addtime"),"Y-M-D")&"</div><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),titlelen)&"</a></li>" & vbnewline
		End If
		Rs_a.Movenext
		next
	Else
		Response.Write "<li>暂无新闻……</li>"
	End If
	Rs_a.close
	Set Rs_a=nothing
End Sub

'首页产品
Sub IndexPro(pid,topnum,titlelen)
	If pid<>"" Then wherestr="And Pid="&Pid&"" Else wherestr=""
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select top "&Topnum&" * from [Jin_Photos] where Verify "&wherestr&" order by sysID desc "
	Rs_a.Open Sql_a,Conn,1,1
	If Rs_a.recordcount>0 then     
		For i=1 to Rs_a.recordcount
		If Rs_a("Pic")<>"" Then picurl=Rs_a("Pic") Else picurl=web_root&"Images/nopro.jpg"
		Response.Write "<li><a href="""&getProUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&"""><img src="""&picurl&""" ></a><p><a href="""&getProUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),titlelen)&"</a></p></li>" & vbnewline
		Rs_a.Movenext
		next
	Else
		Response.Write "<li>暂无产品……</li>"
	End If
	Rs_a.close
	Set Rs_a=nothing
End Sub

'当前位置
Function Jin_PageNav(NavID,PageID)
	If (NavID<>1 And NavID<>PageID) then 
	Jin_PageNav="您现在的位置：<a href="""&web_root&""">首页</a><a href="""&getClassUrl(getClassValue(NavID,"ClassName_en"),NavID)&""">"&getClassValue(NavID,"ClassName")&"</a><a href="""&getClassUrl(getClassValue(PageID,"ClassName_en"),PageID)&""">"&getClassValue(PageID,"ClassName")&"</a>" 
	Else 
	Jin_PageNav="您现在的位置：<a href="""&web_root&""">首页</a><a href="""&getClassUrl(getClassValue(PageID,"ClassName_en"),PageID)&""">"&getClassValue(PageID,"ClassName")&"</a>"
	End If
End Function

'栏目内页Banner
Function Jin_SubBanner(NavID)
	If getClassValue(NavID,"Pic")<>"" or not isnull(getClassValue(NavID,"Pic")) then Jin_SubBanner="<img src="""&web_root&getClassValue(NavID,"Pic")&""" >" Else Jin_SubBanner="<img src="""&web_root&"Images/banner01.jpg"" >"
End Function

'左侧子栏目
Sub Jin_SubClass(PID,NowID)
	Set Rsc = Server.CreateObject("ADODB.Recordset")
	Sqlc = "SELECT * FROM Jin_Class WHERE ModuleID="&Web_ModuleID&" and ParentID="&PID&" And ShowNav ORDER BY RootID,OrdeRs"
	Rsc.Open Sqlc, Conn, 1, 1
	For i=1 to Rsc.recordcount
	If NowID=Rsc("ID") Then classstr="class=on" Else classstr=""
		Response.Write "<li><a href="""&getClassUrl(Rsc("ClassName_en"),Rsc("ID"))&""" "&classstr&">"&Rsc("ClassName")&"</a></li>" & vbnewline
	Rsc.movenext
	Next
	Rsc.close
	set Rsc=nothing
End Sub

'新闻列表
Sub Jin_NewsList(ID,Lx)
	Response.Write("<ul class=""pageNewsList"">")
	Page=Max(Cnum(sqlshow(PageNum)),1)
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select * from [Jin_Article] where Verify And Pid in ("&getClassValue(ID,"ChildStr")&") order by sysID Desc"
	Rs_a.Open Sql_a,Conn,1,1
	ListPageSize=Web_PageSizeA
	AllCount=Rs_a.RecordCount
	Pages=Fix(AllCount/ListPageSize)
	If Pages*ListPageSize<AllCount Then Pages=Pages+1	
	PastCount=(Page-1)*ListPageSize
	If AllCount>PastCount Then Rs_a.Move PastCount
	ShowCount=Min(AllCount-PastCount,ListPageSize)
	For i=1 To ShowCount
		If Lx=1 then Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),30)&"</a><span class=""date"">"&getDate(Rs_a("Addtime"),"Y-M-D")&"</span></li>" & vbnewline
		If Lx=2 then Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),30)&"</a><span>"&getDate(Rs_a("Addtime"),"Y-M-D")&"</span></li>" & vbnewline
		If Lx=3 then Response.Write "<p><span class=""date"">["&getDate(Rs_a("Addtime"),"Y-M-D")&"]</span><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),14)&"</a></p>" & vbnewline
	Rs_a.MoveNext
	Next
	Rs_a.close
	Set Rs_a=nothing
	Response.Write "</ul>"
	Response.Write("<div class=""clear""></div>")
	If AllCount>0 Then
	Response.Write("<div class=""pagePage"">")
	Response.Write("共<i class=""blue""> "&AllCount&" </i>篇文章 &nbsp; &nbsp;页次: <i class=""red""> "&Page&"</i><i class=""blue"">/"&Pages&"</i> ")
	Response.Write("<ul class=""pagePageList"">")
	Response.Write ShowPagesA(Pages,Page,"?page:"&getClassValue(ID,"ClassName_en")&"@"&ID&"_")
	Response.Write "</ul>"
	Response.Write "</div>"
	Else
	Response.Write "<div class=""pagePage mt10""> <i class=""red"">该栏目下暂无文章~ </i></div>"
	End If
End Sub

'产品列表
Sub Jin_ProList(ID,Lx)
	Response.Write("<ul class=""pageProList"">")
	Page=Max(Cnum(sqlshow(PageNum)),1)
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select * from [Jin_Photos] where Verify And Pid in ("&getClassValue(ID,"ChildStr")&") order by sysID Desc"
	Rs_a.Open Sql_a,Conn,1,1
	ListPageSize=Web_PageSizeB
	AllCount=Rs_a.RecordCount
	Pages=Fix(AllCount/ListPageSize)
	If Pages*ListPageSize<AllCount Then Pages=Pages+1	
	PastCount=(Page-1)*ListPageSize
	If AllCount>PastCount Then Rs_a.Move PastCount
	ShowCount=Min(AllCount-PastCount,ListPageSize)
	For i=1 To ShowCount
	If Rs_a("Pic")<>"" then picUrl=web_root&Rs_a("Pic") Else picUrl=web_root&"Images/noPro.jpg"
		If Lx=1 then Response.Write "<li><a href="""&getProUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&"""><img src="&picUrl&" alt="""&Rs_a("Title")&""" ><br>"&CutStr(Rs_a("Title"),12)&"</a></li>" & vbnewline
		If Lx=2 then Response.Write "<li></li>" & vbnewline
	Rs_a.MoveNext
	Next
	Rs_a.close
	Set Rs_a=nothing
	Response.Write "</ul>"
	Response.Write("<div class=""clear""></div>")
	If AllCount>0 Then
	Response.Write("<div class=""pagePage mt10"">")
	Response.Write("共<i class=""blue""> "&AllCount&" </i>个产品 &nbsp; &nbsp;页次: <i class=""red""> "&Page&"</i><i class=""blue"">/"&Pages&"</i> ")
	Response.Write("<ul class=""pagePageList"">")
	Response.Write ShowPagesA(Pages,Page,"?page:"&getClassValue(ID,"ClassName_en")&"@"&ID&"_")
	Response.Write "</ul>"
	Response.Write "</div>"
	Else
	Response.Write "<div class=""pagePage mt10""> <i class=""red"">该栏目下暂无产品~ </i></div>"
	End If
End Sub

'新闻搜索列表
Sub Jin_NewsSearch(key,Lx)
	Randomize()
	If key<>"" Then wherestr="And (Title like '%"&key&"%' or Content like '%"&key&"%' or Descriptions like '%"&key&"%')":orderstr="sysID Desc" else wherestr="":orderstr="Rnd("&Rnd&"-sysID)" : topstr="top 28"
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select "&topstr&" * from [Jin_Article] where Verify  "&wherestr&" order by "&orderstr&""
	Rs_a.Open Sql_a,Conn,1,1
	AllCount=Rs_a.RecordCount
	For i=1 To AllCount
		If Lx=1 then Response.Write "<li><span class=""date"">["&getDate(Rs_a("Addtime"),"Y-M-D")&"]</span><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),25)&"</a></li>" & vbnewline
		If Lx=2 then Response.Write "<li><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),25)&"</a><span class=""date"">"&getDate(Rs_a("Addtime"),"Y-M-D")&"</span></li>" & vbnewline
		If Lx=3 then Response.Write "<p><span class=""date"">["&getDate(Rs_a("Addtime"),"Y-M-D")&"]</span><a href="""&getNewsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&""">"&CutStr(Rs_a("Title"),25)&"</a></p>" & vbnewline
	If i mod 5=0 Then Response.Write "<div class=""searchlistline""></div>"
	Rs_a.MoveNext
	Next
	Rs_a.close
	Set Rs_a=nothing
	If AllCount<1 Then
	response.Write "<li>关键词 <b class=red>"&key&"</b> 下无文章，猜您喜欢：</li>"
	Call Jin_NewsSearch("",1)
	End If
End Sub

'产品搜索列表
Sub Jin_ProSearch(key,Lx)
	Randomize()
	If key<>"" Then wherestr="And (Title like '%"&key&"%' or Content like '%"&key&"%' or Descriptions like '%"&key&"%')":orderstr="sysID Desc" else wherestr="":orderstr="Rnd("&Rnd&"-sysID)" : topstr="top 10"
	Page=Max(Cnum(sqlshow(PageNum)),1)
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select "&topstr&" * from [Jin_Photos] where Verify  "&wherestr&" order by "&orderstr&""
	Rs_a.Open Sql_a,Conn,1,1
	AllCount=Rs_a.RecordCount
	For i=1 To AllCount
	If Rs_a("Pic")<>"" then picUrl=web_root&Rs_a("Pic") Else picUrl=web_root&"Images/noPro.jpg"
		If Lx=1 then Response.Write "<li><a href="""&getProUrl(Rs_a("sysID"))&""" title="""&Rs_a("Title")&"""><img src="&picUrl&" alt="""&Rs_a("Title")&"""><br>"&CutStr(Rs_a("Title"),12)&"</a></li>" & vbnewline
		If Lx=2 then Response.Write "<li></li>" & vbnewline
	Rs_a.MoveNext
	Next
	Rs_a.close
	Set Rs_a=nothing
	If AllCount<1 Then
	response.Write "<li style=""width:100% !important;"">关键词 <b class=red>"&key&"</b> 下无产品，猜您喜欢：</li>"
	Call Jin_ProSearch("",1)
	End If
End Sub

'职位列表
Sub Jin_JobList(ID,Lx)
	Response.Write("<ul class=""pageJobsList"">")
	Page=Max(Cnum(sqlshow(PageNum)),1)
	Set Rs_a=server.createobject("adodb.recordSet")
	Sql_a="select * from [Jin_Jobs] where datediff('d','"&getDate(Now(),"Y-M-D")&"',EndDate)>=0 And Pid in ("&getClassValue(ID,"ChildStr")&") order by SortID,sysID Desc"
	Rs_a.Open Sql_a,Conn,1,1
	ListPageSize=Web_PageSizeE
	AllCount=Rs_a.RecordCount
	Pages=Fix(AllCount/ListPageSize)
	If Pages*ListPageSize<AllCount Then Pages=Pages+1	
	PastCount=(Page-1)*ListPageSize
	If AllCount>PastCount Then Rs_a.Move PastCount
	ShowCount=Min(AllCount-PastCount,ListPageSize)
	For i=1 To ShowCount
	If i mod 2=0 Then classStr="class=""bg2 filter8""" Else classStr="class=""bg1 filter8"""
		If Lx=1 then Response.Write vbnewline & "<li "&classStr&"><span class=""jobTitle""><a href="""&getJobsUrl(Rs_a("sysID"))&""" title="""&Rs_a("Position")&""">招聘职位："&CutStr(Rs_a("Position"),12)&"</a></span><span class=""jobInfo"">招聘人数："&Rs_a("Hiring")&"</span><span class=""jobInfo"">工作地点: "&Rs_a("Location")&"</span><span class=""jobInfo"">薪资待遇："&Rs_a("Salary")&"</span></li>" & vbnewline
		If Lx=2 then Response.Write "<li></li>" & vbnewline
	Rs_a.MoveNext
	Next
	Rs_a.close
	Set Rs_a=nothing
	Response.Write "</ul>"
	Response.Write("<div class=""clear""></div>")
	If AllCount>0 Then
	Response.Write("<div class=""pagePage"">")
	Response.Write("共<i class=""blue""> "&AllCount&" </i>条招聘信息 &nbsp; &nbsp;页次: <i class=""red""> "&Page&"</i><i class=""blue"">/"&Pages&"</i> ")
	Response.Write("<ul class=""pagePageList"">")
	Response.Write ShowPagesA(Pages,Page,"?page:"&getClassValue(ID,"ClassName_en")&"@"&ID&"_")
	Response.Write "</ul>"
	Response.Write "</div>"
	Else
	Response.Write "<div class=""pagePage mt10""> <i class=""red"">暂无招聘信息~ </i></div>"
	End If
End Sub

'链接调用
Sub GetLinks(topnum,pid,ltype)
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select top "&topnum&" * from [Jin_Links] where Pid="&pid&" order by SortID asc,sysID asc"
	Rs.Open Sql,Conn,1,1
	If Rs.recordcount>0 Then     
	For i=1 to Rs.recordcount
	If Rs("Target")=1 Then targetstr="target=""_blank""" Else  targetstr=""
	If left(trim(Rs("Url")),7)="http://" Then LinkUrl=Trim(Rs("Url")) else LinkUrl=web_root&Trim(Rs("Url"))
	If ltype=1 Then Response.Write "<li><a href="""&LinkUrl&""" "&targetstr&" title="""&Rs("Info")&"""><img src="""&web_root&Rs("Logo")&""" alt="&Rs("Info")&" /></a></li>" & vbnewline
	If ltype=2 Then Response.Write "<a href="""&LinkUrl&""" "&targetstr&" title="""&Rs("Info")&""">"&Rs("Title")&"</a>"
	'If i<>Rs.recordcount Then Response.Write "|" & vbnewline end If
	Rs.Movenext : next
	End If
	Rs.close:set Rs=nothing
End Sub

'邮箱验证
Function ChkMail(ByVal Email) 
Dim Rep,Pmail : ChkMail = True : Set Rep = New RegExp 
Rep.Pattern = "([.a-zA-Z0-9_-]){2,10}@([a-zA-Z0-9_-]){2,10}(.([a-zA-Z0-9]){2,}){1,4}$" 
Pmail = Rep.Test(Email) : Set Rep = Nothing 
If Not Pmail Then ChkMail = False 
End Function 
'电话验证
Function ChkTel(para)
	Dim Str, l, i
	If IsNull(para) Then : ChkTel = false : Exit Function : End If
	Str = CStr(para) : If Len(Trim(Str))<7 Then : ChkTel = false : Exit Function : End If
	l = Len(Str) : For i = 1 To l : If Not (Mid(Str, i, 1)>= "0" And Mid(Str, i, 1)<= "9" Or Mid(Str, i, 1) = "-") Then : ChkTel = false : Exit Function : End If : Next
	ChkTel = true
End Function

'留言验证
Function MsgChk()
	If request_Form("Title")="" or isnull(request_Form("Title")) Then Call ShowMsg("请输入留言标题！",1)
	If request_Form("UserName")="" or isnull(request_Form("UserName")) Then Call ShowMsg("请输入您的姓名！",1)
	'If request_Form("Email")="" or isnull(request_Form("Email")) Then Call ShowMsg("请输入您的邮箱！",1)
	If request_Form("Email")<>"" And not isnull(request_Form("Email")) And ChkMail(request_Form("Email")) = False Then Call ShowMsg("邮箱格式错误！",1)
	'If request_Form("Tel")="" or isnull(request_Form("Tel")) Then Call ShowMsg("请输入您的电话！",1)
	If request_Form("Tel")<>"" And not isnull(request_Form("Tel")) And ChkTel(request_Form("Tel")) = False Then Call ShowMsg("电话格式错误！",1)
	If request_Form("Content")="" or isnull(request_Form("Content")) or len(request_Form("Content"))<10 Then Call ShowMsg("留言内容不能低于10个字符！",1)
End Function

'投递简历表单验证
Function ApplyChk()
	If request_Form("rName")="" or isnull(request_Form("rName")) or request_Form("rName")="姓名" Then Call ShowMsg("请输入您的姓名！",1)
	If request_Form("rAge")="" or isnull(request_Form("rAge")) or request_Form("rAge")="年龄" Then Call ShowMsg("请输入您的年龄！",1)
	If request_Form("rNation")="" or isnull(request_Form("rNation")) or request_Form("rNation")="民族" Then Call ShowMsg("请输入您的民族！",1)
	If request_Form("rHometown")="" or isnull(request_Form("rHometown")) or request_Form("rHometown")="籍贯" Then Call ShowMsg("请输入您的籍贯！",1)
	If IsJobsField("Jobs06") And (request_Form("rEduBack")="" or isnull(request_Form("rEduBack")) or request_Form("rEduBack")="学历") Then Call ShowMsg("请输入您的学历！",1)
	If IsJobsField("Jobs07") And (request_Form("rGraduated")="" or isnull(request_Form("rGraduated")) or request_Form("rGraduated")="毕业院校") Then Call ShowMsg("请输入您的毕业院校！",1)
	If IsJobsField("Jobs08") And (request_Form("rSpecialty")="" or isnull(request_Form("rSpecialty")) or request_Form("rSpecialty")="专业") Then Call ShowMsg("请输入您的专业！",1)
	If IsJobsField("Jobs09") And (request_Form("rMarital")="" or isnull(request_Form("rMarital"))) Then Call ShowMsg("请选择您的婚姻状况！",1)
	If IsJobsField("Jobs11") And (request_Form("rTel")="" or isnull(request_Form("rTel")) or request_Form("rTel")="电话") Then Call ShowMsg("请输入您的电话！",1)
	If request_Form("rTel")<>"电话" And request_Form("rTel")<>"" And ChkTel(request_Form("rTel")) = False Then Call ShowMsg("电话格式错误！",1)
	If IsJobsField("Jobs12") And (request_Form("rEmail")="" or isnull(request_Form("rEmail")) or request_Form("rEmail")="邮箱") Then Call ShowMsg("请输入您的邮箱！",1)
	If request_Form("rEmail")<>"邮箱" And request_Form("rEmail")<>"" And ChkMail(request_Form("rEmail")) = False Then Call ShowMsg("邮箱格式错误！",1)
	If IsJobsField("Jobs10") And (request_Form("rQQ")="" or isnull(request_Form("rQQ")) or request_Form("rQQ")="QQ") Then Call ShowMsg("请输入您的QQ！",1)
	If IsJobsField("Jobs13") And (request_Form("rAddr")="" or isnull(request_Form("rAddr")) or request_Form("rAddr")="现居地址") Then Call ShowMsg("请输入您的现居地址！",1)
	If IsJobsField("Jobs14") And (request_Form("rWorkExp")="" or isnull(request_Form("rWorkExp")) or request_Form("rWorkExp")="范例:2015年3月~至今  深圳市腾讯计算机系统有限公司  产品经理  负责产品策划工作，从战略规划、产品概念策划到推动实施") Then Call ShowMsg("请输入您的工作经历！",1)
	If IsJobsField("Jobs15") And (request_Form("rEduExp")="" or isnull(request_Form("rEduExp")) or request_Form("rEduExp")="范例:2010年9月~2014年6月  北京大学  大学本科") Then Call ShowMsg("请输入您的教育背景！",1)
	If IsJobsField("Jobs16") And (request_Form("rRequirements")="" or isnull(request_Form("rRequirements")) or request_Form("rRequirements")="你对公司的期望") Then Call ShowMsg("请输入您的待遇要求！",1)
	If IsJobsField("Jobs17") And (request_Form("rSelfEva")="" or isnull(request_Form("rSelfEva")) or request_Form("rSelfEva")="简洁明了地介绍你自己") Then Call ShowMsg("请输入您的自我评价！",1)
End Function

'JinCms错误提示
Sub ErrorPage(num)
	Select case num
		Case 110
			Response.Write "<div class=""page404"">" & vbnewline
			Response.Write "网站维护中……" & vbnewline
			Response.Write "</div>"
		Case 403
			Response.Write "<div class=""page404"">" & vbnewline
			Response.Write "该内容禁止访问！<a href="""&web_root&""">返回首页</a> - <a href=""javascript:history.go(-1);"">返回上一页</a>" & vbnewline
			Response.Write "</div>"
		Case 404
			Response.Write "<div class=""page404"">" & vbnewline
			Response.Write "对不起，页面找不到了，<a href="""&web_root&""">返回首页</a> - <a href=""javascript:history.go(-1);"">返回上一页</a>" & vbnewline
			Response.Write "</div>"
		Case 405
			Response.Write "<div class=""page404"">" & vbnewline
			Response.Write "资源被禁止，<a href="""&web_root&""">返回首页</a> - <a href=""javascript:history.go(-1);"">返回上一页</a>" & vbnewline
			Response.Write "</div>"
		Case 500
			Response.Write "<div class=""page404"">" & vbnewline
			Response.Write "内部服务器错误，<a href="""&web_root&""">返回首页</a> - <a href=""javascript:history.go(-1);"">返回上一页</a>" & vbnewline
			Response.Write "</div>"
		Case Else
	End Select
End Sub




%>