<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_SystemSetweburl")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action"):WS_Urid=request("WS_Urid"):searchtype=request("searchtype"):keywords=request("keywords"):searchmode=request("searchmode"):ColumnName="":Tablename="HX_WebUrlSearch"
select case action
  case "del"
    conn.execute("delete from HX_WebUrlSearch where WS_Urid="&WS_Urid)
	response.redirect "WebUrlSearch.asp"
	response.end
  case "search"
    Orderby=" where 1=1"
    if searchmode=1 then
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_WebSearchName like '%"&keywords&"%'"
	  elseif searchtype=2 then
	    Orderby=Orderby&" and WS_WebSearchUrl like '%"&keywords&"%'"
	  else
	    Orderby=Orderby&" and WS_webUrlContent like '%"&keywords&"%'"
	  end if
	else
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_WebSearchName='"&keywords&"'"
	  elseif searchtype=2 then
	    Orderby=Orderby&" and WS_WebSearchUrl='"&keywords&"'"
	  else
	    Orderby=Orderby&" and WS_webUrlContent='"&keywords&"'"
	  end if
	end if
  case else
    Orderby=" ORDER BY WS_Urid DESC"
end select
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)  
response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>常用网址查询</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><script src='../hxinclude/HX_function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='25'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>常用网址查询</font></td></tr></table><table width='100%'  border='0' cellpadding='0' cellspacing='1' bgcolor=613c25><tr bgcolor='FFFBE8'><td height='24'><table width='100%'  border='0' cellspacing='1' cellpadding='2' bgcolor='#BF9B73'><tr bgcolor='#FFFBE8'><td width='8%'><div align='center'>序号</div></td><td width='23%' bgcolor='#FFFBE8'><div align='center'>网站名称</div></td><td width='22%' bgcolor='#FFFBE8'><div align='center'>网站地址</div></td><td width='24%' bgcolor='#FFFBE8'><div align='center'>网站说明</div></td><td width='23%' bgcolor='#FFFBE8'><div align='center'>操 作</div></td></tr>"
if rs.recordcount<=0 then
	   response.Write "<tr><td colspan=5 height=25 bgcolor=FFFBE8 align=center><font color=red>暂 无 数 据!</font></td></tr>"
else
rs.PageSize =15 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
 page=1
else
 page=cint(page)
end if
if page<1 then
  page=1
elseif  page>maxpage then
  page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
  x=iCount-(maxpage-1)*iPageSize
else
  x=iPageSize
end if
ii=0
do while not rs.EOF
response.write "<tr "
if ii mod 2=0 then response.write "bgcolor='#FFFBE8'" else response.write "bgcolor='#FFFBE8'"
	  response.write "><td align=center>"&rs("WS_Urid")&"</td><td>"&rs("WS_WebSearchName")&"</td><td><a href='http://"&replace(rs("WS_WebSearchUrl"),"http://","")&"' target='_blank'>"&replace(rs("WS_WebSearchUrl"),"http://","")&"</a></td><td title='"&rs("WS_webUrlContent")&"'>"&left(rs("WS_webUrlContent"),10)&"</td><td align=center><input type='button' name='Submit3' value=' 修 改 ' onclick=""openwin(430,300,'weburlsearchedit.asp?WS_Urid="&rs("WS_Urid")&"')""> <input type='button' name='Submit3' value=' 删 除 ' onclick=""if(!confirm('是否要删除此信息')) return false;else location.href='?action=del&WS_Urid="&rs("WS_Urid")&"';""></td></tr>"
	ii=ii+1
if ii>=rs.PageSize then Exit Do
rs.movenext
loop
call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",5)
end if
WS_S.HX_RSClose rs 
response.Write "<form name='form1' method='post' action='?action=search'><tr bgcolor='#FFFBE8'><td colspan='5'>查询：<select name='searchtype'><option value='1' selected>网站名称</option><option value='2'>网站地址</option><option value='3'>网站说明</option></select><input name='keywords' type='text' size='25' maxlength='50'> <input type='radio' name='searchmode' value='1' id='mh' class='radio' checked><label for=mh>模糊</label> <input type='radio' name='searchmode' value='2' id='jq' class='radio'><label for=jq>精确</label><input type='submit' name='Submit2' value=' 搜 索 '> <input type='button' name='Submit3' value=' 添 加 ' onclick=""openwin(430,300,'weburlsearchadd.asp')""></td></tr></form></table></td></tr><tr bgcolor='#FFFBE8'><td width='100%' height='24' align='right'><input type='submit' name='Submit' value=' 打 印 ' onclick='javascript:window.print();'></td></tr></table></td></tr></table>"
%>