📄 edit.php
字号:
<?
include_once 'inc/auth.php';
include_once 'inc/utility_all.php';
include_once '../prcs_role.php';
if (!prcs_role ($FLOW_ID, 1))
{
message ('<body class=bodycolor>提示', '没有该流程新建权限,请与OA管理员联系');
button_back ();
exit ();
}
$CUR_TIME = date ('Y-m-d H:i:s', time ());
$query = ((''.'SELECT * from FLOW_TYPE WHERE FLOW_ID=').$FLOW_ID);
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$FLOW_NAME = $ROW['FLOW_NAME'];
$FLOW_TYPE = $ROW['FLOW_TYPE'];
$FORM_ID = $ROW['FORM_ID'];
$AUTO_NAME = $ROW['AUTO_NAME'];
$AUTO_NUM = $ROW['AUTO_NUM'];
$AUTO_LEN = $ROW['AUTO_LEN'];
$AUTO_EDIT = $ROW['AUTO_EDIT'];
$FLOW_DESC = $ROW['FLOW_DESC'];
$FLOW_DESC = str_replace ('
', '<br>', $FLOW_DESC);
}
if (($AUTO_NAME == ''))
{
$RUN_NAME = ((($FLOW_NAME.'(').$CUR_TIME).')');
}
else
{
$RUN_NAME = $AUTO_NAME;
$CUR_YEAR = date ('Y', time ());
$CUR_MON = date ('m', time ());
$CUR_DAY = date ('d', time ());
$CUR_HOUR = date ('H');
$CUR_MINITE = date ('i');
$CUR_SECOND = date ('s');
$query = (((''.'SELECT USER_NAME from USER WHERE USER_ID=\'').$LOGIN_USER_ID).'\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$USER_NAME = $ROW['USER_NAME'];
}
$query = (((''.'SELECT DEPT_NAME from DEPARTMENT WHERE DEPT_ID=\'').$LOGIN_DEPT_ID).'\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$DEPT_NAME = $ROW['DEPT_NAME'];
}
$LONG_DEPT_NAME = dept_long_name ($LOGIN_DEPT_ID);
$query = (((''.'SELECT PRIV_NAME from USER_PRIV WHERE USER_PRIV=\'').$LOGIN_USER_PRIV).'\'');
$cursor1 = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor1))
{
$PRIV_NAME = $ROW['PRIV_NAME'];
}
++$AUTO_NUM;
$LEN = strlen ($AUTO_NUM);
for ($I = 0; ($I < ($AUTO_LEN - $LEN)); ++$I)
{
$AUTO_NUM = ('0'.$AUTO_NUM);
}
$RUN_NAME = str_replace ('{Y}', $CUR_YEAR, $RUN_NAME);
$RUN_NAME = str_replace ('{M}', $CUR_MON, $RUN_NAME);
$RUN_NAME = str_replace ('{D}', $CUR_DAY, $RUN_NAME);
$RUN_NAME = str_replace ('{H}', $CUR_HOUR, $RUN_NAME);
$RUN_NAME = str_replace ('{I}', $CUR_MINITE, $RUN_NAME);
$RUN_NAME = str_replace ('{S}', $CUR_SECOND, $RUN_NAME);
$RUN_NAME = str_replace ('{F}', $FLOW_NAME, $RUN_NAME);
$RUN_NAME = str_replace ('{U}', $USER_NAME, $RUN_NAME);
$RUN_NAME = str_replace ('{SD}', $DEPT_NAME, $RUN_NAME);
$RUN_NAME = str_replace ('{LD}', $LONG_DEPT_NAME, $RUN_NAME);
$RUN_NAME = str_replace ('{R}', $PRIV_NAME, $RUN_NAME);
$RUN_NAME = str_replace ('{N}', $AUTO_NUM, $RUN_NAME);
}
if ($AUTO_NEW)
{
include_once 'insert.php';
exit ();
}
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.RUN_NAME.value == "")
{
alert("名称/文号不能为空!");
return false;
}
return true;
}
function view_graph(FLOW_ID)
{
myleft=(screen.availWidth-800)/2;
window.open("../list/view_graph?FLOW_ID="+FLOW_ID,"flow_view","status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=80';
echo '0,height=500,left="+myleft+",top=50");
}
function view_form(FLOW_ID,FORM_ID)
{
myleft=(screen.availWidth-800)/2;
window.open("../list/form_view.php?FLOW_ID="+FLOW_ID+"&FORM_ID="+FORM_ID,"form_view","status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=800,height=600,left="+myleft+",top=50");
}
function myload()
{
document.form1.RUN_NAME.focus();
}
fu';
echo 'nction mynew()
{
if(check_form())
{
document.form1.AUTO_NEW.value=0;
document.form1.submit();
}
}
</SCRIPT>
</head>
<body class="bodycolor" topmargin="5" onload="myload()">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/green_arrow.gif" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 填写该工作的名称或文号</span><br>
</td>
</tr>
</table>
<br>
<table border="0" width="450" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form action="insert.php" method="post" ';
if (($MENU_FLAG != 1))
{
echo 'target="_parent"';
}
echo ' name="form1" onSubmit="return check_form();">
<tr class="TableHeader" height=30 align=center>
<td colspan=2>';
echo $FLOW_NAME;
echo ' - 名称/文号</td>
</tr>
<tr>
<td class="TableData" align=center>
<textarea name="RUN_NAME" rows=2 cols=50 ';
if (!$AUTO_EDIT)
{
echo 'readonly class=BigStatic';
}
else
{
echo 'class=BigInput';
}
echo '>';
echo $RUN_NAME;
echo ' </textarea>
';
if ($AUTO_EDIT)
{
echo ' <input type="button" class="BigButton" value="清空" onclick="document.form1.RUN_NAME.value=\'\'">
';
}
echo ' </td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type=\'hidden\' value="';
echo $MENU_FLAG;
echo '" name="MENU_FLAG">
<input type=\'hidden\' value="';
echo $FLOW_ID;
echo '" name="FLOW_ID">
<input type=\'hidden\' value="1" name="AUTO_NEW">
<input type="submit" value="新建并办理" class="BigButton">
<!--
<input type="button" value="新建" class="BigButton" onclick="mynew()">
-->
<input type="button" value="返回" class="BigButton" onClick="history.back();">
</td>
</tr>
</form>
</table>';
echo '
';
if (($FLOW_TYPE != '1'))
{
if (($FLOW_DESC != ''))
{
echo ' <br>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableHeader">
<td colspan=3> 流程说明</td>
</tr>
<tr class="TableData">
<td colspan=3>';
echo $FLOW_DESC;
echo '</td>
</tr>
</table>
';
}
exit ();
}
echo '
<br>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/green_arrow.gif" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 流程说明及步骤列表</span><br>
</td>
</tr>
</table>
<br>
';
$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_MAX = $ROW[0];
}
$query = (((''.'SELECT * from FLOW_PROCESS WHERE FLOW_ID=').$FLOW_ID).' ORDER BY PRCS_ID');
$cursor = exequery ($connection, $query);
$PRCS_COUNT = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$PRCS_COUNT;
$ID = $ROW['ID'];
$PRCS_ID = $ROW['PRCS_ID'];
$PRCS_NAME = $ROW['PRCS_NAME'];
$PRCS_TO = $ROW['PRCS_TO'];
if ((((($PRCS_TO == '0') OR ($PRCS_TO == '0,')) OR ($PRCS_TO == '')) AND ($PRCS_ID != $PRCS_ID_MAX)))
{
($PRCS_TO .= ($PRCS_ID + 1));
}
if ((substr ($PRCS_TO, -1) == ','))
{
$PRCS_TO = substr ($PRCS_TO, 0, -1);
}
$PRCS_TO = str_replace (',0', ',结束', $PRCS_TO);
if ((($PRCS_TO != '') AND (substr ($PRCS_TO, 0, 1) == '0')))
{
$PRCS_TO = ('结束'.substr ($PRCS_TO, 1));
}
$PRCS_TO = ('→'.$PRCS_TO);
$PRCS_TO = str_replace (',', ',→', $PRCS_TO);
$PRCS_NAME = str_replace ('<', '<', $PRCS_NAME);
$PRCS_NAME = str_replace ('>', '>', $PRCS_NAME);
$PRCS_NAME = stripslashes ($PRCS_NAME);
if (($PRCS_COUNT == 1))
{
echo ' <table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center">
';
if (($FLOW_DESC != ''))
{
echo ' <tr class="TableHeader">
<td colspan=3> 流程说明</td>
</tr>
<tr class="TableData">
<td colspan=3>';
echo $FLOW_DESC;
echo '</td>
</tr>
';
}
echo ' <tr class="TableHeader">
<td nowrap align="center" width="80">步骤序号</td>
<td nowrap align="center">名称</td>
<td nowrap align="center" width="120">流程可选方向</td>
</tr>
';
}
if ((($PRCS_COUNT % 2) == 1))
{
$TableLine = 'TableLine1';
}
else
{
$TableLine = 'TableLine2';
}
echo ' <tr class="';
echo $TableLine;
echo '">
<td align="center">';
echo $PRCS_ID;
echo '</td>
<td align="center">';
echo $PRCS_NAME;
echo '</td>
<td>';
echo $PRCS_TO;
echo '</td>
</tr>
';
}
echo ' <tr class="TableControl">
<td align="center" colspan=3>
<input type="button" value="查看流程设计图" class="BigButton" name="back" onClick="view_graph(';
echo $FLOW_ID;
echo ')">
<input type="button" value="查看表单模板" class="BigButton" name="back" onClick="view_form(';
echo $FLOW_ID;
echo ',';
echo $FORM_ID;
echo ')">
</td>
</tr>
</table>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -