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

📄 edit.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once 'inc/auth.php';
if ($ID != '')
{
	$TITLE = '编辑流程步骤 - 基本属性';
}
else
{
	$TITLE = '新建流程步骤';
}
echo '
<html>
<head>
<title>';
echo $TITLE;
echo '</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=javascript>
function func_insert()
{
 for (i=0; i<form1.select2.options.length; i++)
 {
 if(form1.select2.options(i).selected)
 {
	 option_text=form1.select2.options(i).text;
	 option_value=form1.select2.options(i).value;
	 option_style_color=form1.select2.options(i).style.color;
	 var my_option = document.createElement("OPTION");
	 my_option.text=option_text;
	 my_option.value=option_value;
	 my_option.style.color=option_style_color;
	 pos=form1.select2.options.length;
	 form1.select1.add(my_option,pos);
	 form1.select2.remove(i);
	 i--;
}
 }//for
}
function func_delete()
{
 for (i=0;i<form1.select1.options.length;i++)
 {
 if(form1.select1.options(i).selected)
 {
	 option_text=form1.select1.options(i).text;
	 option_value=form1.select1.options(i).value;
	 var my_option = document.createElement("OPTION");
	 my_option.text=option_text;
	 my_option.value=option_value;
	 pos=form1.select2.options.length;
	 form1.select2.add(my_option,pos);
	 form1.select1.remove(i);
	 i--;
}
 }//for
}
function func_select_all1()
{
 for (i=form1.select1.options.length-1; i>=0; i--)
 form1.select1.options(i).selected=true;
}
function func_select_all2()
{
 for (i=form1.select2.options.length-1; i>=0; i--)
 form1.select2.options(i).selected=true;
}
function func_up()
{
sel_count=0;
for (i=form1.select1.options.length-1; i>=0; i--)
{
	if(form1.select1.options(i).selected)
		 sel_count++;
}
if(sel_count==0)
{
	 alert("调整步骤的顺序时,请选择其中一项!");
	 return;
}
else if(sel_count>1)
{
	 alert("调整步骤的顺序时,只能选择其中一项!");
	 return;
}
i=form1.select1.selectedIndex;
if(i!=0)
{
	var my_option = document.createElement("OPTION");
	my_option.text=form1.select1.options(i).text;
	my_option.value=form1.select1.options(i).value;
	form1.select1.add(my_option,i-1);
	form1.select1.remove(i+1);
	form1.select1.options(i-1).selected=true;
}
}
function func_down()
{
sel_count=0;
for (i=form1.select1.options.length-1; i>=0; i--)
{
	if(form1.select1.options(i).selected)
		 sel_count++;
}
if(sel_count==0)
{
	 alert("调整步骤的顺序时,请选择其中一项!");
	 return;
}
else if(sel_count>1)
{
	 alert("调整步骤的顺序时,只能选择其中一项!");
	 return;
}
i=form1.select1.selectedIndex;
if(i!=form1.select1.options.length-1)
{
	var my_option = document.createElement("OPTION");
	my_option.text=form1.select1.options(i).text;
	my_option.value=form1.select1.options(i).value;
	form1.select1.add(my_option,i+2);
	form1.select1.remove(i);
	form1.select1.options(i+1).selected=true;
}
}
function check_form()
{
if(document.form1.PRCS_NAME.value == "")
{
	 alert("步骤名称不能为空!");
	 return false;
}
fld_str="";
for (i=0; i< form1.select1.options.length; i++)
{
	 options_value=form1.select1.options(i).value;
	 fld_str+=options_value+",";
}
document.form1.PRCS_TO.value=fld_str;
return true;
}
</SCRIPT>
</head>
<body class="bodycolor" topmargin="5" onload="document.form1.PRCS_NAME.focus();">
<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 ($ID != '')
{
	$query = 'SELECT * from FLOW_PROCESS where ID=' . $ID;
	$cursor = exequery ($connection, $query);
	if ($ROW = mysql_fetch_array ($cursor))
	{
		$PRCS_ID = $ROW['PRCS_ID'];
		$PRCS_NAME = $ROW['PRCS_NAME'];
		$PRCS_TO = $ROW['PRCS_TO'];
		$PLUGIN = $ROW['PLUGIN'];
	}
}
else
{
	$query = 'SELECT max(PRCS_ID) from FLOW_PROCESS WHERE FLOW_ID=' . $FLOW_ID;
	$cursor = exequery ($connection, $query);
	if ($ROW = mysql_fetch_array ($cursor))
	{
		$PRCS_ID = $ROW[0] + 1;
	}
}
echo '
<table border="0" width="90%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form action="';
if ($ID != '')
{
	echo 'update';
}
else
{
	echo 'insert';
}
echo '.php" method="post" name="form1" onSubmit="return check_form();">
		<tr>
		<td nowrap class="TableContent">序号:</td>
		<td class="TableData">
			<input type="text" name="PRCS_ID" size="2" maxlength="10" class="BigInput" value="';
echo $PRCS_ID;
echo '">
		</td>
	</tr>
	<tr>
		<td nowrap class="TableContent">步骤名称:</td>
		<td class="TableData">
			<input type="text" name="PRCS_NAME" size="30" maxlength="100" class="BigInput" value="';
