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

📄 export.php

📁 通达网络办公 - Office Anywhere 2008 增强版100%源码(3.4.081216) 内含 通达OA2008增強版接近完美破解补丁20081216集 及 最新通达OA2008ADV(
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/check_type.php" );
include_once( "inc/ip2add.php" );
ob_end_clean( );
header( "Cache-control: private" );
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename= 工作流日志.xls" );
echo "\r\n<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\nxmlns:x=\"urn:schemas-microsoft-com:office:excel\"\r\nxmlns=\"http://www.w3.org/TR/REC-html40\">\r\n<head>\r\n<title>系统日志导出</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n<body>\r\n<table border=\"1\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\">\r\n<tr align=\"center\" style=\"BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;\">\r\n   <td nowrap align=\"center\">流水号</td>\r\n   <td nowrap align=\"center\">工作名称/文号</td>\r\n   <td nowrap align=\"center\">步骤号</td>\r\n   <td nowrap align=\"center\">步骤名称</td>\r\n   <td nowrap align=\"center\">相关人员</td>\r\n   <td nowrap align=\"center\">发生时间</td>\r\n   <td nowrap align=\"center\">IP地址</td>\r\n   <td nowrap align=\"center\">内容</td>\r\n</tr>\r\n";
if ( $BEGIN_DATE != "" )
{
	$TIME_OK = is_date_time( $BEGIN_TIME );
	if ( !$TIME_OK )
	{
		message( "错误", "起始时间格式不对,应形如 1999-1-2 14:55:20" );
		button_back( );
		exit( );
	}
}
if ( $END_DATE != "" )
{
	$TIME_OK = is_date_time( $END_TIME );
	if ( !$TIME_OK )
	{
		message( "错误", "截止时间格式不对,应形如 1999-1-2 14:55:20" );
		button_back( );
		exit( );
	}
}
$query = "select * from FLOW_RUN_LOG WHERE 1=1";
if ( $RUN_ID )
{
	$query .= " and RUN_ID='".$RUN_ID."'";
}
if ( $RUN_NAME )
{
	$query .= " and RUN_NAME LIKE '%".$RUN_NAME."%'";
}
if ( $FLOW_ID != "ALL" )
{
	$query .= " and FLOW_ID='".$FLOW_ID."'";
}
if ( $BEGIN_TIME )
{
	$query .= " and TIME>='".$BEGIN_TIME." 00:00:00'";
}
if ( $END_TIME )
{
	$query .= " and TIME<='".$END_TIME." 23:59:59'";
}
if ( $IP )
{
	$query .= " and IP='".$IP."'";
}
if ( $USER_ID )
{
	$query .= " and USER_ID='".$USER_ID."'";
}
if ( $LOG_TYPE )
{
	$query .= " and TYPE='".$LOG_TYPE."'";
}
$USER_NAME_ARR = array( );
$PRCS_NAME_ARR = array( );
$LOG_COUNT = 0;
$query .= " order by TIME DESC";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	$RUN_ID = $ROW['RUN_ID'];
	$RUN_NAME = $ROW['RUN_NAME'];
	$USER_ID = $ROW['USER_ID'];
	$CONTENT = $ROW['CONTENT'];
	$TIME = $ROW['TIME'];
	$FLOW_ID = $ROW['FLOW_ID'];
	$FLOW_PRCS = $ROW['FLOW_PRCS'];
	$PRCS_ID = $ROW['PRCS_ID'];
	$IP = $ROW['IP'];
	$IP_ADD = convertip( $IP );
	if ( !array_key_exists( $USER_ID, $USER_NAME_ARR ) )
	{
		$query1 = "select USER_NAME from USER WHERE USER_ID='".$USER_ID."'";
		$cursor1 = exequery( $connection, $query1 );
		if ( $ROW = mysql_fetch_array( $cursor1 ) )
		{
			$USER_NAME_ARR["{$USER_ID}"] = $ROW['USER_NAME'];
		}
	}
	$USER_NAME = $USER_NAME_ARR["{$USER_ID}"];
	if ( $FLOW_PRCS != "" && $FLOW_PRCS != 0 )
	{
		if ( !$PRCS_NAME_ARR["{$FLOW_ID}"] )
		{
			$PRCS_NAME_ARR["{$FLOW_ID}"] = array( );
		}
		if ( !array_key_exists( $FLOW_PRCS, $PRCS_NAME_ARR["{$FLOW_ID}"] ) )
		{
			$query1 = "select PRCS_NAME 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_ARR["{$FLOW_ID}"]["{$FLOW_PRCS}"] = $ROW['PRCS_NAME'];
			}
		}
		$PRCS_NAME = $PRCS_NAME_ARR["{$FLOW_ID}"]["{$FLOW_PRCS}"];
	}
	else
	{
		$PRCS_NAME = "自由流程";
	}
	++$LOG_COUNT;
	if ( $LOG_COUNT % 2 == 0 )
	{
		$TableLine = "TableLine1";
	}
	else
	{
		$TableLine = "TableLine2";
	}
	echo "<tr class=\"";
	echo $TableLine;
	echo "\">\r\n\t<td align=\"center\">";
	echo $RUN_ID;
	echo "</td>\r\n\t<td >";
	echo $RUN_NAME;
	echo "</td>\r\n\t<td align=\"center\">";
	echo $PRCS_ID == 0 ? "-" : $PRCS_ID;
	echo "</td>\r\n  <td nowrap align=\"center\">";
	echo $PRCS_NAME;
	echo "</td>\r\n\t<td align=\"center\">";
	echo $USER_NAME;
	echo "</td>\r\n\t<td align=\"center\">";
	echo $TIME;
	echo "</td>\r\n\t<td align=\"center\">";
	echo $IP."(".$IP_ADD.")";
	echo "</td>\r\n\t<td >";
	echo $CONTENT;
	echo "</td>\r\n</tr>\r\n";
}
echo "</talbe> \r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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