📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
echo "\r\n<html>\r\n<head>\r\n<title>HTML模版管理</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
include_once( "inc/menu_button.js" );
echo "<script Language=\"JavaScript\">\r\nvar parent_window = parent.dialogArguments;\r\n\r\nfunction click_model(ID)\r\n{\r\n targetelement=document.all(ID);\r\n";
if ( $RTE != "1" )
{
echo " parent_window.SetHtml(targetelement.value);\r\n";
}
else
{
echo " parent_window.insertHtml(targetelement.value);\r\n";
}
echo " \r\n window.close();\r\n}\r\nfunction open_html(HTML_ID)\r\n{\r\n URL=\"read_html.php?HTML_ID=\"+HTML_ID;\r\n myleft=(screen.availWidth-500)/2;\r\n window.open(URL,\"read_html\",\"height=500,width=650,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\nfunction CheckForm()\r\n{\r\n if (document.form1.ATTACHMENT.value!=\"\")\r\n {\r\n var file_temp=document.form1.ATTACHMENT.value,file_name;\r\n var Pos;\r\n Pos=file_temp.lastIndexOf(\"\\\\\");\r\n file_name=file_temp.substring(Pos+1,file_temp.length);\r\n document.form1.ATTACHMENT_NAME.value=file_name;\r\n return (true);\r\n }\r\n else \r\n\t{\r\n\t alert(\"请指定上传文件!\");\r\n return (false);\r\n\t }\r\n}\r\n\r\nfunction delete_html(HTML_ID)\r\n{\r\n msg='确认要删除该项文件么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?HTML_ID=\" + HTML_ID;\r\n window.location=URL;\r\n }\r\n}\r\n\r\nfunction clear_dept()\r\n{\r\n document.form1.TO_NAME.value=\"\";\r\n document.form1.TO_ID.value=\"\";\r\n}\r\n\r\nfunction LoadWindow()\r\n{\r\n URL=\"/module/dept_select\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;\r\n loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n\r\nfunction clear_priv()\r\n{\r\n document.form1.PRIV_ID.value=\"\";\r\n document.form1.PRIV_NAME.value=\"\";\r\n}\r\n\r\nfunction LoadPrivWindow()\r\n{\r\n URL=\"/module/priv_select\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX;\r\n loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:250px;dialogHeight:300px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n\r\nfunction clear_user2()\r\n{\r\n document.form1.COPY_TO_NAME.value=\"\";\r\n document.form1.COPY_TO_ID.value=\"\";\r\n}\r\n\r\nfunction LoadWindow2()\r\n{\r\n URL=\"/module/user_select?ID=2\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;\r\n loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;\r\n //window.open(URL,\"read_notify\",\"height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes\");\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n\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_new.gif\" align=\"absmiddle\"><span class=\"big3\"> 上传HTML模版</span><br>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"600\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\" >\r\n <form enctype=\"multipart/form-data\" action=\"add.php\" method=\"post\" name=\"form1\" onsubmit=\"return CheckForm()\">\r\n <tr>\r\n <td nowrap class=\"TableData\">发布范围(部门):</td>\r\n <td class=\"TableData\">\r\n <input type=\"hidden\" name=\"TO_ID\" value=\"";
echo $TO_ID;
echo "\">\r\n <textarea cols=40 name=TO_NAME rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $TO_NAME;
echo "</textarea>\r\n <input type=\"button\" value=\"添 加\" class=\"SmallButton\" onClick=\"LoadWindow()\" title=\"添加部门\" name=\"button\">\r\n <input type=\"button\" value=\"清 空\" class=\"SmallButton\" onClick=\"clear_dept()\" title=\"清空部门\" name=\"button\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">发布范围(角色):</td>\r\n <td class=\"TableData\">\r\n <input type=\"hidden\" name=\"PRIV_ID\" value=\"\">\r\n <textarea cols=40 name=\"PRIV_NAME\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly></textarea>\r\n <input type=\"button\" value=\"选 择\" class=\"SmallButton\" onClick=\"LoadPrivWindow()\" title=\"选择角色\" name=\"button\">\r\n <input type=\"button\" value=\"清 空\" class=\"SmallButton\" onClick=\"clear_priv()\" title=\"清空角色\" name=\"button\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">发布范围(人员)</td>\r\n <td class=\"TableData\">\r\n <input type=\"hidden\" name=\"COPY_TO_ID\" value=\"\">\r\n <textarea cols=40 name=\"COPY_TO_NAME\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly></textarea>\r\n <input type=\"button\" value=\"选 择\" class=\"SmallButton\" onClick=\"LoadWindow2()\" title=\"选择人员\" name=\"button\">\r\n <input type=\"button\" value=\"清 空\" class=\"SmallButton\" onClick=\"clear_user2()\" title=\"清空人员\" name=\"button\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">排序号:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"HTML_NO\" class=\"BigInput\" size=\"10\" maxlength=\"20\"> \r\n\t </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">模版说明:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"HTML_DESC\" class=\"BigInput\" size=\"30\" maxlength=\"50\"> \r\n\t </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">模 版:</td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"file\" name=\"ATTACHMENT\" size=\"30\" class=\"BigInput\" title=\"选择附件文件\">\r\n <input type=\"hidden\" name=\"ATTACHMENT_NAME\" value=\"\">\r\n\t </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableControl\" colspan=\"2\" align=\"center\">\r\n <input type=\"submit\" value=\"上传文件\" class=\"BigButton\" title=\"上传新模版\" name=\"button\">\r\n </td>\r\n </form>\r\n</table>\r\n\r\n<br>\r\n\r\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"3\">\r\n <tr>\r\n <td background=\"/images/dian1.gif\" width=\"100%\"></td>\r\n </tr>\r\n</table>\r\n\r\n<br>\r\n\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\"> 管理HTML模版</span> \r\n </td>\r\n </tr>\r\n</table>\r\n\r\n";
$query = "SELECT * from HTML_FILE ORDER BY HTML_NO";
$cursor = exequery( $connection, $query );
$NOTIFY_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$I;
$HTML_ID = $ROW['HTML_ID'];
$PRIV_ID = $ROW['PRIV_ID'];
$USER_ID = $ROW['USER_ID'];
$TO_ID = $ROW['DEPT_ID'];
$FILE_NAME = $ROW['FILE_NAME'];
$HTML_NO = $ROW['HTML_NO'];
$HTML_DESC = $ROW['HTML_DESC'];
$query1 = "select * from USER where USER_ID='".$FROM_ID."'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$FROM_NAME = $ROW['USER_NAME'];
$DEPT_ID = $ROW['DEPT_ID'];
}
$DEPT_NAME = dept_long_name( $DEPT_ID );
$TYPE_NAME = get_code_name( $TYPE_ID, "NOTIFY" );
$TO_NAME = "";
if ( $TO_ID == "ALL_DEPT" )
{
$TO_NAME = "全体部门";
}
else
{
$query1 = "select * from DEPARTMENT where find_in_set(DEPT_ID,'".$TO_ID."')";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$TO_NAME .= $ROW['DEPT_NAME'].",";
}
}
$TO_NAME_TITLE = "";
$TO_NAME_STR = "";
if ( $TO_NAME != "" )
{
if ( substr( $TO_NAME, -2 ) == "," )
{
$TO_NAME = substr( $TO_NAME, 0, -2 );
}
$TO_NAME_TITLE .= "部门:".$TO_NAME;
$TO_NAME_STR .= "<font color=#0000FF><b>部门:</b></font>".csubstr( strip_tags( $TO_NAME ), 0, 40 ).( 40 < strlen( $TO_NAME ) ? "..." : "" )."<br>";
}
$PRIV_NAME = "";
$query1 = "SELECT * from USER_PRIV where find_in_set(USER_PRIV,'".$PRIV_ID."')";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$PRIV_NAME .= $ROW['PRIV_NAME'].",";
}
if ( $PRIV_NAME != "" )
{
$PRIV_NAME = substr( $PRIV_NAME, 0, -2 );
if ( $TO_NAME_TITLE != "" )
{
$TO_NAME_TITLE .= "\n\n";
}
$TO_NAME_TITLE .= "角色:".$PRIV_NAME;
$TO_NAME_STR .= "<font color=#0000FF><b>角色:</b></font>".csubstr( strip_tags( $PRIV_NAME ), 0, 40 ).( 40 < strlen( $PRIV_NAME ) ? "..." : "" )."<br>";
}
$USER_NAME = "";
$query1 = "SELECT * from USER where find_in_set(USER_ID,'".$USER_ID."')";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$USER_NAME .= $ROW['USER_NAME'].",";
}
if ( $USER_NAME != "" )
{
$USER_NAME = substr( $USER_NAME, 0, -2 );
if ( $TO_NAME_TITLE != "" )
{
$TO_NAME_TITLE .= "\n\n";
}
$TO_NAME_TITLE .= "人员:".$USER_NAME;
$TO_NAME_STR .= "<font color=#0000FF><b>人员:</b></font>".csubstr( strip_tags( $USER_NAME ), 0, 40 ).( 40 < strlen( $USER_NAME ) ? "..." : "" )."<br>";
}
if ( $I == 1 )
{
echo "<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\">\r\n<tr class=\"TableHeader\">\r\n <td align=\"center\">使用范围</td>\r\n <td align=\"center\">HTML模版文件</</td>\r\n <td align=\"center\">排序号</</td>\r\n <td align=\"center\">模版说明</</td>\r\n <td align=\"center\">操作</td>\r\n</tr>\r\n\r\n";
}
echo "\r\n<tr class=\"TableControl\">\r\n <td style=\"cursor:hand\" title=\"";
echo $TO_NAME_TITLE;
echo "\">";
echo $TO_NAME_STR;
echo "</td>\r\n <td class=\"TableData\" align=\"center\">\r\n \t<a href=\"javascript:open_html('";
echo $HTML_ID;
echo "')\" >";
echo $FILE_NAME;
echo "</a>\r\n </td>\r\n <td>";
echo $HTML_NO;
echo "</td>\r\n <td>";
echo $HTML_DESC;
echo "</td>\r\n <td class=\"TableData\" align=\"center\" style=\"cursor:hand\">\r\n\t<a href=\"edit.php?HTML_ID=";
echo $HTML_ID;
echo "\")\" >编辑</a>\r\n\t<a href=\"javascript:delete_html('";
echo $HTML_ID;
echo "')\" >删除</a>\r\n </td>\r\n</tr>\r\n";
}
if ( $I == 0 )
{
message( "", "没有定义模版" );
}
else
{
echo "</table>";
}
echo "\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -