<!--#include file="../inc/Secure.htm"-->
<%dim ThisKey
ThisKey = "v"
%>
<!--#include file="../inc/permission.htm"-->
<!--#include file="../inc/conn.htm"-->
<!--#include file="../inc/dbtools.htm"-->
<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>
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0

if trim(request("todo"))="delete" and trim(request("SelectID"))<>"" and isnumeric(trim(request("SelectID"))) then
	oConn.execute "delete tblMeetingOrder where ID="& trim(request("SelectID"))
end if

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

MeetingID=trim(request("MeetingID"))
if MeetingID="" then MeetingID=0
Title=replace(trim(request("Title")),"'","''")
StartTime=replace(trim(request("StartTime")),"'","''")
EndTime=replace(trim(request("EndTime")),"'","''")
if StartTime<>"" and EndTime<>"" then
	if cdate(StartTime)>cdate(EndTime) then StartTime=EndTime
end if
if StartTime<>"" and isdate(StartTime) then
if cdate(StartTime)>date() then StartTime=date()
end if

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,MeetingID,OrderName,OrderTime,Title,Department,Starttime,EndTime,Manager,Schedule,body,Joinman,JoinEvery,JoinDepartment from tblMeetingOrder where ID>0 "
if MeetingID<>"0" then
sql=sql& " and MeetingID="& MeetingID
end if
if Title<>"" then
sql=sql& " and OrderName like '%"& Title &"%' "
end if
if StartTime<>"" then
sql=sql& " and StartTime>='"& StartTime &"' "
end if
if EndTime<>"" then
sql=sql& " and EndTime<'"& cdate(EndTime)+1 &"' "
end if
sql=sql& " order by MeetingID, ID DESC"

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

rs.close
%>


<form name="SearchForm" method="post" action="">
<div align=center>
<table border=0 width="90%" bgcolor=#53A9FF cellspacing=1>
<tr bgcolor=#FFFFFF><td>
	<table border=0 width="100%" bgcolor=#FFFFFF cellspacing=1>
	<tr bgcolor=#FFFFFF>
	<td width="15%">复合检索：</td>
	<td width="30%">会议室：<%options "MeetingID","tblMeeting","Name",MeetingID%></td>
	<td width="40%">预约人：<input type="text" name="Title" class="input" size=20></td>
	<td></td>
	</tr>
	<tr bgcolor=#FFFFFF>
	<td width="15%"></td>
	<td width="30%">时间段：<input type="text" name="StartTime" class="input" size=10></td>
	<td width="40%">截止：<input type="text" name="EndTime" class="input" size=10>(yyyy-mm-dd)</td>
	<td><input type="submit" name="cmdUp" value="检  索" class="font9boldwhite"></td>
	</tr>
	</table>
</td></tr></table>
</div>
</form>
<div align=center>
<table border=0 width="90%"><tr>
      <td>&nbsp;</td>
    </tr></table></div>

<div align="center">
<table border=1 cellpadding=3 cellspacing=1 width="90%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
	<tr bgcolor=#CCCCCC>
      <td colspan=4 align=center> &nbsp;&nbsp;&nbsp;<img src="../images/delete.gif" border=0> 
      </td>
    </tr>
	<tr>
	<td nowrap>主题:</td>
	<td>
	<%if trim(msgArr(4,i))<>"" then%>
	<%=trim(msgArr(4,i))%>
	<%end if%>
	&nbsp;</td>
	<td nowrap>会议主持人:</td>
	<td>
	<%if trim(msgArr(8,i))<>"" then%>
	<%=trim(msgArr(8,i))%>
	<%end if%>
	&nbsp;</td>
	</tr>
	<tr>
	<td width="15%">使用部门:</td>
	<td width="35%">
	<%if trim(msgArr(5,i))<>"" then%>
	<%=GetTableValue("tblDepartment","Name","ID",trim(msgArr(5,i)))%>
	<%end if%>
	&nbsp;</td>
	<td nowrap width="15%">预约人:</td>
	<td width="35%">
	<%if trim(msgArr(2,i))<>"" then%>
	<%=trim(msgArr(2,i))%>
	<%end if%>
	&nbsp;</td>
	</tr>

	<tr>
	
	<td nowrap width=60>填写时间:</td>
	<td colspan=3>
	<%if trim(msgArr(3,i))<>"" then%>
	<%=trim(msgArr(3,i))%>
	<%end if%>
	&nbsp;</td>
		</tr>

	

	<tr>
	<td nowrap>会议介绍：</td>
	<td colspan=3><%=replace(replace(server.htmlencode(trim(msgArr(10,i))&""),chr(13),"<br>")," ","&nbsp;")%>&nbsp;</td>
	</tr>
	<tr>
	<td nowrap>与会人员：</td>
	<td colspan=3>
	<%
	JoinMan=trim(msgArr(11,i))
	JoinEvery=trim(msgArr(12,i))
	JoinDepartment=trim(msgArr(13,i))
	if JoinEvery<>"0" then
		str="全体员工！"
	elseif JoinDepartMent<>"0" then
		str=GettableValue("TblDepartment","Name","ID",JoinDepartment)
	else
		str=replace(replace(server.htmlencode(trim(msgArr(11,i))&""),chr(13),"<br>")," ","&nbsp;")
	end if
	%><%=str%>&nbsp;</td>
	</tr>
	<tr>
	<td nowrap>会议安排：</td>
	<td colspan=3><%=replace(replace(server.htmlencode(trim(msgArr(9,i))&""),chr(13),"<br>")," ","&nbsp;")%>&nbsp;</td>
	</tr>
			
</table>
</div><BR></table>
</div> <BR>
<BR>

</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
//	document.NewsForm.cmdDelete.value !=""
	return confirm("确实删除吗？");
}
</script>
<%
Function GetTableValue(TableName,Field,ValueField,Value)
	if TableName<>"" and Value<>"" and isnumeric(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>