others.php

来自「极限网络智能办公系统 - Office Automation 2008 官方10」· PHP 代码 · 共 250 行

PHP
250
字号
<?php
 

include_once( "inc/auth.php" );
include_once( "../../prcs_role.php" );
if ( !run_role( $RUN_ID, $PRCS_ID ) )
{
	exit( );
}
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<SCRIPT language=javascript>\r\nfunction LoadWindow(PRCS_ID_I)\r\n{\r\n  URL=\"user_select?FLOW_ID=";
echo $FLOW_ID;
echo "&RUN_ID=";
echo $RUN_ID;
echo "&PRCS_ID=\" + PRCS_ID_I;\r\n  loc_x=document.body.scrollLeft+event.clientX-event.offsetX;\r\n  loc_y=document.body.scrollTop+event.clientY-event.offsetY+210;\r\n  window.showModalDialog(URL,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:250px;dialogHeight:300px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n\r\nfunction CheckForm()\r\n{\r\n   if (document.form1.USER_ID.value==\"\")\r\n   { alert(\"请指定当前步骤的代办人!\");\r\n     return (false);\r\n   }\r\n   return (true);\r\n}\r\n</SCRIPT>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
$query = "SELECT FLOW_NAME,FORM_ID from FLOW_TYPE WHERE FLOW_ID=".$FLOW_ID;
$cursor1 = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
	$FLOW_NAME = $ROW['FLOW_NAME'];
	$FORM_ID = $ROW['FORM_ID'];
}
$query = "SELECT RUN_NAME from FLOW_RUN WHERE RUN_ID=".$RUN_ID;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
	$RUN_NAME = $ROW['RUN_NAME'];
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n  <tr>\r\n    <td class=\"Big\"><img src=\"/images/green_arrow.gif\" align=\"absmiddle\"><span class=\"big3\"> 委托代办人/转交主办权</span><br>\r\n    </td>\r\n  </tr>\r\n</table>\r\n\r\n<table border=\"0\" cellspacing=\"1\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" width=\"90%\">\r\n<form action=\"others_submit.php\" method=\"post\" name=\"form1\" onsubmit=\"return CheckForm();\">\r\n    <tr class=\"TableHeader\">\r\n      <td nowrap align=\"center\" class=\"Big\" colspan=\"2\"><b>";
echo $FLOW_NAME;
echo "</b></td>\r\n    </tr>\r\n\r\n";
$PRCS_ID_I = 1;
for ( ;	$PRCS_ID_I <= $PRCS_ID;	++$PRCS_ID_I	)
{
	$query = "SELECT USER_ID,FLOW_PRCS from FLOW_RUN_PRCS where RUN_ID=".$RUN_ID." and PRCS_ID={$PRCS_ID_I}";
	$cursor = exequery( $connection, $query );
	$USER_NAME_STR = "";
	$USER_COUNT = 0;
	while ( $ROW = mysql_fetch_array( $cursor ) )
	{
		++$USER_COUNT;
		$USER_ID = $ROW['USER_ID'];
		$FLOW_PRCS = $ROW['FLOW_PRCS'];
		$query1 = "SELECT USER_NAME from USER where USER_ID='".$USER_ID."'";
		$cursor1 = exequery( $connection, $query1 );
		if ( $ROW = mysql_fetch_array( $cursor1 ) )
		{
			$USER_NAME_STR .= $ROW['USER_NAME'].",";
		}
	}
	$query1 = "SELECT * from FLOW_PROCESS WHERE FLOW_ID=".$FLOW_ID." and PRCS_ID={$FLOW_PRCS}";
	$cursor1 = exequery( $connection, $query1 );
	if ( $ROW = mysql_fetch_array( $cursor1 ) )
	{
		$PRCS_NAME = $ROW['PRCS_NAME'];
		$PRCS_USER = $ROW['PRCS_USER'];
		$PRCS_DEPT = $ROW['PRCS_DEPT'];
		$PRCS_PRIV = $ROW['PRCS_PRIV'];
	}
	$USER_NAME_STR = substr( $USER_NAME_STR, 0, strlen( $USER_NAME_STR ) - 1 );
	if ( $PRCS_ID_I != $PRCS_ID )
	{
		echo "\r\n       <tr class=\"TableData\">\r\n         <td nowrap width=\"10%\">";
		echo $PRCS_ID_I;
		echo ":";
		echo $PRCS_NAME;
		echo "</td>\r\n         <td>";
		echo $USER_NAME_STR;
		echo "</td>\r\n       </tr>\r\n";
	}
	else
	{
		echo "       <tr class=\"TableData\">\r\n         <td nowrap width=\"10%\">";
		echo $PRCS_ID_I;
		echo ":";
		echo $PRCS_NAME;
		echo " (当前步骤)</td>\r\n         <td>\r\n";
		if ( 1 < $USER_COUNT && !$OP_FLAG )
		{
			echo "本步骤为会签步骤,不能指定代办人;且您不是主办人,不能转交主办权";
		}
		else
		{
			if ( $USER_COUNT == 1 )
			{
				if ( $PRCS_DEPT != "" )
				{
					$PRCS_DEPT = substr( $PRCS_DEPT, 0, strlen( $PRCS_DEPT ) - 1 );
					$query1 = "SELECT USER_ID from USER,USER_PRIV WHERE USER.USER_PRIV=USER_PRIV.USER_PRIV and DEPT_ID in(".$PRCS_DEPT.") and NOT_LOGIN!='1' order by PRIV_NO,USER_NO,USER_NAME";
					$cursor1 = exequery( $connection, $query1 );
					while ( $ROW = mysql_fetch_array( $cursor1 ) )
					{
						$USER_ID = $ROW['USER_ID'];
						if ( !find_id( $PRCS_USER, $USER_ID ) )
						{
							$PRCS_USER .= $USER_ID.",";
						}
					}
				}
				if ( $PRCS_PRIV != "" )
				{
					$PRCS_PRIV = substr( $PRCS_PRIV, 0, strlen( $PRCS_PRIV ) - 1 );
					$query1 = "SELECT USER_ID from USER,USER_PRIV WHERE USER.USER_PRIV=USER_PRIV.USER_PRIV and USER.USER_PRIV in(".$PRCS_PRIV.") and NOT_LOGIN!='1' order by PRIV_NO,USER_NO,USER_NAME";
					$cursor1 = exequery( $connection, $query1 );
					while ( $ROW = mysql_fetch_array( $cursor1 ) )
					{
						$USER_ID = $ROW['USER_ID'];
						if ( !find_id( $PRCS_USER, $USER_ID ) )
						{
							$PRCS_USER .= $USER_ID.",";
						}
					}
				}
			}
			else
			{
				$PRCS_USER = "";
				$query = "SELECT USER_ID from FLOW_RUN_PRCS where RUN_ID=".$RUN_ID." and PRCS_ID={$PRCS_ID_I}";
				$cursor = exequery( $connection, $query );
				while ( $ROW = mysql_fetch_array( $cursor ) )
				{
					$USER_ID = $ROW['USER_ID'];
					if ( !find_id( $PRCS_USER, $USER_ID ) )
					{
						$PRCS_USER .= $USER_ID.",";
					}
				}
			}
			$MY_ARRAY = explode( ",", $PRCS_USER );
			$ARRAY_COUNT = sizeof( $MY_ARRAY );
			if ( $MY_ARRAY[$ARRAY_COUNT - 1] == "" )
			{
				--$ARRAY_COUNT;
			}
			$OTHER_COUNT = 0;
			$I = 0;
			for ( ;	$I < $ARRAY_COUNT;	++$I	)
			{
				if ( $MY_ARRAY[$I] != $LOGIN_USER_ID )
				{
					++$OTHER_COUNT;
					$query1 = "SELECT USER_NAME,USER_ID,DEPT_NAME,NOT_LOGIN from USER,DEPARTMENT where USER_ID='".$MY_ARRAY[$I]."' and USER.DEPT_ID=DEPARTMENT.DEPT_ID";
					$cursor1 = exequery( $connection, $query1 );
					if ( $ROW = mysql_fetch_array( $cursor1 ) )
					{
						if ( $OTHER_COUNT == 1 )
						{
							$FIRST_USER_NAME = $ROW['USER_NAME'];
							$FIRST_USER_ID = $ROW['USER_ID'];
						}
						$USER_NAME = $ROW['USER_NAME'];
						$DEPT_NAME = $ROW['DEPT_NAME'];
						$NOT_LOGIN = $ROW['NOT_LOGIN'];
					}
					if ( $NOT_LOGIN || !( $OTHER_COUNT == 1 ) )
					{
						if ( $USER_COUNT == 1 )
						{
							echo "<b><font color=red>委托代办人为:</font></b>";
						}
						else
						{
							echo "<b><font color=red>转交主办权给:</font></b>";
						}
					}
				}
			}
			if ( $MY_ARRAY[0] == $LOGIN_USER_ID && $ARRAY_COUNT == 1 )
			{
				$I = 0;
			}
			if ( $I == 0 )
			{
				echo "<font color=red><b>本步骤无可供选择的代办人</b></font>";
			}
			else
			{
				echo "<input type=\"text\" name=\"USER_ID_NAME\" size=\"10\" class=\"BigStatic\" readonly value=\"";
				echo $FIRST_USER_NAME;
				echo "\">&nbsp;\r\n<input type=\"hidden\" name=\"USER_ID\" value=\"";
				echo $FIRST_USER_ID;
				echo "\">\r\n<input type=\"button\" value=\"选择\" class=\"BigButton\" onClick=\"LoadWindow(";
				echo $PRCS_ID_I;
				echo ")\" title=\"指定代办人或主办人\" name=\"button\">\r\n";
			}
		}
		echo "         </td>\r\n       </tr>\r\n";
	}
}
if ( $USER_COUNT == 1 || $OP_FLAG )
{
	echo "    <tr class=\"TableHeader\">\r\n      <td colspan=\"2\"><b>短信提醒</b></td>\r\n    </tr>\r\n";
	$query = "select PARA_VALUE from SYS_PARA where PARA_NAME='SMS_REMIND'";
	$cursor = exequery( $connection, $query );
	if ( $ROW = mysql_fetch_array( $cursor ) )
	{
		$PARA_VALUE = $ROW['PARA_VALUE'];
	}
	$SMS_REMIND = substr( $PARA_VALUE, 0, strpos( $PARA_VALUE, "|" ) );
	$SMS2_REMIND = substr( $PARA_VALUE, strpos( $PARA_VALUE, "|" ) + 1 );
	echo "    <tr class=\"TableData\">\r\n      <td colspan=\"2\">\r\n        <input type=\"checkbox\" name=\"SMS_REMIND\" id=\"SMS_REMIND\" ";
	if ( find_id( $SMS_REMIND, "7" ) )
	{
		echo "checked";
	}
	echo "><label for=\"SMS_REMIND\">使用内部短信提醒经办人</label>\r\n";
	$query = "select TYPE_PRIV from SMS2_PRIV";
	$cursor = exequery( $connection, $query );
	if ( $ROW = mysql_fetch_array( $cursor ) )
	{
		$TYPE_PRIV = $ROW['TYPE_PRIV'];
	}
	if ( find_id( $TYPE_PRIV, 7 ) )
	{
		echo "        <input type=\"checkbox\" name=\"SMS2_REMIND\" id=\"SMS2_REMIND\" ";
		if ( find_id( $SMS_REMIND, "7" ) )
		{
			echo "checked";
		}
		echo "><label for=\"SMS2_REMIND\">使用手机短信提醒经办人</label>\r\n";
	}
	if ( $USER_COUNT == 1 )
	{
		$SMS_CONTENT = "工作流委托提醒:".$RUN_NAME;
	}
	else
	{
		$SMS_CONTENT = "工作流主办权转交提醒:".$RUN_NAME;
	}
	echo "<br>\r\n短信内容:<input type=\"text\" name=\"SMS_CONTENT\" value=\"";
	echo $SMS_CONTENT;
	echo "\" size=\"62\" maxlength=\"100\" class=\"SmallInput\">\r\n     </td>\r\n    </tr>\r\n";
}
echo "    <tr class=\"TableControl\">\r\n      <td nowrap align=\"center\" colspan=\"2\">\r\n      \t<input type=\"hidden\"  name=\"RUN_ID\" value=\"";
echo $RUN_ID;
echo "\">\r\n        <input type=\"hidden\"  name=\"USER_COUNT\" value=\"";
echo $USER_COUNT;
echo "\">\r\n        <input type=\"hidden\" name=\"MENU_FLAG\" value=\"";
echo $MENU_FLAG;
echo "\">\r\n        <input type=\"hidden\" name=\"FLOW_ID\" value=\"";
echo $FLOW_ID;
echo "\">\r\n        <input type=\"hidden\"  name=\"PRCS_ID\" value=\"";
echo $PRCS_ID;
echo "\">\r\n";
if ( $I != 0 )
{
	echo "        <input type=\"submit\"  value=\"确定\" class=\"BigButton\" name=\"submit\">&nbsp;&nbsp;\r\n";
}
echo "        <input type=\"button\"  value=\"返回\" class=\"BigButton\" name=\"back\" onClick=\"history.back();\">\r\n      </td>\r\n    </tr>\r\n</table>\r\n</form>\r\n\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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