?? index.php
字號:
<?
include_once("../auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>公告通知</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<font color=blue size=+2><b>新公告通知</b></font>
<br><br>
<?
//============================ 顯示公告通知 =======================================
$CUR_DATE=date("Y-m-d",time());
$query = "SELECT * from NOTIFY where (TO_ID='ALL_DEPT' or find_in_set('$LOGIN_DEPT_ID',TO_ID) or find_in_set('$LOGIN_USER_PRIV',PRIV_ID) or find_in_set('$LOGIN_USER_ID',USER_ID)) and begin_date<='$CUR_DATE' and (end_date>='$CUR_DATE' or end_date is null) and PUBLISH='1' and READERS not like '%,$LOGIN_USER_ID,%' and READERS not like '$LOGIN_USER_ID,%' order by TOP desc,BEGIN_DATE desc,SEND_TIME desc";
$cursor= exequery($connection,$query);
$NOTIFY_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$NOTIFY_COUNT++;
//---- 顯示20條 ----
if($NOTIFY_COUNT>20)
break;
$NOTIFY_ID=$ROW["NOTIFY_ID"];
$FROM_ID=$ROW["FROM_ID"];
$SUBJECT=$ROW["SUBJECT"];
$TOP=$ROW["TOP"];
$TYPE_ID=$ROW["TYPE_ID"];
$SUBJECT=str_replace("<","<",$SUBJECT);
$SUBJECT=str_replace(">",">",$SUBJECT);
$SUBJECT=stripslashes($SUBJECT);
$BEGIN_DATE=$ROW["BEGIN_DATE"];
$BEGIN_DATE=strtok($BEGIN_DATE," ");
$TYPE_NAME=get_code_name($TYPE_ID,"NOTIFY");
if($TYPE_NAME!="")
$SUBJECT="【".$TYPE_NAME."】".$SUBJECT;
$query1 = "SELECT * from USER where USER_ID='$FROM_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$FROM_NAME=$ROW["USER_NAME"];
else
$FROM_NAME=$FROM_ID;
?>
<?=$NOTIFY_COUNT?>.<?=$FROM_NAME?>:<?=$SUBJECT?><br>
<i><?=$BEGIN_DATE?></i>
<?if($TOP=="1") echo "<font color=red><b>重要:</b></font>";?><a href="read.php?P=<?=$P?>&NOTIFY_ID=<?=$NOTIFY_ID?>">閱讀</a>
<hr>
<?
}//while
if($NOTIFY_COUNT==0)
echo "無新公告通知";
?>
<a href="../main.php?P=<?=$P?>">返回</a>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -