search.php

来自「极限网络智能办公系统 Office Automation V3.0官方100%源」· PHP 代码 · 共 190 行

PHP
190
字号
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
include_once("inc/check_type.php");
?>

<html>
<head>
<title>会议查询</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body class="bodycolor" topmargin="5">
<?
$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=$M_START_B." 00:00:00";
else
   $M_START_B="";
if($M_END_B!="")
   $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'";
?>

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
 <tr>
  <td class="Big"><img src="/images/menu/infofind.gif" width="22" height="18" align="absMiddle"><span class="big3"> 查询结果</span><br>
  </td>
 </tr>
</table>

<?
$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"];
 if($MEETING_COUNT==1)
 {
?>
<br>
<table border="0" cellspacing="1" width="90%" class="small" bgcolor="#000000" cellpadding="3" align="center">
  <tr class="TableHeader">
      <td nowrap align="center">会议名称</td>
      <td nowrap align="center">申请人</td>
      <td nowrap align="center">出席人员</td>
      <td nowrap align="center">会议状态</td>
      <td nowrap align="center">链接</td>
      <td nowrap align="center">会议室</td>
    </tr>
<?
 }
 if($MEETING_COUNT%2==1)
    $TableLine="TableLine1";
 else
    $TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
	<td nowrap align="center"><?=$M_NAME?></td>
  <td nowrap align="center"><u title="部门:<?=$DEPT_NAME?>" style="cursor:hand"><?=$M_PROPOSER_NAME?></u></td>
  <td align="left"><?=$M_ATTENDEE_NAME?></td>
  <td nowrap align="center">
<?
  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;
?>
</td>
<td nowrap align="center"><a href="javascript:;" onClick="window.open('../apply/meeting_detail.php?M_ID=<?=$M_ID?>','','height=400,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=auto,left=250 top=150,resizable=yes');">详细信息</a></td>
<td nowrap align="center"><?=$M_ROOM_NAME?></a></td>
</tr>

<?
 }//while ROW

if($MEETING_COUNT==0)
{
   Message("","无符合条件的会议");
   Button_Back();
   exit;
}
else
{
?>
</table>
<?
Button_Back();
}
?>
</body>
</html>

⌨️ 快捷键说明

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