📄 freeedit.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "../prcs_role.php" );
include_once( "inc/utility_all.php" );
if ( !prcs_role( $FLOW_ID, 1 ) )
{
exit( );
}
$connection = openconnection( );
$CUR_TIME = date( "Y-m-d H:i", time( ) );
$connection = openconnection( );
$PRCS_ID = 1;
include_once( "inc/img_flow.inc.php" );
include_once( "inc/img_patten.inc.php" );
$query = "SELECT FLOW_NAME from FLOW_TYPE WHERE FLOW_ID={$FLOW_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FLOW_NAME = $ROW[0];
}
$RUN_NAME = $FLOW_NAME."(".$CUR_TIME.")";
$query = "SELECT * from FLOW_RUN where FLOW_ID={$FLOW_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$FLOW_READ_ONLY = 1;
}
$sql = " \r\n SELECT ID,FLOW_ID,PRCS_ID,PRCS_NAME,PRCS_USER,PRCS_ITEM,PRCS_DEPT,PRCS_PRIV,PRCS_TO \r\n\t FROM flow_process \r\n\t\t WHERE FLOW_ID=".$_REQUEST['FLOW_ID']." \r\n\t\t\t ORDER BY ID ASC\r\n\t\t\t\t ";
$res = exequery( $connection, $sql );
$fc = 0;
while ( $row = mysql_fetch_array( $res ) )
{
$export[$row['PRCS_ID']] = $row['PRCS_TO'];
++$fc;
}
if ( 0 < $fc )
{
$NowImg = new imgflow( );
$ImgPatten = new formatex( );
$export = $ImgPatten->makeupex( $export );
$export = $ImgPatten->replaceflag( $export );
$screenxy = $ImgPatten->countsize( $export );
$width = $screenxy['x'] - 49;
$height = $screenxy['y'];
$NowImg->definepic( "jpeg", $width, $height );
$w = $NowImg->layer_w;
$h = $NowImg->layer_h;
$NowImg->defineexport( $export );
$NowImg->destroyimg( );
$coordinate = $NowImg->coordinate;
}
echo "\r\n<html>\r\n<head>\r\n<title>新建工作</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n";
echo "<S";
echo "CRIPT language=javascript>\r\nfunction check_form()\r\n{\r\n if(document.form1.RUN_NAME.value == \"\")\r\n {\r\n alert(\"文号不能为空!\");\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n</SCRIPT>\r\n";
echo "<s";
echo "cript>\r\nfunction func_find(select_obj,option_value)\r\n{\r\n for (j=0; j";
echo "<s";
echo "elect_obj.options.length; j++)\r\n {\r\n if(select_obj.options(j).value==option_value)\r\n return j;\r\n }\r\n\r\n return -1;\r\n}\r\n\r\nfunction ref_op_user(el,user_name)\r\n{\r\n if(el.checked)\r\n {\r\n pos=func_find(document.form1.PRCS_OP_USER,el.value);\r\n if(pos<0)\r\n {\r\n var my_option = document.createElement(\"OPTION\");\r\n my_option.text=user_name;\r\n my_option.value=e";
echo "l.value;\r\n document.form1.PRCS_OP_USER.add(my_option,document.form1.PRCS_OP_USER.length);\r\n }\r\n else\r\n el.checked=false;\r\n }\r\n else\r\n {\r\n pos=func_find(document.form1.PRCS_OP_USER,el.value);\r\n if(pos>=0)\r\n {\r\n document.form1.PRCS_OP_USER.remove(pos);\r\n document.form1.PRCS_OP_USER.seletedIndex=0;\r\n }\r\n }\r\n}\r\n</script>\r\n";
echo "<s";
echo "cript language=\"javascript\">\r\nfunction highlight(o){\r\n\tvar trs = o.getElementsByTagName(\"tr\");\r\n\tfor(var i=0;i<trs.length;i++){\r\n\t\t//trs[i].className = (i%2)==0 ? 'highlight':'nohighlight';\r\n\t\ttrs[i].onmouseover = function(){this.style.backgroundColor='#d6d6d6';return false;}\r\n\t\ttrs[i].onmouseout = function(){this.style.backgroundColor='';return false;}\r\n\t}\r\n}\r\n\r\nfunction SubmitForm(){\r\n\tisTrue = c";
echo "heck_form();\r\n\tif (isTrue == true){\r\n\t\tdocument.form1.submit();\r\n\t}\r\n\telse{\r\n\t //donothing\r\n\t}\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onload=\"document.form1.RUN_NAME.focus();\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"5\">\r\n <tr class=\"tablehead1\">\r\n <td >新建流程\r\n </td>\r\n </tr>\r\n <tr class=\"tablehead2\"><td>\r\n <img src=\"/images/button/save.gif\" tit";
echo "le=\"保存\" onClick='SubmitForm();' style=\"cursor:hand\">\r\n <input type=\"image\" src=\"/images/button/return.gif\" border=\"0\" accesskey=\"B\" onClick=\"history.back()\" title=\"返回\">\r\n </td></tr>\r\n</table>\r\n\r\n<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"EBEBEB\">\r\n <tr>\r\n <td>\r\n\t";
$rootpath = str_replace( "\\", "/", get_cfg_var( "doc_root" )."/" );
$file = $rootpath."/general/system/workflow/flow_type/flow.ini";
$handle = fopen( $file, "r" );
$isview = fread( $handle, 1024 );
if ( $isview == 1 )
{
$dis = "";
$viewsrc = "/images/arrow_up.gif";
$viewmes = "隐藏流程图";
}
else
{
$dis = "none";
$viewsrc = "/images/arrow_down.gif";
$viewmes = "显示流程图";
}
echo "\t<img id='imgarrow' src='";
echo $viewsrc;
echo "' border=\"0\" onClick=\"DisplayFlowimg()\" style=\"cursor:hand \"> ";
echo "<s";
echo "pan style=\"color:#666666;cursor:hand \" id=\"imgtext\" onClick=\"DisplayFlowimg()\">";
echo $viewmes;
echo "</span></td>\r\n </tr>\r\n</table>\r\n\r\n<div id=\"flowdiv\" style=\"display:";
echo $dis;
echo " \">\r\n";
if ( 0 < $fc )
{
$flowinfo = $coordinate;
$query = "SELECT * from FLOW_PROCESS WHERE FLOW_ID=".$_REQUEST['FLOW_ID']." ORDER BY PRCS_ID";
$cursor = exequery( $connection, $query );
$PRCS_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$PRCS_COUNT;
$flowinfo[$PRCS_COUNT]['prcsname'] = $ROW['PRCS_NAME'];
$flowinfo[$PRCS_COUNT]['id'] = $ROW['ID'];
$flowinfo[$PRCS_COUNT]['prcsid'] = $ROW['PRCS_ID'];
}
echo "\r\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"EBEBEB\">\r\n <tr>\r\n <td><div id=\"parentLayer\" style=\"position:absolute; width:1px; height:1px; z-index:0\">\r\n";
reset( $flowinfo );
unset( $k );
while ( list( $key, $flowdetail ) = each( $flowinfo ) )
{
++$k;
$x = $flowdetail['TL']['0'];
$y = $flowdetail['TL']['1'];
$prcsname = $flowdetail['prcsname'];
$prcsid = $flowdetail['prcsid'];
echo "<div id=\"";
echo "layer".$k;
echo "\" style=\"position:absolute; left:";
echo $x;
echo "px; top:";
echo $y;
echo "px; width:";
echo $w;
echo "px; height:";
echo $h;
echo "px; z-index:0; background-color: #E2E4E3; layer-background-color: #E2E4E3; border: 1px none #000000;\">\r\n <table width=\"100%\" height=\"";
echo $h;
echo "\" border=\"1\" cellpadding=\"2\" cellspacing=\"1\" bordercolor=\"#666666\">\r\n <tr align=\"center\">\r\n\t<td height=\"20\" bgcolor=\"#0099CC\">";
echo "<s";
echo "pan style=\"color:#FFFFFF;font-weight:bolder \">\r\n\t节点:";
echo $prcsid;
echo "</span>\r\n\t</td>\r\n\t</tr>\r\n <tr >\r\n <td align=\"center\" valign=\"middle\">";
echo "<s";
echo "pan class=\"style1\">";
echo $prcsname;
echo "</span></td>\r\n </tr>\r\n </table>\r\n</div>\r\n";
}
echo "\t\r\n\t\r\n\t</div> \r\n\t\r\n\t <img src='/general/workflow/imgflow.php?FLOW_ID=";
echo $_REQUEST['FLOW_ID'];
echo "'></td>\r\n </tr>\r\n</table>\r\n";
}
else
{
message( "", "流程尚未运行" );
}
echo "\r\n</div>\r\n\r\n<hr>\r\n";
if ( $RUN_ID == "" )
{
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\"><form action=\"freedo.php\" method=\"post\" name=\"form1\" onSubmit=\"return check_form();\">\r\n <tr>\r\n <td><img src=\"/images/green_arrow.gif\" align=\"absmiddle\"> 填写该工作的文号或说明</td>\r\n </tr>\r\n</table> \r\n\r\n<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" class=\"small\">\r\n \r\n <tr>\r\n <td nowrap class=\"TableLine2\">流程名称:";
echo "</td>\r\n <td class=\"TableLine1\">\r\n ";
echo "<s";
echo "elect name=\"FLOW_ID\">\r\n";
$query = "SELECT * from FLOW_TYPE where FLOW_ID={$FLOW_ID}";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$FLOW_ID = $ROW[0];
$FLOW_NAME = $ROW[1];
echo " <option value=\"";
echo $FLOW_ID;
echo "\">";
echo $FLOW_NAME;
echo "</option>\r\n";
}
echo " </select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableLine2\">文号/说明:</td>\r\n <td class=\"TableLine1\">\r\n <input type=\"text\" name=\"RUN_NAME\" size=\"40\" maxlength=\"100\" value=\"";
echo $RUN_NAME;
echo "\">\r\n </td>\r\n </tr>\r\n</table>\r\n\t<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"1\">\r\n <tr align=\"center\" class=\"TableLine2\">\r\n <td colspan=\"2\" nowrap>\r\n <input type='hidden' value=\"";
echo $FLOW_TYPE;
echo "\" name=\"FLOW_TYPE\">\r\n <input type='hidden' value=\"";
echo $RUN_ID;
echo "\" name=\"RUN_ID\"> \r\n <input type='hidden' value=\"create\" name=\"f\"> </td>\r\n </tr>\r\n\t</form>\r\n </table>\r\n ";
}
echo " ";
if ( $RUN_ID != "" )
{
echo " <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\r\n <tr class=\"TableLine2\">\r\n <td>\r\n\t ";
$sql = "\r\n\t SELECT ft.FLOW_NAME,fr.RUN_NAME FROM flow_type AS ft,flow_run AS fr \r\n\t\t\t WHERE fr.RUN_ID=".$RUN_ID." \r\n\t\t\t\t AND FLOW_ID=".$FLOW_ID;
$res = exequery( $connection, $query );
$row = mysql_fetch_array( $res );
$FLOW_NAME = $row['FLOW_NAME'];
$RUN_NAME = $row['RUN_NAME'];
echo "\t 流程名称:";
echo $FLOW_NAME;
echo " 文号/说明:";
echo $RUN_NAME;
echo " \r\n\t </td>\r\n </tr>\r\n </table>\r\n \r\n \r\n \r\n ";
}
echo "\r\n\r\n";
if ( $RUN_ID != "" && 0 < $RUN_ID )
{
echo "\r\n <table border=\"0\" cellspacing=\"1\" class=\"small\" cellpadding=\"5\" width=\"100%\">\r\n ";
$query = "SELECT MAX(PRCS_ID) from FLOW_PROCESS WHERE FLOW_ID={$FLOW_ID}";
$PRCS_MAX = 0;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PRCS_MAX = $ROW[0];
}
$PRCS_ID_I = 1;
for ( ; $PRCS_ID_I <= $PRCS_ID; ++$PRCS_ID_I )
{
$query = "SELECT * from FLOW_RUN_PRCS where RUN_ID={$RUN_ID} and PRCS_ID={$PRCS_ID_I}";
$cursor = exequery( $connection, $query );
$USER_NAME_STR = "";
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_ID = $ROW['USER_ID'];
$FLOW_PRCS = $ROW['FLOW_PRCS'];
$query1 = "SELECT * from USER where USER_ID='{$USER_ID}'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$USER_NAME_STR .= $ROW['USER_NAME'].",";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -