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

📄 menu.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
$COLOR1="#D9E8FF";
$COLOR2="#FFFFFF";
$COLOR3="#B3D1FF";
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body class="panel" topmargin="0" leftmargin="0">
<!---------------------- 分组 -------------------------------->
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableHeader" onclick="clickMenu('menu_1')" style="cursor:hand">
<td nowrap colspan="5" align="center" title=""><b>联系人分组</b></td>
</tr>
</table>
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" id="menu_1" style="display:">
<tr class="TableData" align="center">
<td nowrap width="100%" id="group_1" onclick="view_group(this,0,1)" onmouseover="setGroupPointer(this, '<?=$COLOR3?>',1)" onmouseout="setGroupPointer(this, '<?=$COLOR2?>',1)" style="cursor:hand" BgColor="<?=$COLOR1?>">默认</td>
</tr>
<?
$query = "select * from ADDRESS_GROUP where USER_ID='' order by GROUP_NAME asc";

$cursor= exequery($connection,$query);
$GROUP_COUNT=1;
while($ROW=mysql_fetch_array($cursor))
{
	 $PRIV_DEPT=$ROW["PRIV_DEPT"];
	 $PRIV_ROLE=$ROW["PRIV_ROLE"];
	 $PRIV_USER=$ROW["PRIV_USER"];

	 if($PRIV_DEPT!="ALL_DEPT")
	 {
	    if(!find_id($PRIV_DEPT,$LOGIN_DEPT_ID) && !find_id($PRIV_ROLE,$LOGIN_USER_PRIV) && !find_id($PRIV_USER,$LOGIN_USER_ID))
	    {
	       continue;
	    }
   }
	 $GROUP_COUNT++;

   $GROUP_ID=$ROW["GROUP_ID"];
   $GROUP_NAME=$ROW["GROUP_NAME"];

   $GROUP_ID_STR.=$GROUP_ID.",";
?>
<tr class="TableData" align="center">
<td nowrap width="100%" id="group_<?=$GROUP_COUNT?>" onclick="view_group(this,<?=$GROUP_ID?>,<?=$GROUP_COUNT?>)" onmouseover="setGroupPointer(this, '<?=$COLOR3?>',<?=$GROUP_COUNT?>)" onmouseout="setGroupPointer(this, '<?=$COLOR2?>',<?=$GROUP_COUNT?>)" style="cursor:hand"><?=$GROUP_NAME?></td>
</tr>
<?
}
$GROUP_ID_STR=$GROUP_ID_STR."0,";
?>
</table>

<script language="JavaScript">
var td_id=1;

function setGroupPointer(theRow, thePointerColor,td_id_over)
{
  if(td_id!=td_id_over)
     theRow.bgColor = thePointerColor;
}
function clickMenu(ID)
{
    targetelement=document.all(ID);
    if (targetelement.style.display=="none")
        targetelement.style.display='';
    else
        targetelement.style.display="none";
}

function view_group(theRow,group_id,group_count)
{
   parent.main.location="address?GROUP_ID="+group_id;
   td_id=group_count;
<?
for($I=1;$I<=$GROUP_COUNT;$I++)
   echo "     group_".$I.".bgColor='$COLOR2';\n"
?>
     theRow.bgColor='<?=$COLOR1?>';
}
</script>

<!---------------------- 索引 -------------------------------->
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableHeader" onclick="clickMenu('menu_2')" style="cursor:hand">
<td nowrap colspan="5" align="center"><b>索引(按姓氏)</b></td>
</tr>
</table>
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" id="menu_2" style="display:none">
<?
	include_once('inc/mb.php');

	for($i=ord('A'); $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='' order by PSN_NAME";
	$result=mysql_query($sql);
	while($row=mysql_fetch_array($result))
	{
		$GROUP_ID=$row["GROUP_ID"];
		if(!find_id($GROUP_ID_STR,$GROUP_ID))
		   continue;

		$s=$row['PSN_NAME'];
	  $idx='other';
		if(ord($s[0])>=128)
		{
			$FirstName=substr($s, 0, 2);
			foreach($mb as $key => $s)
			{
				if(strpos($s, $FirstName))
				{
					//$row['PSN_NAME'].=strpos($s, $FirstName);
					$idx=strtoupper($key);
					break;
				}
			}
		}
		else
		{
			$FirstName=strtoupper($s[0]);
			if($FirstName>='A' && $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)
	{
?>
<tr class="TableData" align="center">
<td nowrap width="100%" id="index_1" onmouseover="setIndexPointer(this, '<?=$COLOR3?>',1)" onmouseout="setIndexPointer(this, '<?=$COLOR2?>',1)" style="cursor:hand">无记录</td>
</tr>
<?
  }
	else
	foreach($name as $key => $r)
	{
		if(count($name[$key])>0)
		{
		   $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.",";
	       }

?>
<tr class="TableData" align="center">
<td width="100%" id="index_<?=$INDEX?>" onclick="view_index(this,'<?=$ID_STR?>','<?=$TABLE_STR?>',<?=$INDEX?>)" onmouseover="setIndexPointer(this, '<?=$COLOR3?>',<?=$INDEX?>)" onmouseout="setIndexPointer(this, '<?=$COLOR2?>',<?=$INDEX?>)" style="cursor:hand"><?=$TABLE_STR?></td>
</tr>
<?
	   }
	}
?>
</table>

<script language="JavaScript">
var index_id=0;

function setIndexPointer(theRow, thePointerColor,index_id_over)
{
  if(index_id!=index_id_over)
     theRow.bgColor = thePointerColor;
}

function view_index(theRow,id_str,table_str,index_count)
{
   parent.main.location="address/idx_search.php?ID_STR="+id_str+"&TABLE_STR="+table_str;
   index_id=index_count;
<?
for($I=1;$I<=$INDEX;$I++)
   echo "     index_".$I.".bgColor='$COLOR2';\n"
?>
     theRow.bgColor='<?=$COLOR1?>';
}
</script>

<!---------------------- 查找 -------------------------------->
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableHeader" onclick="parent.main.location='address/search.php'" style="cursor:hand">
<td nowrap colspan="5" align="center"><b>查找(关键字)</b></td>
</tr>
</table>

<!---------------------- 管理分组 -------------------------------->
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableHeader" onclick="parent.main.location='group'" style="cursor:hand">
<td nowrap colspan="5" align="center"><b>分组</b></td>
</tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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