📄 edit.php
字号:
<?php
include_once( "inc/auth.php" );
$query = "select * from HTML_FILE where HTML_ID=".$HTML_ID;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FILE_NAME = $ROW['FILE_NAME'];
$PRIV_ID = $ROW['PRIV_ID'];
$USER_ID = $ROW['USER_ID'];
$TO_ID = $ROW['DEPT_ID'];
$HTML_NO = $ROW['HTML_NO'];
$HTML_DESC = $ROW['HTML_DESC'];
}
$query = "select * from DEPARTMENT";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$DEPT_ID = $ROW['DEPT_ID'];
$DEPT_NAME = $ROW['DEPT_NAME'];
if ( find_id( $TO_ID, $DEPT_ID ) )
{
$TO_NAME .= $DEPT_NAME.",";
}
}
if ( $TO_ID == "ALL_DEPT" )
{
$TO_NAME = "全体部门";
}
$TOK = strtok( $PRIV_ID, "," );
while ( $TOK != "" )
{
$query1 = "SELECT * from USER_PRIV where USER_PRIV='".$TOK."'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$PRIV_NAME .= $ROW['PRIV_NAME'].",";
}
$TOK = strtok( "," );
}
$TOK = strtok( $USER_ID, "," );
while ( $TOK != "" )
{
$query1 = "SELECT * from USER where USER_ID='".$TOK."'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$USER_NAME .= $ROW['USER_NAME'].",";
}
$TOK = strtok( "," );
}
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\r\n<script Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n document.form1.CONTENT.value=EDIT_HTML.getHTML();\r\n if(document.form1.CONTENT.value==\"\")\r\n { alert(\"模版内容不能为空!\");\r\n return (false);\r\n }\r\n\r\n return (true);\r\n}\r\n\r\nfunction CheckSend()\r\n{\r\n if(event.keyCode==10)\r\n {\r\n if(CheckForm())\r\n document.form1.submit();\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\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\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/menu/sms.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 编辑HTML模版 - ";
echo $FILE_NAME;
echo "</span>\r\n </td>\r\n </tr>\r\n</table>\r\n<br>\r\n";
$PATH = "../../../module/html_model/";
$FILENAME = $PATH.$FILE_NAME;
if ( file_exists( $FILENAME ) )
{
$CONTENT = file_get_contents( $FILENAME );
$CONTENT = str_replace( "\"", "'", $CONTENT );
}
echo " <table border=\"0\" width=\"80%\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n <form action=\"update.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=\"";
echo $PRIV_ID;
echo "\">\r\n <textarea cols=40 name=\"PRIV_NAME\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $PRIV_NAME;
echo "</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=\"";
echo $USER_ID;
echo "\">\r\n <textarea cols=40 name=\"COPY_TO_NAME\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $USER_NAME;
echo "</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\" value=\"";
echo $HTML_NO;
echo "\"> \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\" value=\"";
echo $HTML_DESC;
echo "\"> \r\n\t </td>\r\n </tr>\r\n <tr>\r\n <td class=\"TableData\" colspan=\"2\">\r\n <input type=\"hidden\" name=\"CONTENT\" value=\"";
echo $CONTENT;
echo "\" wrap=\"on\" onkeypress=\"CheckSend()\">\r\n\t\t<iframe name=\"EDIT_HTML\" width=\"100%\" height=400 src=\"/module/ewebeditor/ewebeditor.htm?id=CONTENT&style=mini\" viewastext type=\"text/x-scriptlet\" frameborder=\"0\" scrolling=\"no\"></iframe>\r\n </td>\r\n </tr>\r\n <tr align=\"center\" class=\"TableControl\">\r\n <td colspan=\"2\" nowrap>\r\n <input type=\"hidden\" value=\"";
echo $HTML_ID;
echo "\" name=\"HTML_ID\">\r\n <input type=\"submit\" value=\"确定\" class=\"BigButton\"> \r\n <input type=\"button\" value=\"返回\" class=\"BigButton\" onClick=\"location='./'\">\r\n </td>\r\n </tr>\r\n </table>\r\n</form>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -