📄 query.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<script Language="JavaScript">
var parent_window = parent.dialogArguments;
<?
if($ID==1)
{
$TO_ID="SECRET_TO_ID";
$TO_NAME="SECRET_TO_NAME";
}
else if($ID==2)
{
$TO_ID="COPY_TO_ID";
$TO_NAME="COPY_TO_NAME";
}
else if($ID==3)
{
$TO_ID="TO_ID3";
$TO_NAME="TO_NAME3";
}
else
{
$TO_ID="TO_ID";
$TO_NAME="TO_NAME";
}
?>
function click_user(user_id)
{
TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
targetelement=document.all(user_id);
user_name=targetelement.name;
if(TO_VAL.indexOf(","+user_id+",")>0 || TO_VAL.indexOf(user_id+",")==0)
{
if(TO_VAL.indexOf(user_id+",")==0)
{
parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(user_id+",","");
parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(user_name+",","");
borderize_off(targetelement);
}
if(TO_VAL.indexOf(","+user_id+",")>0)
{
parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(","+user_id+",",",");
parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(","+user_name+",",",");
borderize_off(targetelement);
}
}
else
{
parent_window.form1.<?=$TO_ID?>.value+=user_id+",";
parent_window.form1.<?=$TO_NAME?>.value+=user_name+",";
borderize_on(targetelement);
}
}
function borderize_on(targetelement)
{
color="#003FBF";
targetelement.style.borderColor="black";
targetelement.style.backgroundColor=color;
targetelement.style.color="white";
targetelement.style.fontWeight="bold";
}
function borderize_off(targetelement)
{
targetelement.style.backgroundColor="";
targetelement.style.borderColor="";
targetelement.style.color="";
targetelement.style.fontWeight="";
}
function begin_set()
{
TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
for (step_i=0; step_i<document.all.length; step_i++)
{
if(document.all(step_i).className=="menulines")
{
user_id=document.all(step_i).id;
if(TO_VAL.indexOf(","+user_id+",")>0 || TO_VAL.indexOf(user_id+",")==0)
borderize_on(document.all(step_i));
}
}
}
function add_all()
{
TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
for (step_i=0; step_i<document.all.length; step_i++)
{
if(document.all(step_i).className=="menulines")
{
user_id=document.all(step_i).id;
user_name=document.all(step_i).name;
if(TO_VAL.indexOf(","+user_id+",")<0 && TO_VAL.indexOf(user_id+",")!=0)
{
parent_window.form1.<?=$TO_ID?>.value+=user_id+",";
parent_window.form1.<?=$TO_NAME?>.value+=user_name+",";
borderize_on(document.all(step_i));
}
}
}
}
function del_all()
{
for (step_i=0; step_i<document.all.length; step_i++)
{
TO_VAL=parent_window.form1.<?=$TO_ID?>.value;
if(document.all(step_i).className=="menulines")
{
user_id=document.all(step_i).id;
user_name=document.all(step_i).name;
if(TO_VAL.indexOf(user_id+",")==0)
{
parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(user_id+",","");
parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(user_name+",","");
borderize_off(document.all(step_i));
}
if(TO_VAL.indexOf(","+user_id+",")>0)
{
parent_window.form1.<?=$TO_ID?>.value=parent_window.form1.<?=$TO_ID?>.value.replace(","+user_id+",",",");
parent_window.form1.<?=$TO_NAME?>.value=parent_window.form1.<?=$TO_NAME?>.value.replace(","+user_name+",",",");
borderize_off(document.all(step_i));
}
}
}
}
</script>
</script>
<body class="panel" topmargin="5" leftmargin="2" onload="document.form1.USER_NAME.focus();">
<center>
<form action="query.php" name="form1">
<label class="small">姓名:</label><input type="text" name="USER_NAME" size="6" class="SmallInput" value="<?=$USER_NAME?>"> <input type="submit" name="Submit" value="查询" class="SmallButton">
<input type="hidden" name="ID" value="<?=$ID?>">
</form>
</center>
<?
if($USER_NAME=="")
exit;
?>
<table border="1" cellspacing="0" width="100%" class="small" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<?
$query = "SELECT * from USER where USER_NAME like '%$USER_NAME%' and DEPT_ID!=0 and NOT_LOGIN!='1' order by USER_NO,USER_NAME";
$cursor= exequery($connection,$query);
$USER_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$USER_COUNT++;
$USER_ID=$ROW["USER_ID"];
$USER_NAME=$ROW["USER_NAME"];
if($USER_COUNT==1)
{
?>
<tr class="TableContent">
<td onclick="javascript:add_all();" style="cursor:hand" align="center">全部添加</td>
</tr>
<tr class="TableContent">
<td onclick="javascript:del_all();" style="cursor:hand" align="center">全部删除</td>
</tr>
<?
}
?>
<tr class="TableControl">
<td class="menulines" id="<?=$USER_ID?>" name="<?=$USER_NAME?>" align="center" onclick="javascript:click_user('<?=$USER_ID?>')" style="cursor:hand">
<?=$USER_NAME?>
</td>
</tr>
<?
}
if($USER_COUNT==0)
{
?>
<tr class="TableControl">
<td align="center">未查询到用户</td>
</tr>
<?
}
?>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -