⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.php

📁 极限网络智能办公系统 - Office Automation 2008 官方100% 源码
💻 PHP
字号:
<?php
 

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/check_type.php" );
echo "\r\n<html>\r\n<head>\r\n<title>会议查询</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$CUR_DATE = date( "Y-m-d", time( ) );
if ( $M_START_B != "" )
{
	$TIME_OK = is_date( $M_START_B );
	if ( !$TIME_OK )
	{
		message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
		button_back( );
		exit( );
	}
}
if ( $M_END_B != "" )
{
	$TIME_OK = is_date( $M_END_B );
	if ( !$TIME_OK )
	{
		message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
		button_back( );
		exit( );
	}
}
if ( $M_START_B != "" )
{
	$M_START_B .= " 00:00:00";
}
else
{
	$M_START_B = "";
}
if ( $M_END_B != "" )
{
	$M_END_B .= " 23:59:59";
}
else
{
	$M_START_B = "";
}
$CONDITION_STR = "";
if ( $M_NAME != "" )
{
	$CONDITION_STR .= " and M_NAME like '%".$M_NAME."%'";
}
if ( $TO_ID != "" )
{
	$CONDITION_STR .= " and M_PROPOSER='".$TO_ID."'";
}
if ( $M_START_B != "" )
{
	$CONDITION_STR .= " and M_START>='".$M_START_B."'";
}
if ( $M_END_B != "" )
{
	$CONDITION_STR .= " and M_START<='".$M_END_B."'";
}
if ( $M_ROOM != "" )
{
	$CONDITION_STR .= " and M_ROOM='".$M_ROOM."'";
}
if ( $M_STATUS != "" )
{
	$CONDITION_STR .= " and M_STATUS='".$M_STATUS."'";
}
$QUERY_STR = "&M_NAME=".$M_NAME."&TO_ID={$TO_ID}&M_START_B={$M_START_B}&M_END_B={$M_END_B}&M_ROOM={$M_ROOM}&M_STATUS={$M_STATUS}";
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n  <td class=\"Big\"><img src=\"/images/menu/infofind.gif\" width=\"22\" height=\"18\" align=\"absMiddle\"><span class=\"big3\"> 查询结果</span><br>\r\n  </td>\r\n </tr>\r\n</table>\r\n\r\n";
$query = "SELECT * from MEETING where 1=1";
$query .= $CONDITION_STR." order by M_START desc, M_ROOM desc";
$cursor = exequery( $connection, $query );
$MEETING_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	++$MEETING_COUNT;
	$M_ID = $ROW['M_ID'];
	$M_NAME = $ROW['M_NAME'];
	$M_PROPOSER = $ROW['M_PROPOSER'];
	$M_ATTENDEE = $ROW['M_ATTENDEE'];
	$M_START = $ROW['M_START'];
	$M_END = $ROW['M_END'];
	$M_ROOM = $ROW['M_ROOM'];
	$M_STATUS = $ROW['M_STATUS'];
	$M_ATTENDEE_OUT = $ROW['M_ATTENDEE_OUT'];
	$USER_NAME2 = "";
	$TOK = strtok( $M_ATTENDEE, "," );
	while ( $TOK != "" )
	{
		$query2 = "SELECT * from USER where USER_ID='".$TOK."'";
		$cursor2 = exequery( $connection, $query2 );
		if ( $ROW = mysql_fetch_array( $cursor2 ) )
		{
			$USER_NAME2 .= $ROW['USER_NAME'].",";
		}
		$TOK = strtok( "," );
	}
	$USER_NAME2 = substr( $USER_NAME2, 0, -1 );
	$M_ATTENDEE_NAME = "内部:".$USER_NAME2."<br>外部:".$M_ATTENDEE_OUT;
	$M_NAME = str_replace( "<", "&lt", $M_NAME );
	$M_NAME = str_replace( ">", "&gt", $M_NAME );
	$M_NAME = stripslashes( $M_NAME );
	$SUMMARY = str_replace( "<", "&lt", $SUMMARY );
	$SUMMARY = str_replace( ">", "&gt", $SUMMARY );
	$SUMMARY = stripslashes( $SUMMARY );
	if ( $M_START == "0000-00-00 00:00:00" )
	{
		$M_START = "";
	}
	if ( $M_END == "0000-00-00 00:00:00" )
	{
		$M_END = "";
	}
	$M_START = substr( $M_START, 0, 16 );
	$M_END = substr( $M_END, 0, 16 );
	$query1 = "select * from USER where USER_ID='".$M_PROPOSER."'";
	$cursor1 = exequery( $connection, $query1 );
	if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
	{
		$M_PROPOSER_NAME = $ROW1['USER_NAME'];
		$DEPT_ID = $ROW1['DEPT_ID'];
	}
	$DEPT_NAME = dept_long_name( $DEPT_ID );
	$query2 = "SELECT * from MEETING_ROOM where MR_ID='".$M_ROOM."'";
	$cursor2 = exequery( $connection, $query2 );
	if ( $ROW2 = mysql_fetch_array( $cursor2 ) )
	{
		$M_ROOM_NAME = $ROW2['MR_NAME'];
	}
	$MA_FLAG = "";
	$MA_ID = "";
	$query2 = "SELECT * from MEETING_ATTENDEE_NOT where M_ID='".$M_ID."' and USER_ID='{$LOGIN_USER_ID}'";
	$cursor2 = exequery( $connection, $query2 );
	if ( $ROW2 = mysql_fetch_array( $cursor2 ) )
	{
		$MA_FLAG = $ROW2['MA_FLAG'];
		$MA_ID = $ROW2['MA_ID'];
		$MA_REASON = $ROW2['REASON'];
		$M_PROPOSER = $ROW2['M_PROPOSER'];
		if ( $MA_FLAG == 1 )
		{
			$MA_DESC = "参加";
		}
		else if ( $MA_FLAG == 2 )
		{
			$MA_DESC = "不参加";
		}
		else
		{
			$MA_DESC = "未定";
		}
	}
	if ( $MEETING_COUNT == 1 )
	{
		echo "<br>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n  <tr class=\"TableHeader\">\r\n      <td nowrap align=\"center\">会议名称</td>\r\n      <td nowrap align=\"center\">申请人</td>\r\n      <td nowrap align=\"center\">出席人员</td>\r\n      <td nowrap align=\"center\">开始时间</td>\r\n      <td nowrap align=\"center\">会议状态</td>\r\n      <td nowrap align=\"center\">链接</td>\r\n      <td nowrap align=\"center\">会议室</td>\r\n      <td nowrap align=\"center\">参加状态</td>\r\n      <td nowrap align=\"center\">操作</td>\r\n    </tr>\r\n";
	}
	if ( $MEETING_COUNT % 2 == 1 )
	{
		$TableLine = "TableLine1";
	}
	else
	{
		$TableLine = "TableLine2";
	}
	echo "<tr class=\"";
	echo $TableLine;
	echo "\">\r\n\t<td nowrap align=\"center\">";
	echo $M_NAME;
	echo "</td>\r\n  <td nowrap align=\"center\"><u title=\"部门:";
	echo $DEPT_NAME;
	echo "\" style=\"cursor:hand\">";
	echo $M_PROPOSER_NAME;
	echo "</u></td>\r\n  <td align=\"left\">";
	echo $M_ATTENDEE_NAME;
	echo "</td>\r\n  <td align=\"left\">";
	echo $M_START;
	echo "</td>\r\n  <td nowrap align=\"center\">\r\n";
	if ( $M_STATUS == 0 )
	{
		$M_STATUS = "待批";
	}
	if ( $M_STATUS == 1 )
	{
		$M_STATUS = "已批准";
	}
	if ( $M_STATUS == 2 )
	{
		$M_STATUS = "进行中";
	}
	if ( $M_STATUS == 3 )
	{
		$M_STATUS = "未批准";
	}
	if ( $M_STATUS == 4 )
	{
		$M_STATUS = "已结束";
	}
	echo $M_STATUS;
	echo "</td>\r\n<td nowrap align=\"center\"><a href=\"javascript:;\" onClick=\"window.open('../query/meeting_detail.php?M_ID=";
	echo $M_ID;
	echo "','','height=400,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=250 top=150,resizable=yes');\">详细信息</a></td>\r\n<td nowrap align=\"center\">";
	echo $M_ROOM_NAME;
	echo "</a></td>\r\n<td nowrap align=\"center\" title=";
	echo $MA_REASON;
	echo ">";
	echo $MA_DESC;
	echo "</a></td>\r\n<td nowrap align=\"center\">\r\n";
	if ( $M_STATUS != "已结束" )
	{
		if ( $MA_FLAG == 2 || $MA_FLAG == "" )
		{
			echo "<a href='attendee.php?M_ID=".$M_ID."&MA_FLAG=1&MA_ID={$MA_ID}{$QUERY_STR}'>参加</a>";
		}
		echo " \r\n";
		if ( $MA_FLAG == 1 || $MA_FLAG == "" )
		{
			echo "<a href='reason.php?M_ID=".$M_ID."&MA_FLAG=2&MA_ID={$MA_ID}{$QUERY_STR}'>不参加</a>";
		}
		echo " \r\n";
	}
	if ( $M_STATUS == "进行中" && $LOGIN_USER_ID == $M_PROPOSER )
	{
		echo "     <a href=\"javascript:;\" onClick=\"window.open('../apply/summary.php?M_ID=";
		echo $M_ID;
		echo "','','height=570,width=740,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=150,top=80,resizable=yes');\">会议纪要</a>&nbsp;\r\n";
	}
	echo "  </td>\r\n</tr>\r\n\r\n";
}
if ( $MEETING_COUNT == 0 )
{
	message( "", "无符合条件的会议" );
	button_back( );
	exit( );
}
echo "</table>\r\n<br>\r\n<div align=center>\r\n        <input type=\"button\" value=\"返回\" class=\"BigButton\" onClick=\"location='./'\">\r\n  </div>\r\n";
echo "</body>\r\n</html>";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -