📄 index1.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
if ( !isset( $TYPE ) )
{
$TYPE = "0";
}
$ITEMS_IN_PAGE = 10;
if ( !isset( $start ) )
{
$start = 0;
}
$query = "select * from SYS_PARA where PARA_NAME='NOTIFY_MANAGER'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$NOTIFY_MANAGER = $ROW['PARA_VALUE'];
}
$query = "select * from SYS_PARA where PARA_NAME='NOTIFY_CONFIRM'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$NOTIFY_CONFIRM = $ROW['PARA_VALUE'];
}
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<script>\r\nfunction check_all()\r\n{\r\n for (i=0;i<document.all(\"news_select\").length;i++)\r\n {\r\n if(document.all(\"allbox\").checked)\r\n document.all(\"news_select\").item(i).checked=true;\r\n else\r\n document.all(\"news_select\").item(i).checked=false;\r\n }\r\n\r\n if(i==0)\r\n {\r\n if(document.all(\"allbox\").checked)\r\n document.all(\"news_select\").checked=true;\r\n else\r\n document.all(\"news_select\").checked=false;\r\n }\r\n}\r\n\r\nfunction check_one(el)\r\n{\r\n if(!el.checked)\r\n document.all(\"allbox\").checked=false;\r\n}\r\n\r\nfunction del_news()\r\n{\r\n delete_str=\"\";\r\n for(i=0;i<document.all(\"news_select\").length;i++)\r\n {\r\n\r\n el=document.all(\"news_select\").item(i);\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(i==0)\r\n {\r\n el=document.all(\"news_select\");\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(delete_str==\"\")\r\n {\r\n alert(\"要删除公告,请至少选择其中一条。\");\r\n return;\r\n }\r\n\r\n msg='确认要删除所选公告么?';\r\n if(window.confirm(msg))\r\n {\r\n url=\"del_notify.php?DELETE_STR=\"+ delete_str +\"&start=";
echo $start;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=";
echo $TYPE;
echo "&FIELD=";
echo $FIELD;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "\";\r\n location=url;\r\n }\r\n\r\n}\r\n\r\nfunction confirm_news()\r\n{\r\n delete_str=\"\";\r\n for(i=0;i<document.all(\"news_select\").length;i++)\r\n {\r\n\r\n el=document.all(\"news_select\").item(i);\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(i==0)\r\n {\r\n el=document.all(\"news_select\");\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(delete_str==\"\")\r\n {\r\n alert(\"要发布公告,请至少选择其中一条。\");\r\n return;\r\n }\r\n\r\n msg='确认要发布所选公告么?';\r\n if(window.confirm(msg))\r\n {\r\n url=\"confirm_notify.php?DELETE_STR=\"+ delete_str +\"&start=";
echo $start;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=";
echo $TYPE;
echo "&FIELD=";
echo $FIELD;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "\";\r\n location=url;\r\n }\r\n\r\n}\r\n\r\nfunction modify_notify(NEW_TYPE)\r\n{\r\n delete_str=\"\";\r\n for(i=0;i<document.all(\"news_select\").length;i++)\r\n {\r\n\r\n el=document.all(\"news_select\").item(i);\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(i==0)\r\n {\r\n el=document.all(\"news_select\");\r\n if(el.checked)\r\n { val=el.value;\r\n delete_str+=val + \",\";\r\n }\r\n }\r\n\r\n if(delete_str==\"\")\r\n {\r\n alert(\"要修改公告类型,请至少选择其中一条。\");\r\n return;\r\n }\r\n\r\n msg='确认要修改所选公告类型么?';\r\n if(window.confirm(msg))\r\n {\r\n url=\"notify_type.php?DELETE_STR=\"+ delete_str +\"&NEW_TYPE=\"+ NEW_TYPE +\"&start=";
echo $start;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=";
echo $TYPE;
echo "&FIELD=";
echo $FIELD;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "\";\r\n location=url;\r\n }\r\n\r\n}\r\n\r\nfunction open_notify(NOTIFY_ID,FORMAT)\r\n{\r\n URL=\"../show/read_notify.php?NOTIFY_ID=\"+NOTIFY_ID;\r\n myleft=(screen.availWidth-650)/2;\r\n mytop=100\r\n mywidth=650;\r\n myheight=500;\r\n if(FORMAT==\"1\")\r\n {\r\n myleft=0;\r\n mytop=0\r\n mywidth=screen.availWidth-10;\r\n myheight=screen.availHeight-40;\r\n }\r\n window.open(URL,\"read_news\",\"height=\"+myheight+\",width=\"+mywidth+\",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=\"+mytop+\",left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction show_reader(NOTIFY_ID)\r\n{\r\n URL=\"show_reader.php?NOTIFY_ID=\"+NOTIFY_ID;\r\n myleft=(screen.availWidth-500)/2;\r\n window.open(URL,\"read_notify\",\"height=500,width=700,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction delete_notify(NOTIFY_ID,start)\r\n{\r\n msg='确认要删除该项公告通知么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?OP=1&FIELD=";
echo $FIELD;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=";
echo $TYPE;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "&NOTIFY_ID=\" + NOTIFY_ID + \"&start=\" + start;\r\n window.location=URL;\r\n }\r\n}\r\n\r\n\r\nfunction delete_all()\r\n{\r\n msg='确认要删除所有公告通知么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete_all.php\";\r\n window.location=URL;\r\n }\r\n}\r\n\r\nfunction order_by(field,asc_desc)\r\n{\r\n window.location=\"index1.php?start=";
echo $start;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=";
echo $TYPE;
echo "&FIELD=\"+field+\"&ASC_DESC=\"+asc_desc;\r\n}\r\n\r\nfunction change_type(type)\r\n{\r\n window.location=\"index1.php?start=";
echo $start;
echo "&STATUS=";
echo $STATUS;
echo "&TYPE=\"+type+\"&FIELD=";
echo $FIELD;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "\";\r\n}\r\n\r\nfunction change_type0(type)\r\n{\r\n window.location=\"index1.php?start=";
echo $start;
echo "&STATUS=\"+type+\"&TYPE=";
echo $TYPE;
echo "&FIELD=";
echo $FIELD;
echo "&ASC_DESC=";
echo $ASC_DESC;
echo "\";\r\n}\r\n</script>\r\n\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
$CUR_TIME = date( "Y-m-d H:i:s", time( ) );
if ( $LOGIN_USER_PRIV != "1" && !find_id( $NOTIFY_MANAGER, $LOGIN_USER_ID ) )
{
$query = "SELECT count(*) from NOTIFY where FROM_ID='".$LOGIN_USER_ID."'";
}
else
{
$query = "SELECT count(*) from NOTIFY where 1=1";
}
if ( $TYPE != "0" )
{
$query .= " and TYPE_ID='".$TYPE."'";
}
if ( $STATUS == "2" )
{
$query .= " and PUBLISH=1 and (END_DATE<'".$CUR_DATE."' or END_DATE='')";
}
else if ( $STATUS == "1" )
{
$query .= " and PUBLISH=0";
}
else if ( $STATUS == "3" )
{
$query .= " and PUBLISH=1 and END_DATE";
}
$cursor = exequery( $connection, $query );
$NOTIFY_COUNT = 0;
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$NOTIFY_COUNT = $ROW[0];
}
if ( $NOTIFY_COUNT == 0 )
{
echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/notify_open.gif\" align=\"absmiddle\"><span class=\"big3\"> 管理公告通知</span> \r\n <select name=\"TYPE\" class=\"BigSelect\" onchange=\"change_type(this.value);\">\r\n <option value=\"0\"";
if ( $TYPE == "0" )
{
echo " selected";
}
echo ">所有类型</option>\r\n ";
echo code_list( "NOTIFY", $TYPE );
echo " <option value=\"\"";
if ( $TYPE == "" )
{
echo " selected";
}
echo ">无类型</option>\r\n </select>\r\n <select name=\"STATUS\" class=\"BigSelect\" onchange=\"change_type0(this.value);\">\r\n <option value=\"0\"";
if ( $STATUS == "0" )
{
echo " selected";
}
echo ">所有状态</option>\r\n\t\t";
if ( $NOTIFY_CONFIRM == 1 )
{
echo " <option value=\"1\"";
if ( $STATUS == "1" )
{
echo " selected";
}
echo ">待批</option>\r\n\t\t";
}
else
{
echo " <option value=\"1\"";
if ( $STATUS == "1" )
{
echo " selected";
}
echo ">未发布</option>\r\n\t\t";
}
echo " <option value=\"2\"";
if ( $STATUS == "2" )
{
echo " selected";
}
echo ">生效</option>\r\n <option value=\"3\"";
if ( $STATUS == "3" )
{
echo " selected";
}
echo ">终止</option>\r\n </select> \r\n\t\t";
if ( $NOTIFY_CONFIRM == 1 )
{
echo "<span class=small1>\r\n<img src=\"/images/attention.gif\" height=\"18\"> 管理员提示:公告通知需要由主管人员审核发布\r\n</span>\r\n\t\t";
}
echo " </td>\r\n </tr>\r\n</table>\r\n\r\n";
message( "", "无已发布的公告通知" );
exit( );
}
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/notify_open.gif\" align=\"absmiddle\"><span class=\"big3\"> 管理公告通知</span> \r\n \t\r\n <select name=\"TYPE\" class=\"BigSelect\" onchange=\"change_type(this.value);\">\r\n <option value=\"0\"";
if ( $TYPE == "0" )
{
echo " selected";
}
echo ">所有类型</option>\r\n ";
echo code_list( "NOTIFY", $TYPE );
echo " <option value=\"\"";
if ( $TYPE == "" )
{
echo " selected";
}
echo ">无类型</option>\r\n </select>\r\n <select name=\"STATUS\" class=\"BigSelect\" onchange=\"change_type0(this.value);\">\r\n <option value=\"0\"";
if ( $STATUS == "0" )
{
echo " selected";
}
echo ">所有状态</option>\r\n\t\t";
if ( $NOTIFY_CONFIRM == 1 )
{
echo " <option value=\"1\"";
if ( $STATUS == "1" )
{
echo " selected";
}
echo ">待批</option>\r\n\t\t";
}
else
{
echo " <option value=\"1\"";
if ( $STATUS == "1" )
{
echo " selected";
}
echo ">未发布</option>\r\n\t\t";
}
echo " <option value=\"2\"";
if ( $STATUS == "2" )
{
echo " selected";
}
echo ">生效</option>\r\n <option value=\"3\"";
if ( $STATUS == "3" )
{
echo " selected";
}
echo ">终止</option>\r\n </select> \r\n\t\t";
if ( $NOTIFY_CONFIRM == 1 )
{
echo "<span class=small1>\r\n<img src=\"/images/attention.gif\" height=\"18\"> 管理员提示:公告通知需要由主管人员审核发布\r\n</span>\r\n\t\t";
}
echo " </td>\r\n <td align=\"right\" valign=\"bottom\" class=\"small1\">";
echo page_bar( $start, $NOTIFY_COUNT, $ITEMS_IN_PAGE );
echo "</td>\r\n </tr>\r\n</table>\r\n";
if ( $ASC_DESC == "" )
{
$ASC_DESC = "1";
}
if ( $LOGIN_USER_PRIV != "1" && !find_id( $NOTIFY_MANAGER, $LOGIN_USER_ID ) )
{
$query = "SELECT READERS,NOTIFY_ID,NOTIFY_NO,FROM_ID,TO_ID,SUBJECT,FORMAT,TOP,PRIV_ID,USER_ID,TYPE_ID,PUBLISH,SEND_TIME,BEGIN_DATE,END_DATE from NOTIFY where FROM_ID='".$LOGIN_USER_ID."'";
}
else
{
$query = "SELECT READERS,NOTIFY_ID,NOTIFY_NO,FROM_ID,TO_ID,SUBJECT,FORMAT,TOP,PRIV_ID,USER_ID,TYPE_ID,PUBLISH,SEND_TIME,BEGIN_DATE,END_DATE from NOTIFY where 1=1";
}
if ( $TYPE != "0" )
{
$query .= " and TYPE_ID='".$TYPE."'";
}
if ( $STATUS == "2" )
{
$query .= " and PUBLISH=1 and (END_DATE<'".$CUR_DATE."' or END_DATE='')";
}
else if ( $STATUS == "1" )
{
$query .= " and PUBLISH=0";
}
else if ( $STATUS == "3" )
{
$query .= " and PUBLISH=1 and END_DATE";
}
if ( $FIELD == "" )
{
$query .= " order by TOP desc,SEND_TIME desc";
}
else
{
$query .= " order by ".$FIELD;
if ( $ASC_DESC == "1" )
{
$query .= " desc";
}
else
{
$query .= " asc";
}
}
$query .= " limit ".$start.",{$ITEMS_IN_PAGE}";
if ( $ASC_DESC == "0" )
{
$ORDER_IMG = "<img border=0 src=\"/images/arrow_up.gif\" width=\"11\" height=\"10\">";
}
else
{
$ORDER_IMG = "<img border=0 src=\"/images/arrow_down.gif\" width=\"11\" height=\"10\">";
}
echo "<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\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\" onclick=\"order_by('SUBJECT','";
if ( $FIELD == "SUBJECT" )
{
echo 1 - $ASC_DESC;
}
else
{
echo "1";
}
echo "');\" style=\"cursor:hand;\"><u>标题</u>";
if ( $FIELD == "SUBJECT" )
{
echo $ORDER_IMG;
}
echo "</td>\r\n <td nowrap align=\"center\" onclick=\"order_by('SEND_TIME','";
if ( $FIELD == "SEND_TIME" || $FIELD == "" )
{
echo 1 - $ASC_DESC;
}
else
{
echo "1";
}
echo "');\" style=\"cursor:hand;\"><u>创建时间</u>";
if ( $FIELD == "SEND_TIME" || $FIELD == "" )
{
echo $ORDER_IMG;
}
echo "</td>\r\n <td nowrap align=\"center\" onclick=\"order_by('BEGIN_DATE','";
if ( $FIELD == "BEGIN_DATE" )
{
echo 1 - $ASC_DESC;
}
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -