<!--#include file="../inc/Secure.htm"-->
<!--#include file="../inc/conn.htm"-->
<!--#include file="../inc/dbtools.htm"-->
<%
ClassID=trim(Request("ClassID"))
if ClassID="" then ClassID=1
select case classID
	case "1"
	ClassName="公务活动安排"
	case "2"
	ClassName="公务活动接待"
	case "3"
	ClassName="事务接洽记录"
end select
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
todo=request("todo")
ID=trim(Request("ID"))

if todo="delete" and ID<>"" then
	oConn.execute "delete tblInfo where ClassID="& ClassID &" and ID="& ID
end if

maxmessage=20
currentpage=request("page")
if currentpage="" then 
currentpage=1
end if

Title=replace(trim(request("Title")),"'","''")

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,ClassID,FromName,Title,Times from tblInfo where ClassID="& ClassID

if Title<>"" then
sql=sql& " and Title like '%"& Title &"%'"
end if
sql=sql& " order by ID desc"

rs.pagesize=maxmessage
rs.open sql,oConn,1,1
totalpage=rs.pagecount
totalmessage=rs.recordcount
if totalmessage<>0 then
	rs.AbsolutePage=currentpage
	arrMsg=rs.getrows(maxmessage)
end if

rs.close
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" leftmargin=20 topmargin=5>
<BR>
<fieldset title="<%=className%>">
<form name="SearchForm" method="post" action="">
<div align=center>
<table border=0>
<tr>
<td>关键词：<input type="text" name="Title" class="input" size=20></td>
<td><input type="submit" name="cmdUp" value="检  索" class="font9boldwhite"></td>
</table>
  </div>
</form>

<div align=center>
<table border=1 cellpadding=3 cellspacing=1 width="95%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
	<tr bgcolor=#CCCCCC>
	<td width=80>录入用户</td>
	<td>标题</td>
	<td width="20%">录入时间</td>
	<td width="8%"></td>
</tr>
<%for i = 0 to UBound(arrMsg,2)
%>

<tr>
	<td><%=arrmsg(2,i)%></td>
	<td><a href="info_detail.htm?ID=<%=trim(arrmsg(0,i))%>"><%=arrmsg(3,i)%></a></td>
	<td><%=arrmsg(4,i)%></td>
	<td><a href="info_admin.htm?classid=<%=classID%>&todo=delete&ID=<%=trim(arrmsg(0,i))%>" onclick="return CheckDelete();">删除</a></td>
</tr>

<%
next%>
</table><BR>
</div>
<BR>
</fieldset>

</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
	return confirm("确实删除吗？");
}
</script>
<%
Function GetTableValue(TableName,Field,ValueField,Value)
	if TableName<>"" and Value<>"" then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'"
		Rstmp.open strSql,oConn,1,1
		If not Rstmp.eof then
			GetTableValue=trim(Rstmp(Field))
		else
			GetTableValue=""
		end if
		Rstmp.close
		'set RsTmp = Nothing
	else
		GetTableValue=""
	end if
End Function

%>
<!--#include file="../inc/conn_close.htm"-->
<script language=javascript>
function CheckDelete()
{
	return confirm("确实删除吗？");
}
</script>