echo $PRCS_NAME;
echo '">
		</td>
	</tr>
	<tr>
		<td nowrap class="TableContent">下一步骤:</td>
		<td class="TableData">
		可以选择多个分支步骤,如不选择,则系统自动按顺序寻找下一步骤<br>
<table width="500" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="big">
<tr bgcolor="#CCCCCC">
	<td align="center">排序</td>
	<td align="center"><b>下一步骤</b></td>
	<td align="center">选择</td>
	<td align="center" valign="top"><b>备选步骤</b></td>
</tr>
<tr>
	<td align="center" bgcolor="#999999">
		<input type="button" class="SmallInput" value=" ↑ " onclick="func_up();">
		<br><br>
		<input type="button" class="SmallInput" value=" ↓ " onclick="func_down();">
	</td>
	<td valign="top" align="center" bgcolor="#CCCCCC">
	<select  name="select1" ondblclick="func_delete();" MULTIPLE style="width:200;height:200">
';
$PRCS_TO_ARRAY = explode (',', $PRCS_TO);
$ARRAY_COUNT = sizeof ($PRCS_TO_ARRAY);
if ($PRCS_TO_ARRAY[$ARRAY_COUNT - 1] == '')
{
	--$ARRAY_COUNT;
}
for ($I = 0; $I < $ARRAY_COUNT; ++$I)
{
	if ($PRCS_TO_ARRAY[$I] != '0')
	{
		$query = 'SELECT * from FLOW_PROCESS where FLOW_ID=' . $FLOW_ID . ' and PRCS_ID=' . $PRCS_TO_ARRAY[$I];
		$cursor = exequery ($connection, $query);
		if ($ROW = mysql_fetch_array ($cursor))
		{
			$PRCS_NAME1 = $ROW['PRCS_NAME'];
			$PRCS_NAME1 = $PRCS_TO_ARRAY[$I] . '、' . $PRCS_NAME1;
		}
	}
	else
	{
		$PRCS_NAME1 = '[结束流程]';
	}
	if ($PRCS_NAME1 != '')
	{
		echo '       <option value="';
		echo $PRCS_TO_ARRAY[$I];
		echo '">';
		echo $PRCS_NAME1;
		echo '</option>
';
		continue;
	}
}
echo '    </select>
	<input type="button" value=" 全 选 " onclick="func_select_all1();" class="SmallInput">
	</td>
	<td align="center" bgcolor="#999999">
		<input type="button" class="SmallInput" value=" ← " onclick="func_insert();">
		<br><br>
		<input type="button" class="SmallInput" value=" → " onclick="func_delete();">
	</td>
	<td align="center" valign="top" bgcolor="#CCCCCC">
	<select  name="select2" ondblclick="func_insert();" MULTIPLE style="width:200;height:200">
';
$query = 'SELECT * from FLOW_PROCESS where FLOW_ID=' . $FLOW_ID . ' order by PRCS_ID';
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
	$PRCS_ID1 = $ROW['PRCS_ID'];
	$PRCS_NAME1 = $ROW['PRCS_NAME'];
	$PRCS_NAME1 = $PRCS_ID1 . '、' . $PRCS_NAME1;
	if (!(find_id ($PRCS_TO, $PRCS_ID1)))
	{
		echo '      <option value="';
		echo $PRCS_ID1;
		echo '">';
		echo $PRCS_NAME1;
		echo '</option>
';
		continue;
	}
}
if (!(find_id ($PRCS_TO, '0')))
{
	echo '      <option value="0">[结束流程]</option>
';
}
echo '    </select>
	<input type="button" value=" 全 选 " onclick="func_select_all2();" class="SmallInput">
	</td>
</tr>
</table>
		<input type="hidden" name="PRCS_TO" size="20" class="BigInput" value="';
echo $PRCS_TO;
echo '">
		</td>
	</tr>
	<tr>
		<td nowrap class="TableContent">插件程序名称:</td>
		<td class="TableData">
			<input type="text" name="PLUGIN" size="30" maxlength="100" class="BigInput" value="';
echo $PLUGIN;
echo '"><br>
			如:my_process.php,插件程序为PHP文件,请放置于webroot/general/workflow/plugin下。插件程序将在本步骤执行完毕后被自动调用执行。如没有对应的插件程序,请勿填写。
		</td>
	</tr>
	<tr align="center" class="TableControl">
		<td colspan="2" nowrap>
			<input type=\'hidden\' value="';
echo $FLOW_ID;
echo '" name="FLOW_ID">
			<input type=\'hidden\' value="';
echo $ID;
echo '" name="ID">
			<input type=\'hidden\' value="';
echo $GRAPH;
echo '" name="GRAPH">
			<input type="submit"  value="保存" class="BigButton" name="submit">&nbsp;&nbsp;&nbsp;&nbsp;
';
if ($GRAPH == 1)
{
	echo '        <input type="button"  value="关闭" class="BigButton" name="back" onClick="window.close();">
';
}
else
{
	echo '        <input type="button"  value="返回" class="BigButton" name="back" onClick="history.back();">
';
}
echo '      </td>
	</tr>
</form>
</table>
</body>
</html>';
?>

⌨️ 快捷键说明

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