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

📄 index.php

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

<html>
<head>
<title>菜单快捷组</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script>
function func_insert()
{
 for (i=0; i<select2.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;

     pos=select2.options.length;
     select1.add(my_option,pos);
     select2.remove(i);
     i--;
  }
 }//for
}

function func_delete()
{
 for (i=0;i<select1.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--;
  }
 }//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_count++;
  }

  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=select1.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;
  }
  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.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;
?>

<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"><span 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>备选菜单项</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">
    <select  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))
          {
?>
       <option value="<?=$FUNC_ID?>"><?=$FUNC_NAME?></option>

<?
          }
        }
?>
    </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="#CCCCCC">
    <select  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;

          if(find_id($USER_FUNC_ID_STR,$FUNC_ID) && !find_id($SHORTCUT,$FUNC_ID))
          {
?>
       <option value="<?=$FUNC_ID?>"><?=$FUNC_NAME?></option>
<?
          }
        }
?>
    </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();">&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="button" class="BigButton" value="重 置" onclick="location='index.php'">
    </td>
  </tr>

</table>

</body>
</html>

⌨️ 快捷键说明

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