<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../Inc/Commoncode.asp" -->
<!--#include file="../inc/CommonFunction.asp"-->
<%SQLin
Cid=14
Response.Cookies(FRHRCMS)("ChannelID") = Cid
'读取频道名称
set rs=conn.execute("select * from JOB_Channel where ChannelID="&Cid&"")
if not rs.eof then
	ChannelName=rs("ChannelName")
	ChannelID=rs("ChannelId")
else
	Response.Write("频道ID出错!")
	Response.end()
end if
set rs=nothing
'读取模版内容
html=LoadTemplate(Cid,1,0)
if request("typeid")<>"" then
	if Chkrequest(request("typeid")) then
		typeid=request("typeid")
	end if
end if

Set hrs=conn.Execute("select * from JOB_help_sort order by sortid desc")
If Not hrs.eof then
HelpMenu=""
Do While Not hrs.eof
n=n+1
HelpMenu=HelpMenu&"<li style='font-size:14px; font-weight:bold; text-align:left; border-bottom:1px #eeeeee dashed; line-height:150%; padding:4px 0;'>"&hrs("sort")&"</li>"
	Set Rs=conn.Execute("select * from JOB_help_type where sortid="&hrs("sortid")&" order by typeid desc")
	If Not Rs.eof then
	Do While Not Rs.eof
	m=m+1
	HelpMenu=HelpMenu&"<li style='text-align:left;line-height:22px;'>　<a href='index.asp?typeid="&rs("typeid")&"'>"&rs("typename")&"</a></li>"
	rs.movenext
	loop
	end if
	rs.close
	set rs=nothing
hrs.movenext
loop
end if
hrs.close
set hrs=nothing
searchPlace=Replace_Text(request("searchPlace"))
keywords=Replace_Text(request("keywords"))
set rs=server.createobject("adodb.recordset") 
sql="select * from JOB_help"
if keywords<>"" then
if searchPlace=1 then
sql=sql&" where showname like '%"&keywords&"%'"
end if
if searchPlace=2 then
sql=sql&" where content like '%"&keywords&"%'"
end if
else
if typeid<>"" then
sql=sql&" where typeid="&typeid&""
else
'sql=sql&" where typeid=1"
sql=sql
end if
end if
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
HelpSearch="<div class=helpsearch>"
if not rs.eof then
Helpsort="<font color=#ff0000 style='font-size:18px; font-weight:bold;'>"
sqlsort="select * from JOB_help_sort where sortid="&rs("sortid")&""
set rssort=Server.CreateObject("ADODB.RecordSet")
rssort.open sqlsort,conn,1,1
if not rssort.eof then
Helpsort=Helpsort&rssort("sort")&""
Helpsort=Helpsort&"</font>"
end if
rssort.close
set rssort=nothing
end if

HelpSearch=HelpSearch&"<li>"& vbCrLf
HelpSearch=HelpSearch&"<script>"& vbCrLf
HelpSearch=HelpSearch&"function checkForm(){"& vbCrLf
HelpSearch=HelpSearch&"if(document.search.keywords.value=='请输入关键字'||document.search.keywords.value=='') "& vbCrLf
HelpSearch=HelpSearch&"{"& vbCrLf
HelpSearch=HelpSearch&"alert(""关键字为空，请输入关键字！"");"& vbCrLf
HelpSearch=HelpSearch&"return false;"& vbCrLf
HelpSearch=HelpSearch&"}"& vbCrLf
HelpSearch=HelpSearch&"}"& vbCrLf
HelpSearch=HelpSearch&"</script>"& vbCrLf
HelpSearch=HelpSearch&"<form name=search action=''   method='get' onSubmit='return checkForm()'>"& vbCrLf
HelpSearch=HelpSearch&"<input name=do type=hidden value='true'>"& vbCrLf
HelpSearch=HelpSearch&"<input name=comeFrom type=hidden value='function'>"& vbCrLf
HelpSearch=HelpSearch&"<input name=block type=hidden value='all'>"& vbCrLf
HelpSearch=HelpSearch&"　　<font class=s>提问：</font>"& vbCrLf
HelpSearch=HelpSearch&"<input name='keywords' type='text' onClick=""if(document.search.keywords.value=='请输入关键字'){document.search.keywords.select();document.search.keywords.focus();}"" value='请输入关键字' size='20'>"& vbCrLf
HelpSearch=HelpSearch&"<select name='searchPlace'>"& vbCrLf
HelpSearch=HelpSearch&"<option value=1 >按标题找</option>"& vbCrLf
HelpSearch=HelpSearch&"<option value=2 >按内容找</option>"& vbCrLf
HelpSearch=HelpSearch&"</select>"& vbCrLf
HelpSearch=HelpSearch&"<input type='submit' name='Submit' value='找答案' class='inputs'>"& vbCrLf
HelpSearch=HelpSearch&"</form>"& vbCrLf
HelpSearch=HelpSearch&"</li>"
HelpSearch=HelpSearch&"</div>"

if request("id")<>"" then
	HelpMain="<div class=helpmain>"
	if Chkrequest(request("id")) then
	id=request("id")
	end if
	set rs=server.createobject("adodb.recordset") 
	sql="select * from JOB_help where id="&id&""
	Set rs= Server.CreateObject("ADODB.Recordset") 
	rs.open sql,conn,1,1
	if not rs.eof then
	HelpMain=HelpMain&"<li><strong><a href=index.asp?id="&rs("id")&">"&rs("showname")&"</a></strong></li>"
	HelpMain=HelpMain&"<li>"&rs("content")&"</li>"
	end if
	rs.Close
	HelpMain=HelpMain&"<li><a href='javascript:history.go(-1)'><strong>返回 >></strong></a></li>"
	HelpMain=HelpMain&"</div>"
else
HelpMain="<div class=helpmain>"
if rs.eof then
HelpMain=HelpMain&"<br><br><div align='center'>暂无数据信息</div><br><br>"
else
do while not rs.eof
HelpMain=HelpMain&"<li><strong><a href='index.asp?id="&rs("id")&"'>"
Set re = New RegExp
re.Pattern ="("&keywords&")"
re.IgnoreCase = True
re.Global=True
result = re.Replace(rs("showname"), "<font color=red>$1</font>")
HelpMain=HelpMain&result&"</a></strong></li>"
HelpMain=HelpMain&"<li>"&left(rs("content"),100)&"...</li>"
rs.movenext
loop
end if
HelpMain=HelpMain&"</div>"
end if

html=ReplaceLableFlag(ReplaceAllLabel(html))
html=Replace(html,"{$FR_帮助导航}",HelpMenu)
html=Replace(html,"{$FR_帮助搜索}",HelpSearch)
html=Replace(html,"{$FR_帮助内容}",HelpMain)
html=Replace(html,"{$FR_频道地址}",FormatLink(0,ChannelId,0,0,0))
html=Replace(html,"{$FR_频道名称}",ChannelName)
html=Replace(html,"{$FR_频道编号}",Cid)
html=Replace(html,"{$FR_签写留言}",GBook)
Response.Write(CreateHTMLReplace(html))
CloseConn
%>