📄 edit.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.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<SCRIPT language=javascript>\r\nfunction check_form()\r\n{\r\n if(document.form1.BOARD_NAME.value ==\"\")\r\n {\r\n alert(\"讨论区主题不能为空!\");\r\n return false;\r\n }\r\n\r\n if(document.form1.TO_ID.value==\"\" && document.form1.PRIV_ID.value==\"\" && document.form1.TO_ID3.value==\"\")\r\n {\r\n \t alert(\"请指定发布范围!\");\r\n return false;\r\n }\r\n \r\n return true;\r\n}\r\n\r\nfunction clear_dept()\r\n{\r\n document.form1.TO_ID.value=\"\";\r\n document.form1.TO_NAME.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_user3()\r\n{\r\n document.form1.TO_ID3.value=\"\";\r\n document.form1.TO_NAME3.value=\"\";\r\n}\r\n\r\nfunction LoadWindow3()\r\n{\r\n URL=\"/module/user_select?ID=3\";\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:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;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.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\" onload=\"document.form1.BOARD_NAME.focus();\">\r\n\r\n";
if ( $BOARD_ID != "" )
{
$TITLE = "编辑讨论区";
}
else
{
$TITLE = "新建讨论区";
}
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/edit.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> ";
echo $TITLE;
echo "</span><br>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n";
if ( $BOARD_ID != "" )
{
$query = "SELECT * from BBS_BOARD where BOARD_ID=".$BOARD_ID;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$BOARD_NAME = $ROW['BOARD_NAME'];
$BOARD_NO = $ROW['BOARD_NO'];
$DEPT_ID1 = $ROW['DEPT_ID'];
$PRIV_ID = $ROW['PRIV_ID'];
$USER_ID = $ROW['USER_ID'];
$POST_TIME = $ROW['POST_TIME'];
$TYPE_ID = $ROW['TYPE_ID'];
$FILTER_TEXT = $ROW['FILTER_TEXT'];
if ( $DEPT_ID1[strlen( $DEPT_ID1 ) - 1] != "," && $DEPT_ID1 != "ALL_DEPT" && $DEPT_ID1 != "" )
{
$DEPT_ID1 .= ",";
}
$ANONYMITY_YN = $ROW['ANONYMITY_YN'];
$ANONYMITY_FLAG = $ROW['ANONYMITY_FLAG'];
$WELCOME_TEXT = $ROW['WELCOME_TEXT'];
$BOARD_HOSTER = $ROW['BOARD_HOSTER'];
}
}
$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( $DEPT_ID1, $DEPT_ID ) )
{
$TO_NAME .= $DEPT_NAME.",";
}
}
if ( $DEPT_ID1 == "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_NAME1 .= $ROW['USER_NAME'].",";
}
$TOK = strtok( "," );
}
$TOK = strtok( $BOARD_HOSTER, "," );
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<br>\r\n<table border=\"0\" width=\"500\" cellpadding=\"2\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n <form action=\"";
if ( $BOARD_ID != "" )
{
echo "update";
}
else
{
echo "insert";
}
echo ".php\" method=\"post\" name=\"form1\" onSubmit=\"return check_form();\">\r\n <tr>\r\n <td nowrap class=\"TableData\"> 类别:</td>\r\n <td class=\"TableData\">\r\n <select name=\"TYPE_ID\" class=\"BigSelect\">\r\n <option value=\"\"></option>\r\n ";
echo code_list( "BBS", $TYPE_ID );
echo " </select> \r\n 类别可在“系统管理”->“系统代码设置”模块设置。\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=\"text\" name=\"BOARD_NO\" size=\"4\" maxlength=\"50\" class=\"BigInput\" value=\"";
echo $BOARD_NO;
echo "\">\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=\"text\" name=\"BOARD_NAME\" size=\"30\" maxlength=\"50\" class=\"BigInput\" value=\"";
echo $BOARD_NAME;
echo "\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td valign=\"top\" nowrap class=\"TableData\">欢迎词:</td>\r\n <td class=\"TableData\">\r\n <input type=\"text\" name=\"WELCOME_TEXT\" size=\"30\" maxlength=\"100\" class=\"BigInput\" value=\"";
echo $WELCOME_TEXT;
echo "\">\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=\"TO_ID\" value=\"";
echo $DEPT_ID1;
echo "\">\r\n <textarea cols=34 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=34 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=\"TO_ID3\" value=\"";
echo $USER_ID;
echo "\">\r\n <textarea cols=34 name=\"TO_NAME3\" rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $USER_NAME1;
echo "</textarea>\r\n <input type=\"button\" value=\"选 择\" class=\"SmallButton\" onClick=\"LoadWindow3()\" title=\"选择人员\" name=\"button\">\r\n <input type=\"button\" value=\"清 空\" class=\"SmallButton\" onClick=\"clear_user3()\" 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 $BOARD_HOSTER;
echo "\">\r\n <textarea cols=34 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 class=\"TableData\">\r\n <input type=\"text\" name=\"FILTER_TEXT\" size=\"30\" maxlength=\"100\" class=\"BigInput\" value=\"";
echo $FILTER_TEXT;
echo "\">\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=\"text\" name=\"POST_TIME\" size=\"10\" maxlength=\"30\" class=\"BigInput\" value=\"";
echo $POST_TIME;
echo "\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">是否允许匿名发帖:</td>\r\n <td class=\"TableData\">\r\n <select name=\"ANONYMITY_YN\" class=\"BigSelect\">\r\n <option value=\"1\" ";
if ( $ANONYMITY_YN == "1" )
{
echo "selected";
}
echo ">允许</option>\r\n <option value=\"0\" ";
if ( $ANONYMITY_YN == "0" )
{
echo "selected";
}
echo ">禁止</option>\r\n </select> <input name=\"ANONYMITY_FLAG\" id=\"ANONYMITY_FLAG\" type=\"checkbox\" value=\"1\" ";
if ( $ANONYMITY_FLAG == 1 )
{
echo " checked";
}
echo "><label for=\"ANONYMITY_FLAG\">禁止使用OA内部用户名作为匿名</label>\r\n </td>\r\n </tr>\r\n";
if ( $BOARD_ID == "" )
{
echo " <tr>\r\n <td nowrap class=\"TableData\">提醒:</td>\r\n <td class=\"TableData\">\r\n";
echo sms_remind( 18 );
echo " </td>\r\n </tr>\r\n";
}
echo " <tr align=\"center\" class=\"TableControl\">\r\n <td colspan=\"2\" nowrap>\r\n <input type='hidden' value=\"";
echo $BOARD_ID;
echo "\" name=\"BOARD_ID\">\r\n <input type=\"submit\" value=\"保存\" class=\"BigButton\" name=\"submit\"> \r\n <input type=\"button\" value=\"返回\" class=\"BigButton\" name=\"back\" onClick=\"history.back();\";>\r\n </td>\r\n </tr>\r\n </form>\r\n</table>\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -