📄 index.php
字号:
<?
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_find(select_obj,option_text)
{
pos=option_text.indexOf("] ")+1;
option_text=option_text.substr(0,pos);
for (j=0; j';
echo '<s';
echo 'elect_obj.options.length; j++)
{
str=select_obj.options(j).text;
if(str.indexOf(option_text)>=0)
return j;
}//for
return j;
}
function func_insert()
{
for (i=select2.options.length-1; i>=0; i--)
{
if(select2.options(i).selected)
{
option_text=select2.options(i).text;
option_value=select2.options(i).value;
option_style_color=select2.option';
echo 's(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=func_find(select1,option_text);
select1.add(my_option);
select2.remove(i);
}
}//for
}
function func_delete()
{
for (i=select1.options.length-1; i>=0; i--)
{
i';
echo 'f(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=func_find(select2,option_text);
select2.add(my_option);
select1.remove(i);
}
}//for
}
function func_select_all';
echo '1()
{
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 mysubmit()
{
fld_str="";
for (i=0; i< select1.options.length; i++)
{
options_value=select1.options(i).value;
fld_str+=options_value+",";
}
';
echo ' document.all("STYLE").value=fld_str;
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dial';
echo 'ogLeft:"+myleft+"px");
}
function LoadWindow()
{
URL="/module/dept_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
functio';
echo 'n clear_user2()
{
document.form1.COPY_TO_NAME.value="";
document.form1.COPY_TO_ID.value="";
}
function clear_dept()
{
document.form1.TO_NAME.value="";
document.form1.TO_ID.value="";
}
function LoadWindow2()
{
URL="/module/user_select?ID=2";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
/';
echo '/window.open(URL,"read_notify","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes");
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function exreport()
{
fld_str="";
for (i=0; i< select1.options.length; i';
echo '++)
{
options_value=select1.options(i).value;
fld_str+=options_value+",";
}
for(i=0;i<document.all("DEPTFLAG").length;i++)
{
el=document.all("DEPTFLAG").item(i);
if(el.checked)
{
val=el.value;
}
}
if(document.all("SUMFIELD").item(0).checked)
{
if(val=="1")URL="report.php?COPY_TO_ID="+document.all("COPY_';
echo 'TO_ID").value+"&fld_str="+fld_str+"&FLOW_ID="+document.all("FLOW_ID").value+"&TOID="+document.all("TO_ID").value;
if(val=="0")URL="report.php?fld_str="+fld_str+"&FLOW_ID="+document.all("FLOW_ID").value+"&DEPT_FLAG=1";
}
if(document.all("SUMFIELD").item(1).checked)
{
if(val=="1")URL="excel_report.php?COPY_TO_ID="+document.all("COPY_TO_ID").value+"&fld_str="+fld_str+"&FLOW_ID="';
echo '+document.all("FLOW_ID").value+"&TOID="+document.all("TO_ID").value;
if(val=="0")URL="excel_report.php?fld_str="+fld_str+"&FLOW_ID="+document.all("FLOW_ID").value+"&DEPT_FLAG=1";
}
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.open(URL,"report","height=400,width=550,status=1,toolbar=no,menuba';
echo 'r=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes");
}
function sel_change()
{
for(i=0;i<document.all("DEPTFLAG").length;i++)
{
el=document.all("DEPTFLAG").item(i);
if(el.checked)
{
val=el.value;
}
}
if(val=="1")
{
document.all("SER").style.display="";
}
else
{
document.al';
echo 'l("SER").style.display="none";
}
}
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';
echo '.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(selec';
echo 't1.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.te';
echo 'xt=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;
}
}
</script>
</head>
<body class="bodycolor" topmargin="5" >
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/edit.gif" WIDTH="22" HEIGHT="';
echo '20" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 工资报表</span>
</td>
</tr>
</table>
<div align="center">
<table border="0" cellspacing="1" class="small" bgcolor="#000000" cellpadding="3" align="center" >
<tr>
<td nowrap class="TableContent"> 人员范围: </td>
<td nowrap class="TableData" colspan="3">
<input type="radio" name=\'DEPTFLAG\' value="1" checked onclick="sel_change()">在职人员 <i';
echo 'nput type="radio" name=\'DEPTFLAG\' value="0" onclick="sel_change()">外部人员
</td>
</tr>
<tr id="SER">
<form name="form1">
<td nowrap class="TableContent"> 部门: </td>
<td nowrap class="TableData">
<input type="hidden" name="TO_ID">
<textarea cols=21 name=TO_NAME rows=2 class="BigStatic" wrap="yes" readonly>';
echo $TO_NAME;
echo '</textarea>
<input value="选择" type="button" class="SmallButton" title="选择部门" name="button" onClick="LoadWindow()">
<input type="button" value="清空" class="SmallButton" onClick="clear_dept()" title="清空部门" name="button">
</td>
<td nowrap class="TableContent"> 人员: </td>
<td nowrap class="TableData">
<input type="hidden" name="COPY_TO_ID';
echo '" value="">
<textarea cols=21 name="COPY_TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly></textarea>
<input value="选择" type="button" onClick="LoadWindow2()" class="SmallButton" title="选择人员" name="button">
<input type="button" value="清空" class="SmallButton" onClick="clear_user2()" title="清空人员" name="button">
</td>
</form>
</tr>
<tr>
<td n';
echo 'owrap class="TableContent"> 输出形式: </td>
<td nowrap class="TableData" colspan="3">
<input type="radio" name=\'SUMFIELD\' value="htm" checked>html报表 <input type="radio" name=\'SUMFIELD\' value="excel">EXCEL报表
</td>
</tr>
<tr>
<td nowrap class="TableContent"> 输出内容:</td>
<td nowrap class="TableData" colspan="3" align="left">
<table widt';
echo 'h="150" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="small">
<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" clas';
echo 's="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">
';
$query = ((''.'SELECT STYLE from SAL_FLOW where FLOW_ID=').$FLOW_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$STYLE = $ROW['STYLE'];
}
if (($STYLE != ''))
{
$STYLE_ARRAY = explode (',', $STYLE);
$ARRAY_COUNT = sizeof ($STYLE_ARRAY);
$COUNT = 0;
if (($STYLE_ARRAY[($ARRAY_COUNT - 1)] == ''))
{
--$ARRAY_COUNT;
}
for ($I = 0; ($I < $ARRAY_COUNT); ++$I)
{
$query1 = (((''.'select ITEM_ID,ITEM_NAME from SAL_ITEM where ITEM_ID=\'').$STYLE_ARRAY[$I]).'\'');
$cursor1 = exequery ($connection, $query1);
if ($ROW = mysql_fetch_array ($cursor1))
{
$ITEM_NAME = $ROW['ITEM_NAME'];
$ITEM_ID = $ROW['ITEM_ID'];
}
echo ' <option value="';
echo $ITEM_ID;
echo '">';
echo $ITEM_NAME;
echo '</option>
';
}
}
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:200;height:280">
';
$query = 'SELECT ITEM_ID,ITEM_NAME from SAL_ITEM where ISPRINT=\'1\' ORDER BY `ITEM_ID`';
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$ITEM_ID = $ROW['ITEM_ID'];
$ITEM_NAME = $ROW['ITEM_NAME'];
$sign = 0;
for ($I = 0; ($I < $ARRAY_COUNT); ++$I)
{
if (($STYLE_ARRAY[$I] == $ITEM_ID))
{
$sign = 1;
continue;
}
}
if (($sign == 0))
{
echo ' <option value="';
echo $ITEM_ID;
echo '">';
echo $ITEM_NAME;
echo '</option>
';
continue;
}
}
echo ' </select>
<input type="button" value=" 全 选 " onclick="func_select_all2();" class="SmallInput">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap class="TableControl" colspan="4" align="center">
<input type="hidden" name="FLOW_ID" value="';
echo $FLOW_ID;
echo '">
<input type="hidden" name="STYLE" value="">
<input type="submit" value="确定" class="SmallButton" name="button" onClick="exreport()">
<input type="submit" value="返回" class="SmallButton" name="button" onclick="location=\'../index.php\'">
</td>
</tr>
</table>
</div>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -