edit.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 311 行
PHP
311 行
<?
include_once 'inc/auth.php';
include_once 'inc/utility_all.php';
echo '
<html>
<head>
<title>讨论区新建或编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<S';
echo 'CRIPT language=javascript>
function check_form()
{
if(document.form1.BOARD_NAME.value =="")
{
alert("讨论区主题不能为空!");
return false;
}
if(document.form1.TO_ID.value=="" && document.form1.PRIV_ID.value=="" && document.form1.TO_ID3.value=="")
{
alert("请指定发布范围!");
return false;
}
return true;
}
function clear_dept()
{
document.';
echo 'form1.TO_ID.value="";
document.form1.TO_NAME.value="";
}
function LoadWindow()
{
URL="/module/dept_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dial';
echo 'ogLeft:"+loc_x+"px");
}
function clear_priv()
{
document.form1.PRIV_ID.value="";
document.form1.PRIV_NAME.value="";
}
function LoadPrivWindow()
{
URL="/module/priv_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;
window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resiza';
echo 'ble:1;dialogWidth:250px;dialogHeight:300px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user3()
{
document.form1.TO_ID3.value="";
document.form1.TO_NAME3.value="";
}
function LoadWindow3()
{
URL="/module/user_select?ID=3";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
wi';
echo 'ndow.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user2()
{
document.form1.COPY_TO_NAME.value="";
document.form1.COPY_TO_ID.value="";
}
function LoadWindow2()
{
URL="/module/user_select?ID=2";
loc_x=document.body.scrollLeft+event.clientX-event.of';
echo 'fsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
</SCRIPT>
</head>
<body class="bodycolor" topmargin="5" onload="document.form1.BOARD_NAME.focus();">
';
if (($BOARD_ID != ''))
{
$TITLE = '编辑讨论区';
}
else
{
$TITLE = '新建讨论区';
}
echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/edit.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> ';
echo $TITLE;
echo '</span><br>
</td>
</tr>
</table>
';
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'];
if (((($DEPT_ID1[(strlen ($DEPT_ID1) - 1)] != ',') AND ($DEPT_ID1 != 'ALL_DEPT')) AND ($DEPT_ID1 != '')))
{
$DEPT_ID1 = ($DEPT_ID1.',');
}
$ANONYMITY_YN = $ROW['ANONYMITY_YN'];
$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.','));
continue;
}
}
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 '
<br>
<table border="0" width="500" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form action="';
if (($BOARD_ID != ''))
{
echo 'update';
}
else
{
echo 'insert';
}
echo '.php" method="post" name="form1" onSubmit="return check_form();">
<tr>
<td nowrap class="TableData">排序号:</td>
<td class="TableData">
<input type="text" name="BOARD_NO" size="4" maxlength="50" class="BigInput" value="';
echo $BOARD_NO;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableData">主题:</td>
<td class="TableData">
<input type="text" name="BOARD_NAME" size="30" maxlength="50" class="BigInput" value="';
echo $BOARD_NAME;
echo '">
</td>
</tr>
<tr>
<td valign="top" nowrap class="TableData">欢迎词:</td>
<td class="TableData">
<input type="text" name="WELCOME_TEXT" size="30" maxlength="100" class="BigInput" value="';
echo $WELCOME_TEXT;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableData">开放范围(部门):</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="';
echo $DEPT_ID1;
echo '">
<textarea cols=34 name=TO_NAME rows=2 class="BigStatic" wrap="yes" readonly>';
echo $TO_NAME;
echo '</textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow()" title="添加部门" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept()" title="清空部门" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">开放范围(角色):</td>
<td class="TableData">
<input type="hidd';
echo 'en" name="PRIV_ID" value="';
echo $PRIV_ID;
echo '">
<textarea cols=34 name="PRIV_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
echo $PRIV_NAME;
echo '</textarea>
<input type="button" value="选 择" class="SmallButton" onClick="LoadPrivWindow()" title="选择角色" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_priv()" title="清空角色" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">开放范围(人员):</td>
<td class="TableData">
<input type="hi';
echo 'dden" name="TO_ID3" value="';
echo $USER_ID;
echo '">
<textarea cols=34 name="TO_NAME3" rows=2 class="BigStatic" wrap="yes" readonly>';
echo $USER_NAME1;
echo '</textarea>
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow3()" title="选择人员" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user3()" title="清空人员" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">版主:</td>
<td class="TableData">
<input type="hidden" name=';
echo '"COPY_TO_ID" value="';
echo $BOARD_HOSTER;
echo '">
<textarea cols=34 name="COPY_TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
echo $USER_NAME;
echo '</textarea>
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择人员" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_user2()" title="清空人员" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">是否允许匿名发帖:</td>
<td class="TableData">
';
echo '<s';
echo 'elect name="ANONYMITY_YN" class="BigSelect">
<option value="1" ';
if (($ANONYMITY_YN == '1'))
{
echo 'selected';
}
echo '>允许</option>
<option value="0" ';
if (($ANONYMITY_YN == '0'))
{
echo 'selected';
}
echo '>禁止</option>
</select>
</td>
</tr>
';
if (($BOARD_ID == ''))
{
echo ' <tr>
<td nowrap class="TableData">提醒:</td>
<td class="TableData">
';
echo sms_remind (18);
echo ' </td>
</tr>
';
}
echo ' <tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type=\'hidden\' value="';
echo $BOARD_ID;
echo '" name="BOARD_ID">
<input type="submit" value="保存" class="BigButton" name="submit">
<input type="button" value="返回" class="BigButton" name="back" onClick="history.back();";>
</td>
</tr>
</form>
</table>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?