index.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 264 行
PHP
264 行
<?
include_once 'inc/auth.php';
echo '
<html>
<head>
<title>菜单快捷组</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<s';
echo 'cript>
function func_insert()
{
for (i=0; i';
echo '<s';
echo 'elect2.options.length; i++)
{
if(select2.options(i).selected)
{
option_text=select2.options(i).text;
option_value=select2.options(i).value;
option_style_color=select2.options(i).style.color;
var my_option = document.createElement("OPTION");
my_option.text=option_text;
my_option.value=option_value;
my_option.style.color=option_style_color;
';
echo ' pos=select2.options.length;
select1.add(my_option,pos);
select2.remove(i);
i--;
}
}//for
}
function func_delete()
{
for (i=0;i';
echo '<s';
echo 'elect1.options.length;i++)
{
if(select1.options(i).selected)
{
option_text=select1.options(i).text;
option_value=select1.options(i).value;
var my_option = document.createElement("OPTION");
my_option.text=option_text;
my_option.value=option_value;
pos=select2.options.length;
select2.add(my_option,pos);
select1.remove(i);
i--;
}
';
echo '
}//for
}
function func_select_all1()
{
for (i=select1.options.length-1; i>=0; i--)
select1.options(i).selected=true;
}
function func_select_all2()
{
for (i=select2.options.length-1; i>=0; i--)
select2.options(i).selected=true;
}
function func_up()
{
sel_count=0;
for (i=select1.options.length-1; i>=0; i--)
{
if(select1.options(i).selected)
sel_coun';
echo 't++;
}
if(sel_count==0)
{
alert("调整菜单快捷组的项目顺序时,请选择其中一项!");
return;
}
else if(sel_count>1)
{
alert("调整菜单快捷组的项目顺序时,只能选择其中一项!");
return;
}
i=select1.selectedIndex;
if(i!=0)
{
var my_option = document.createElement("OPTION");
my_option.text=select1.options(i).text;
my_option.value=se';
echo 'lect1.options(i).value;
select1.add(my_option,i-1);
select1.remove(i+1);
select1.options(i-1).selected=true;
}
}
function func_down()
{
sel_count=0;
for (i=select1.options.length-1; i>=0; i--)
{
if(select1.options(i).selected)
sel_count++;
}
if(sel_count==0)
{
alert("调整菜单快捷组的项目顺序时,请选择其中一项!");
return;
}
';
echo ' else if(sel_count>1)
{
alert("调整菜单快捷组的项目顺序时,只能选择其中一项!");
return;
}
i=select1.selectedIndex;
if(i!=select1.options.length-1)
{
var my_option = document.createElement("OPTION");
my_option.text=select1.options(i).text;
my_option.value=select1.options(i).value;
select1.add(my_option,i+2);
select1.remove(i);
select1';
echo '.options(i+1).selected=true;
}
}
function mysubmit()
{
fld_str="";
for (i=0; i< select1.options.length; i++)
{
options_value=select1.options(i).value;
fld_str+=options_value+",";
}
location="submit.php?FLD_STR=" + fld_str;
}
</script>
</head>
<body class="bodycolor" topmargin="5">
';
$query = (((''.'select * from USER where USER_ID=\'').$LOGIN_USER_ID).'\'');
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$SHORTCUT = $ROW['SHORTCUT'];
}
$USER_FUNC_ID_STR = $LOGIN_FUNC_STR;
echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/edit.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 菜单快捷组定义</span>
</td>
</tr>
</table>
<br>
<table width="500" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="big">
<tr bgcolor="#CCCCCC">
<td align="center">排序</td>
<td align="center"><b>菜单快捷组项目</b></td>
<td align="center">选择</td>
<td align="center" valign="top"><b>备选菜单项';
echo '</b></td>
</tr>
<tr>
<td align="center" bgcolor="#999999">
<input type="button" class="SmallInput" value=" ↑ " onclick="func_up();">
<br><br>
<input type="button" class="SmallInput" value=" ↓ " onclick="func_down();">
</td>
<td valign="top" align="center" bgcolor="#CCCCCC">
';
echo '<s';
echo 'elect name="select1" ondblclick="func_delete();" MULTIPLE style="width:200;height:280">
';
$SHORTCUT_ARRAY = explode (',', $SHORTCUT);
$ARRAY_COUNT = sizeof ($SHORTCUT_ARRAY);
for ($I = 0; ($I < $ARRAY_COUNT); ++$I)
{
if (($SHORTCUT_ARRAY[$I] == ''))
{
break;
}
$FUNC_ID = $SHORTCUT_ARRAY[$I];
$query = ((''.'SELECT * from SYS_FUNCTION where FUNC_ID=').$FUNC_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$FUNC_NAME = $ROW['FUNC_NAME'];
}
if (find_id ($USER_FUNC_ID_STR, $FUNC_ID))
{
echo ' <option value="';
echo $FUNC_ID;
echo '">';
echo $FUNC_NAME;
echo '</option>
';
continue;
}
}
echo ' </select>
<input type="button" value=" 全 选 " onclick="func_select_all1();" class="SmallInput">
</td>
<td align="center" bgcolor="#999999">
<input type="button" class="SmallInput" value=" ← " onclick="func_insert();">
<br><br>
<input type="button" class="SmallInput" value=" → " onclick="func_delete();">
</td>
<td align="center" valign="top" bgcolor="#';
echo 'CCCCCC">
';
echo '<s';
echo 'elect name="select2" ondblclick="func_insert();" MULTIPLE style="width:250;height:280">
';
$query = 'SELECT * from SYS_FUNCTION order by MENU_ID';
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$FUNC_ID = $ROW['FUNC_ID'];
$FUNC_NAME = $ROW['FUNC_NAME'];
$MENU_ID = $ROW['MENU_ID'];
$LEN = strlen ($MENU_ID);
$query_next = ((((''.'SELECT * from SYS_FUNCTION where MENU_ID like \'').$MENU_ID).'%\' and length(MENU_ID)>').$LEN);
$cursor_next = exequery ($connection, $query_next);
if ($ROW = mysql_fetch_array ($cursor_next))
{
continue;
}
else
{
if ((find_id ($USER_FUNC_ID_STR, $FUNC_ID) AND !find_id ($SHORTCUT, $FUNC_ID)))
{
echo ' <option value="';
echo $FUNC_ID;
echo '">';
echo $FUNC_NAME;
echo '</option>
';
continue;
}
continue;
}
}
echo ' </select>
<input type="button" value=" 全 选 " onclick="func_select_all2();" class="SmallInput">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td align="center" valign="top" colspan="4">
点击条目时,可以组合CTRL或SHIFT键进行多选<br>
<input type="button" class="BigButton" value="保 存" onclick="mysubmit();">
<input type="button" class="BigButton" v';
echo 'alue="重 置" onclick="location=\'index.php\'">
</td>
</tr>
</table>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?