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

📄 menu.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 PHP
字号:
<?php

include_once( "inc/auth.php" );
$COLOR1 = "#D9E8FF";
$COLOR2 = "#FFFFFF";
$COLOR3 = "#B3D1FF";
echo "\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n\r\n<body class=\"panel\" topmargin=\"0\" leftmargin=\"0\">\r\n<!---------------------- 分组 -------------------------------->\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableHeader\" onclick=\"clickMenu('menu_1')\" style=\"cursor:hand\">\r\n<td no";
echo "wrap colspan=\"5\" align=\"center\" title=\"\"><b>联系人分组</b></td>\r\n</tr>\r\n</table>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" id=\"menu_1\" style=\"display:\">\r\n<tr class=\"TableData\" align=\"center\">\r\n<td nowrap width=\"100%\" id=\"group_1\" onclick=\"view_group(this,0,1)\" onmouseover=\"setGroupPointer(this, '";
echo $COLOR3;
echo "',1)\" onmouseout=\"setGroupPointer(this, '";
echo $COLOR2;
echo "',1)\" style=\"cursor:hand\" BgColor=\"";
echo $COLOR1;
echo "\">默认</td>\r\n</tr>\r\n";
$connection = openconnection( );
$query = "select * from ADDRESS_GROUP where USER_ID='{$LOGIN_USER_ID}' order by GROUP_NAME asc";
$cursor = exequery( $connection, $query );
$GROUP_COUNT = 1;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
	++$GROUP_COUNT;
	$GROUP_ID = $ROW['GROUP_ID'];
	$GROUP_NAME = $ROW['GROUP_NAME'];
	echo "<tr class=\"TableData\" align=\"center\">\r\n<td nowrap width=\"100%\" id=\"group_";
	echo $GROUP_COUNT;
	echo "\" onclick=\"view_group(this,";
	echo $GROUP_ID;
	echo ",";
	echo $GROUP_COUNT;
	echo ")\" onmouseover=\"setGroupPointer(this, '";
	echo $COLOR3;
	echo "',";
	echo $GROUP_COUNT;
	echo ")\" onmouseout=\"setGroupPointer(this, '";
	echo $COLOR2;
	echo "',";
	echo $GROUP_COUNT;
	echo ")\" style=\"cursor:hand\">";
	echo $GROUP_NAME;
	echo "</td>\r\n</tr>\r\n";
}
echo "</table>\r\n\r\n";
echo "<s";
echo "cript language=\"JavaScript\">\r\nvar td_id=1;\r\n\r\nfunction setGroupPointer(theRow, thePointerColor,td_id_over)\r\n{\r\n  if(td_id!=td_id_over)\r\n     theRow.bgColor = thePointerColor;\r\n}\r\nfunction clickMenu(ID)\r\n{\r\n    targetelement=document.all(ID);\r\n    if (targetelement.style.display==\"none\")\r\n        targetelement.style.display='';\r\n    else\r\n        targetelement.style.display=\"none\";\r\n}\r\n\r\nfunction v";
echo "iew_group(theRow,group_id,group_count)\r\n{\r\n   parent.main.location=\"address?GROUP_ID=\"+group_id;\r\n   td_id=group_count;\r\n";
$I = 1;
for ( ;	$I <= $GROUP_COUNT;	++$I	)
{
	echo "     group_".$I.".bgColor='{$COLOR2}';\n";
}
echo "     theRow.bgColor='";
echo $COLOR1;
echo "';\r\n}\r\n</script>\r\n\r\n<!---------------------- 索引 -------------------------------->\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableHeader\" onclick=\"clickMenu('menu_2')\" style=\"cursor:hand\">\r\n<td nowrap colspan=\"5\" align=\"center\"><b>索引(按姓氏)</b></td>\r\n</tr>\r\n</table>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"sma";
echo "ll\" bgcolor=\"#000000\" cellpadding=\"3\" id=\"menu_2\" style=\"display:none\">\r\n";
include_once( "inc/mb.php" );
$i = ord( "A" );
for ( ;	$i <= ord( "Z" );	++$i	)
{
	$name[chr( $i )] = array( );
	$nidx[chr( $i )] = array( );
}
$name['other'] = array( );
$nidx['other'] = array( );
$sql = "select * from ADDRESS where USER_ID='{$LOGIN_USER_ID}' order by PSN_NAME";
$result = mysql_query( $sql );
while ( $row = mysql_fetch_array( $result ) )
{
	$s = $row['PSN_NAME'];
	$idx = "other";
	if ( 128 <= ord( $s[0] ) )
	{
		$FirstName = substr( $s, 0, 2 );
		foreach ( $mb as $key => $s )
		{
			if ( strpos( $s, $FirstName ) )
			{
				$idx = strtoupper( $key );
				break;
			}
		}
	}
	else
	{
		$FirstName = strtoupper( $s[0] );
		if ( "A" <= $FirstName && $FirstName <= "Z" )
		{
			$idx = $FirstName;
		}
		else
		{
			$idx = "other";
		}
	}
	if ( !in_array( $FirstName, $nidx[$idx] ) )
	{
		array_push( $nidx[$idx], $FirstName );
	}
	array_push( $name[$idx], $row );
}
$INDEX = 0;
if ( mysql_num_rows( $result ) < 1 )
{
	echo "<tr class=\"TableData\" align=\"center\">\r\n<td nowrap width=\"100%\" id=\"index_1\" onmouseover=\"setIndexPointer(this, '";
	echo $COLOR3;
	echo "',1)\" onmouseout=\"setIndexPointer(this, '";
	echo $COLOR2;
	echo "',1)\" style=\"cursor:hand\">无记录</td>\r\n</tr>\r\n";
}
else
{
	foreach ( $name as $key => $r )
	{
		if ( 0 < count( $name[$key] ) )
		{
			++$INDEX;
			if ( $key == "other" )
			{
				$TABLE_STR = "<b>其它</b>(".count( $name[$key] ).") - ".implode( ", ", $nidx[$key] );
			}
			else
			{
				$TABLE_STR = "<b>".$key."</b>(".count( $name[$key] ).") - ".implode( ", ", $nidx[$key] );
			}
			$ID_STR = "";
			foreach ( $r as $ROW )
			{
				$ADD_ID = $ROW['ADD_ID'];
				$ID_STR .= $ADD_ID.",";
			}
			echo "<tr class=\"TableData\" align=\"center\">\r\n<td width=\"100%\" id=\"index_";
			echo $INDEX;
			echo "\" onclick=\"view_index(this,'";
			echo $ID_STR;
			echo "','";
			echo $TABLE_STR;
			echo "',";
			echo $INDEX;
			echo ")\" onmouseover=\"setIndexPointer(this, '";
			echo $COLOR3;
			echo "',";
			echo $INDEX;
			echo ")\" onmouseout=\"setIndexPointer(this, '";
			echo $COLOR2;
			echo "',";
			echo $INDEX;
			echo ")\" style=\"cursor:hand\">";
			echo $TABLE_STR;
			echo "</td>\r\n</tr>\r\n";
		}
	}
}
echo "</table>\r\n\r\n";
echo "<s";
echo "cript language=\"JavaScript\">\r\nvar index_id=0;\r\n\r\nfunction setIndexPointer(theRow, thePointerColor,index_id_over)\r\n{\r\n  if(index_id!=index_id_over)\r\n     theRow.bgColor = thePointerColor;\r\n}\r\n\r\nfunction view_index(theRow,id_str,table_str,index_count)\r\n{\r\n   parent.main.location=\"address/idx_search.php?ID_STR=\"+id_str+\"&TABLE_STR=\"+table_str;\r\n   index_id=index_count;\r\n";
$I = 1;
for ( ;	$I <= $INDEX;	++$I	)
{
	echo "     index_".$I.".bgColor='{$COLOR2}';\n";
}
echo "     theRow.bgColor='";
echo $COLOR1;
echo "';\r\n}\r\n</script>\r\n\r\n<!---------------------- 查找 -------------------------------->\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableHeader\" onclick=\"parent.main.location='address/search.php'\" style=\"cursor:hand\">\r\n<td nowrap colspan=\"5\" align=\"center\"><b>查找(关键字)</b></td>\r\n</tr>\r\n</table>\r\n\r\n<!---------------------- 管理分组";
echo " -------------------------------->\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\">\r\n<tr class=\"TableHeader\" onclick=\"parent.main.location='group'\" style=\"cursor:hand\">\r\n<td nowrap colspan=\"5\" align=\"center\"><b>管理分组</b></td>\r\n</tr>\r\n</table>\r\n\r\n</body>\r\n</html>";
?>

⌨️ 快捷键说明

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