<!--#include file="base.asp"-->
<%
''' EYCMS 消息
''' ==================================================================
	
	sub del()
		dim id:id=eycms.getint(eycms.fget("id",0),0)
		if id>0 then
			eycms.db.dbdel "ey_errlog","id="&id&""
		end if
		eycms.echo "1"
	end sub
	
	sub delall()
		dim id:id=eycms.enhtml(eycms.fget("id",0))
		dim idarr:idarr=split(id,",")
		if ubound(idarr)<0 then
			eycms.echo "0&#33267;&#23569;&#36873;&#25321;&#19968;&#26465;&#20449;&#24687;"
		else
			dim i
			for i=0 to ubound(idarr)
				if not isnumeric(idarr(i)) then
					eycms.echo "0&#21442;&#25968;&#65306;"&id(i)&"&#19981;&#27491;&#30830;&#65292;&#35831;&#30830;&#35748;&#21518;&#20877;&#25805;&#20316;"
					exit sub
				end if
			next
			eycms.db.dbdel "ey_errlog","id in("&id&")"
			eycms.echo "1"
		end if
	end sub
	
	sub delno()
		eycms.db.dbdel "ey_errlog","isread=0"
		eycms.echo "1"
	end sub
	
	islogin
	dim act:act=lcase(eycms.fget("act",0))
	dim keyword:keyword=eycms.enhtml(eycms.fget("keyword",1))
	select case act
		case "del":del
		case "delall":delall
		case "delno":delno
		case "show"
			dim id:id=eycms.getint(eycms.fget("id",0),0)
			dim data:data=eycms.db.dbload(1,"createdate,content,isread","ey_errlog","id="&id&"","")
			if ubound(data)>=0 then
				if data(2,0)=0 then
					eycms.db.dbupdate "ey_errlog","id="&id&"",array(array("isread",1,0,0))
				end if
				load theme_errlog_show
			end if
		case else
			dim wherekey
			if eycms.strlen(keyword)>0 then
				if datatype then
					wherekey=" and instr(lcase(content),lcase('"&keyword&"'))>0 "
				else
					wherekey=" and content like '%"&keyword&"%'"
				end if
			end if
		load theme_errlog
	end select
	eycms.db.dbclose
%>
