📄 edit.php
字号:
<?
include_once("inc/auth.php");
include_once("../prcs_role.php");
if(!prcs_role($FLOW_ID,1))
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"];
$AUTO_NAME = $ROW["AUTO_NAME"];
$AUTO_NUM = $ROW["AUTO_NUM"];
$AUTO_LEN = $ROW["AUTO_LEN"];
$FLOW_DESC = $ROW["FLOW_DESC"];
$FLOW_DESC=str_replace("\n","<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 * from USER WHERE USER_ID='$LOGIN_USER_ID'";
$cursor1= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor1))
$USER_NAME=$ROW["USER_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); //{Y}:表示年
$RUN_NAME=str_replace("{M}",$CUR_MON,$RUN_NAME); //{M}:表示月
$RUN_NAME=str_replace("{D}",$CUR_DAY,$RUN_NAME); //{D}:表示日
$RUN_NAME=str_replace("{H}",$CUR_HOUR,$RUN_NAME); //{H}:表示时
$RUN_NAME=str_replace("{I}",$CUR_MINITE,$RUN_NAME); //{I}:表示分
$RUN_NAME=str_replace("{S}",$CUR_SECOND,$RUN_NAME); //{S}:表示秒
$RUN_NAME=str_replace("{F}",$FLOW_NAME,$RUN_NAME); //{F}:表示流程名
$RUN_NAME=str_replace("{U}",$USER_NAME,$RUN_NAME); //{U}:表示用户姓名
$RUN_NAME=str_replace("{N}",$AUTO_NUM,$RUN_NAME); //{N}:表示编号
}
?>
<html>
<head>
<title>新建工作</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT 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=800,height=500,left="+myleft+",top=50");
}
</SCRIPT>
</head>
<body class="bodycolor" topmargin="5" onload="document.form1.RUN_NAME.focus();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/green_arrow.gif" align="absmiddle"><span 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){?>target="_parent"<?}?> name="form1" onSubmit="return check_form();">
<tr class="TableHeader" height=30 align=center>
<td colspan=2><?=$FLOW_NAME?> - 名称/文号</td>
</tr>
<tr>
<td class="TableData" align=center>
<textarea name="RUN_NAME" rows=2 cols=50 <?if($AUTO_NAME!="")echo "readonly class=BigStatic";else echo"class=BigInput";?>><?=$RUN_NAME?> </textarea>
<?
if($AUTO_NAME=="")
{
?>
<input type="button" class="BigButton" value="清空" onclick="document.form1.RUN_NAME.value=''">
<?
}
?>
</td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type='hidden' value="<?=$MENU_FLAG?>" name="MENU_FLAG">
<input type='hidden' value="<?=$FLOW_ID?>" name="FLOW_ID">
<input type="submit" value="新 建" class="BigButton" name="submit">
<input type="button" value="返 回" class="BigButton" name="back" onClick="history.back();">
</td>
</tr>
</form>
</table>
<?
if($FLOW_TYPE!="1")
{
if($FLOW_DESC!="")
{
?>
<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><?=$FLOW_DESC?></td>
</tr>
</table>
<?
}
exit;
}
?>
<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"><span 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"||$PRCS_TO=="0,"||$PRCS_TO=="")&&$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!="" && 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)
{
?>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center">
<?
if($FLOW_DESC!="")
{
?>
<tr class="TableHeader">
<td colspan=3> 流程说明</td>
</tr>
<tr class="TableData">
<td colspan=3><?=$FLOW_DESC?></td>
</tr>
<?
}
?>
<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";
?>
<tr class="<?=$TableLine?>">
<td align="center"><?=$PRCS_ID?></td>
<td align="center"><?=$PRCS_NAME?></td>
<td><?=$PRCS_TO?></td>
</tr>
<?
}
?>
<tr class="TableControl">
<td align="center" colspan=3><input type="button" value="查看流程设计图" class="BigButton" name="back" onClick="view_graph(<?=$FLOW_ID?>)"></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -