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

📄 notify.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/function_page_01.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\r\n";
echo "<s";
echo "cript Language=JavaScript>\r\nwindow.setTimeout('this.location.reload();',120000);\r\n</script>\r\n\r\n";
echo "<s";
echo "cript>\r\nfunction open_notify(NOTIFY_ID)\r\n{\r\n URL=\"../show/read_notify.php?NOTIFY_ID=\"+NOTIFY_ID;\r\n myleft=(screen.availWidth-500)/2;\r\n window.open(URL,\"read_notify\",\"height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n</script>\r\n\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"0\">\r\n<table border=\"0\" width=\"100%\" >\r\n  <tr>\r\n    <td vali";
echo "gn=\"bottom\">共&nbsp;\r\n        ";
$CUR_TIME = date( "Y-m-d H:i:s", time( ) );
$CUR_DATE = date( "Y-m-d", time( ) );
$NOTIFY_COUNT = 0;
if ( $NOTIFY_TYPE == 1 )
{
	$query = "SELECT COUNT(*) AS cnt from NOTIFY where TO_ID='ALL_DEPT' and begin_date<='{$CUR_DATE}' and (end_date>='{$CUR_DATE}' or end_date is null) order by BEGIN_DATE desc,NOTIFY_ID desc";
}
else
{
	$query = "SELECT COUNT(*) AS cnt from NOTIFY where (InStr(TO_ID,',{$LOGIN_DEPT_ID},')>0 or InStr(TO_ID,'{$LOGIN_DEPT_ID},')=1) and begin_date<='{$CUR_DATE}' and (end_date>='{$CUR_DATE}' or end_date is null) order by BEGIN_DATE desc,NOTIFY_ID desc";
}
$query = page( $query, 20 );
$cursor = exequery( $connection, $query );
$ROW = mysql_fetch_array( $cursor );
echo $ROW['cnt'];
echo "&nbsp;则公告 </td>\r\n  </tr>\r\n</table>\r\n";
$connection = openconnection( );
$CUR_TIME = date( "Y-m-d H:i:s", time( ) );
$CUR_DATE = date( "Y-m-d", time( ) );
$NOTIFY_COUNT = 0;
if ( $NOTIFY_TYPE == 1 )
{
	$query = "SELECT * from NOTIFY where TO_ID='ALL_DEPT' and begin_date<='{$CUR_DATE}' and (end_date>='{$CUR_DATE}' or end_date is null) order by BEGIN_DATE desc,NOTIFY_ID desc";
}
else
{
	$query = "SELECT * from NOTIFY where (InStr(TO_ID,',{$LOGIN_DEPT_ID},')>0 or InStr(TO_ID,'{$LOGIN_DEPT_ID},')=1) and begin_date<='{$CUR_DATE}' and (end_date>='{$CUR_DATE}' or end_date is null) order by BEGIN_DATE desc,NOTIFY_ID desc";
}
$query = page( $query, 20 );
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	++$NOTIFY_COUNT;
	$NOTIFY_ID = $ROW['NOTIFY_ID'];
	$FROM_ID = $ROW['FROM_ID'];
	$SUBJECT = $ROW['SUBJECT'];
	$READERS = $ROW['READERS'];
	$SUBJECT = str_replace( "<", "&lt", $SUBJECT );
	$SUBJECT = str_replace( ">", "&gt", $SUBJECT );
	$SUBJECT = stripslashes( $SUBJECT );
	$BEGIN_DATE = $ROW['BEGIN_DATE'];
	$BEGIN_DATE = strtok( $BEGIN_DATE, " " );
	unset( $FROM_NAME );
	$query1 = "SELECT * from USER where USER_ID='{$FROM_ID}'";
	$cursor1 = exequery( $connection, $query1 );
	if ( $ROW = mysql_fetch_array( $cursor1 ) )
	{
		$FROM_NAME = $ROW['USER_NAME'];
		$AVATAR = $ROW['AVATAR'];
		$DEPT_ID = $ROW['DEPT_ID'];
	}
	if ( $DEPT_ID == "" )
	{
		$DEPT_NAME = "";
	}
	else
	{
		$DEPT_NAME = dept_long_name( $DEPT_ID );
	}
	if ( $NOTIFY_COUNT == 1 )
	{
		echo "<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"5\">\r\n\r\n";
	}
	if ( $NOTIFY_COUNT % 2 == 1 )
	{
		$TableLine = "TableLine1";
	}
	else
	{
		$TableLine = "TableLine2";
	}
	echo "    <tr class=\"";
	echo $TableLine;
	echo "\">\r\n      <td nowrap width=\"120\"> <u title=\"部门:";
	echo $DEPT_NAME;
	echo "\" style=\"cursor:hand\">";
	echo $FROM_NAME;
	echo "</u></td>\r\n      <td>\r\n      <a href=\"javascript:open_notify('";
	echo $NOTIFY_ID;
	echo "');\">";
	echo $SUBJECT;
	echo "</a>\r\n";
	if ( !find_id( $READERS, $LOGIN_USER_ID ) )
	{
		echo "<img src='/images/new.gif' height=11 width=28>";
	}
	echo "      </td>\r\n      <td nowrap >";
	echo $BEGIN_DATE;
	echo "</td>\r\n    </tr>\r\n";
}
if ( 0 < $NOTIFY_COUNT )
{
	echo "    <thead class=\"TableHeader\">\r\n  <td nowrap >发布人</td>\r\n      <td nowrap >标题</td>\r\n      <td nowrap >发布时间 </td>\r\n    </thead>\r\n</table>\r\n";
}
else
{
	message( "", "<br>暂无公告通知<br><br>" );
}
echo "<table width=\"100%\"  border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\r\n  <tr>\r\n    <td align=\"center\">";
disp( "NOTIFY_TYPE=".$NOTIFY_TYPE );
echo "</td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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