menu.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 246 行
PHP
246 行
<?
include_once 'inc/auth.php';
$COLOR1 = '#D9E8FF';
$COLOR2 = '#FFFFFF';
$COLOR3 = '#B3D1FF';
echo '
<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 no';
echo 'wrap 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, \'';
echo $COLOR3;
echo '\',1)" onmouseout="setGroupPointer(this, \'';
echo $COLOR2;
echo '\',1)" style="cursor:hand" BgColor="';
echo $COLOR1;
echo '">默认</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))
{
++$GROUP_COUNT;
$GROUP_ID = $ROW['GROUP_ID'];
$GROUP_NAME = $ROW['GROUP_NAME'];
echo '<tr class="TableData" align="center">
<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>
</tr>
';
}
echo '</table>
';
echo '<s';
echo 'cript 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 v';
echo 'iew_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).'\';
'));
}
echo ' theRow.bgColor=\'';
echo $COLOR1;
echo '\';
}
</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="sma';
echo 'll" 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))
{
$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) AND ($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">
<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>
</tr>
';
}
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">
<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>
</tr>
';
continue;
}
}
}
echo '</table>
';
echo '<s';
echo 'cript 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).'\';
'));
}
echo ' theRow.bgColor=\'';
echo $COLOR1;
echo '\';
}
</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>
<!---------------------- 管理分组';
echo ' -------------------------------->
<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 + =
减小字号Ctrl + -
显示快捷键?