⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
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">
<SCRIPT language=javascript>
function check_form()
{
if(document.form1.BOARD_NAME.value == "")
{
	 alert("讨论区主题不能为空!");
	 return false;
}
if(document.form1.TO_NAME.value == "")
{
	 alert("讨论区所属部门不能为空!");
	 return false;
}
return true;
}
function clear_dept()
{
document.form1.TO_NAME.value="";
document.form1.TO_ID.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;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.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
//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");
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");
}
</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"><span 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'];
		if ($DEPT_ID1[strlen ($DEPT_ID1) - 1] != ',')
		{
			if ($DEPT_ID1 != 'ALL_DEPT')
			{
				$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 ($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>
			&nbsp;<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow()" title="添加部门" name="button">
			&nbsp;<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="hidden" name="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>
			&nbsp;<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择人员" name="button">
			&nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_user2()" title="清空人员" name="button">
		</td>
	</tr>
	<tr>
		<td nowrap class="TableData">是否允许匿名发帖:</td>
		<td class="TableData">
			<select 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">
			<input type="checkbox" name="SMS_REMIND" id="SMS_REMIND"><label for="SMS_REMIND">使用内部短信提醒参与人</label>
';
	$query = 'select * from SMS2_PRIV';
	$cursor = exequery ($connection, $query);
	if ($ROW = mysql_fetch_array ($cursor))
	{
		$TYPE_PRIV = $ROW['TYPE_PRIV'];
	}
	if (find_id ($TYPE_PRIV, 18))
	{
		echo '        <input type="checkbox" name="SMS2_REMIND" id="SMS2_REMIND"><label for="SMS2_REMIND">使用手机短信提醒参与人</label>
';
	}
	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">&nbsp;&nbsp;
			<input type="button"  value="返回" class="BigButton" name="back" onClick="history.back();";>
		</td>
	</tr>
</form>
</table>
</body>
</html>';
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -