<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_AnnexProgramlawrulesearch")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action"):WS_Laid=request("WS_Laid"):searchtype=request("searchtype"):keywords=request("keywords"):searchmode=request("searchmode"):ColumnName="":Tablename="HX_lawruleSearch"
select case action
  case "del" conn.execute("delete from HX_lawruleSearch where WS_Laid="&WS_Laid):response.redirect "lawruleSearch.asp":response.end
  case "search"
    Orderby=" where 1=1"
	if searchtype>1 and not IsDate(keywords) then HX_GoBack "日期格式错误！",""
    if searchmode=1 then
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_LawRuleTitle like '%"&keywords&"%'"
	  elseif searchtype=2 then
	    Orderby=Orderby&" and WS_StartCaseDate=#"&keywords&"#"
	  else
	    Orderby=Orderby&" and WS_StartDate=#"&keywords&"#"
      end if
	else
	  if searchtype=1 then
	    Orderby=Orderby&" and WS_LawRuleTitle='"&keywords&"'"
	  elseif searchtype=2 then
	    Orderby=Orderby&" and WS_StartCaseDate=#"&keywords&"#"
	  else
	    Orderby=Orderby&" and WS_StartDate=#"&keywords&"#"
      end if
	end if
  case else Orderby=" ORDER BY WS_Laid 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='37%' bgcolor='#FFFBE8'><div align='center'>法规名称</div></td><td width='16%' bgcolor='#FFFBE8'><div align='center'>实施日期</div></td><td width='16%' 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_Laid")&"</td><td><a href='javascript:' onclick=""openwin(600,500,'lawruleview.asp?WS_Laid="&rs("WS_Laid")&"')"">"&rs("WS_LawRuleTitle")&"</a></td><td>"
	      if rs("WS_StartCaseDate")<date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartCaseDate"),5),"red")
		  elseif rs("WS_StartCaseDate")=date then
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartCaseDate"),5),"#613c25")
		  else
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartCaseDate"),5),"blue")
		  end if
		   response.write "</td><td>"
		  if rs("WS_StartDate")<date then 
	        response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartDate"),5),"red")
		  elseif rs("WS_StartDate")=date then
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartDate"),5),"#613c25")
		  else
		    response.write WS_S.FormatColor(WS_S.Format_time(rs("WS_StartDate"),5),"blue")
		  end if
	  response.write "</td><td align=center><input type='button' name='Submit3' value=' 修 改 ' onclick=""openwin(430,380,'lawrulesearchedit.asp?WS_Laid="&rs("WS_Laid")&"')""> <input type='button' name='Submit3' value=' 删 除 ' onclick=""if(!confirm('是否要删除此信息')) return false;else location.href='?action=del&WS_Laid="&rs("WS_Laid")&"';""></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
call WS_S.HX_RSClose(rs) 
response.write "<form name='form1' method='post' action='?action=search'><tr bgcolor='#FFFBE8'><td colspan='5'>查询：<select name='searchtype' onChange=""if(document.form1.searchtype.options[document.form1.searchtype.selectedIndex].value!=1) {document.form1.searchmode.disabled = true;document.form1.keywords.value='"&date()&"';}else {document.all.form1.searchmode.disabled = false;document.form1.keywords.value='';}""><option value='1' selected>法规名称</option><option value='2'>实施日期</option><option value='3'>颁布日期</option></select> <input name='keywords' type='text' size='25' maxlength='50'> <input name='searchmode' type='checkbox' value='1' id='mh' class='radio'><label for=mh>模糊</label><label for=jq></label> <input type='submit' name='Submit2' value=' 搜 索 '> <input type='button' name='Submit3' value=' 添 加 ' onclick=""openwin(430,380,'lawrulesearchadd.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>"   
%>