📄 index.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
$PAGE_SIZE=10;
$query = "select * from SALE_MANAGER where MANAGER_ID=1";
$cursor=exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
$MANAGER_ID=$ROW["MANAGER_ID"];
$MANAGERS=$ROW["MANAGERS"];
}
?>
<html>
<head>
<title>产品信息导出</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
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:205px;dialogTop:"+mytop+"px;dialogLeft:"+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");
}
function chk(input,KC,KT,count)
{
var lstr="";
if(count==1)
{
if(document.all(KC).checked)
{
document.all(KT).value=document.all(KC).value;
}
else
{
document.all(KT).value="";
}
}
else
{
for(i=0;i<document.all(KC).length;i++)
{
el=document.all(KC).item(i);
if(el.checked)
{
val=el.value;
lstr+=val+",";
}
}
document.all(KT).value=lstr;
}
}
function 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;
//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:350px;dialogHeight:300px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function LoadWindow3()
{
URL="manager_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
//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:350px;dialogHeight:300px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user3()
{
document.form1.SELL_MANAGE.value="";
document.form1.SELL_MANAGEID.value="";
}
function func_find(select_obj,option_text)
{
pos=option_text.indexOf("] ")+1;
option_text=option_text.substr(0,pos);
for (j=0; j<select_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=document.form1.select2.options.length-1; i>=0; i--)
{
if(document.form1.select2.options(i).selected)
{
option_text=document.form1.select2.options(i).text;
option_value=document.form1.select2.options(i).value;
option_style_color=document.form1.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=func_find(select1,option_text);
document.form1.select1.add(my_option);
document.form1.select2.remove(i);
}
}//for
}
function func_delete()
{
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options(i).selected)
{
option_text=document.form1.select1.options(i).text;
option_value=document.form1.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);
document.form1.select2.add(my_option);
document.form1.select1.remove(i);
}
}//for
}
function func_select_all1()
{
for (i=document.form1.select1.options.length-1; i>=0; i--)
document.form1.select1.options(i).selected=true;
}
function func_select_all2()
{
for (i=document.form1.select2.options.length-1; i>=0; i--)
document.form1.select2.options(i).selected=true;
}
function exreport()
{
fld_str="";
fld_str1="";
if(document.form1.select1.options.length!=0)
{
for (i=0; i< document.form1.select1.options.length; i++)
{
options_value=document.form1.select1.options(i).value;
options_text=document.form1.select1.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
else
{
for (i=0; i< document.form1.select2.options.length; i++)
{
options_value=document.form1.select2.options(i).value;
options_text=document.form1.select2.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
document.form1.FIELDMSG.value=fld_str;
document.form1.FIELDMSGNAME.value=fld_str1;
document.form1.submit();
}
function func_up()
{
sel_count=0;
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options(i).selected)
sel_count++;
}
if(sel_count==0)
{
alert("调整顺序时,请选择其中一项!");
return;
}
else if(sel_count>1)
{
alert("调整顺序时,只能选择其中一项!");
return;
}
i=document.form1.select1.selectedIndex;
if(i!=0)
{
var my_option = document.createElement("OPTION");
my_option.text=document.form1.select1.options(i).text;
my_option.value=document.form1.select1.options(i).value;
document.form1.select1.add(my_option,i-1);
document.form1.select1.remove(i+1);
document.form1.select1.options(i-1).selected=true;
}
}
function func_down()
{
sel_count=0;
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options(i).selected)
sel_count++;
}
if(sel_count==0)
{
alert("调整顺序时,请选择其中一项!");
return;
}
else if(sel_count>1)
{
alert("调整顺序时,只能选择其中一项!");
return;
}
i=document.form1.select1.selectedIndex;
if(i!=document.form1.select1.options.length-1)
{
var my_option = document.createElement("OPTION");
my_option.text=document.form1.select1.options(i).text;
my_option.value=document.form1.select1.options(i).value;
document.form1.select1.add(my_option,i+2);
document.form1.select1.remove(i);
document.form1.select1.options(i+1).selected=true;
}
}
function exreport()
{
fld_str="";
fld_str1="";
if(document.form1.select1.options.length!=0)
{
for (i=0; i< document.form1.select1.options.length; i++)
{
options_value=document.form1.select1.options(i).value;
options_text=document.form1.select1.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
else
{
for (i=0; i< document.form1.select2.options.length; i++)
{
options_value=document.form1.select2.options(i).value;
options_text=document.form1.select2.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
document.form1.FIELDMSG.value=fld_str;
document.form1.FIELDMSGNAME.value=fld_str1;
document.form1.action="excel_report.php";
document.form1.submit();
}
function wordeport()
{
fld_str="";
fld_str1="";
if(document.form1.select1.options.length!=0)
{
for (i=0; i< document.form1.select1.options.length; i++)
{
options_value=document.form1.select1.options(i).value;
options_text=document.form1.select1.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
else
{
for (i=0; i< document.form1.select2.options.length; i++)
{
options_value=document.form1.select2.options(i).value;
options_text=document.form1.select2.options(i).text;
fld_str+=options_value+",";
fld_str1+=options_text+",";
}
}
document.form1.FIELDMSG.value=fld_str;
document.form1.FIELDMSGNAME.value=fld_str1;
document.form1.action="word_report.php";
document.form1.submit();
}
</script>
</head>
<div align="left">
<table cellspacing="1" class="small" align="left" cellpadding="3">
<form method="post" name="form1">
<tr>
<td nowrap class="TableHeader" colspan="8" align="left">
导出范围:
</td>
</tr>
<tr>
<td nowrap class="TableData"> 供应商: </td>
<td nowrap class="TableData">
<input type="text" name="PROVIDER_NAME" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">产品名称: </td>
<td nowrap class="TableData">
<input type="text" name="PRODUCT_NAME" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">产品型号: </td>
<td nowrap class="TableData">
<input type="text" name="PRODUCT_TYPE" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">
</td>
</tr>
<tr>
<td nowrap class="TableData"> 产品类别:</td>
<td nowrap class="TableData">
<select name="PRODUCT_MODE" class="SmallSelect">
<?
GETALLDATE("PRODUCT_MODE");
?>
</select>
</td>
<td nowrap class="TableData">产品描述: </td>
<td nowrap class="TableData" colspan=4>
<textarea cols=37 rows=2 name="PRODUCT_DESC" class="SmallInput" wrap="yes"><?=$MEMO?></textarea>
</td>
</tr>
<tr>
<td nowrap class="TableHeader" colspan="8" align="left">
导出内容:
</td>
</tr>
<tr>
<td nowrap class="TableData" colspan="8" align="center">
<br>
<table width="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" 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">
</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:200;height:280">
<option value="PROVIDER_NAME">供应商</option>
<option value="PRODUCT_NAME">产品名称</option>
<option value="PRODUCT_CODE">产品编码</option>
<option value="PRODUCT_TYPE">产品型号</option>
<option value="PRODUCT_MODE">产品类别</option>
<option value="MEASURE_UNIT">计量单位</option>
<option value="COST_PRICE">成本价</option>
<option value="STANDARD_PRICE">出售价</option>
<option value="PRODUCT_DESC">产品描述</option>
<option value="MEMO">备注1</option>
<option value="MEMO1">备注2</option>
<?
$query = "select * from FIELDSETTING where TABLENAME='PRODUCT' ORDER BY ORDERNO ASC ";
$cursor1=exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor1))
{
?>
<option value="<?=$ROW["FIELDNO"]?>"><?=$ROW["FIELDNAME"]?></option>
<?
}
?>
</select>
<input type="button" value=" 全 选 " onclick="func_select_all2();" class="SmallInput">
</td>
</tr>
</table>
<br>
</td>
</tr>
<tr>
<td nowrap class="TableData" colspan="8" align="center" width="650">
<input value="EXCEL报表" type="button" class="SmallButton" title="EXCEL报表" name="button" onClick="exreport()">
<input value="WORD报表" type="button" class="SmallButton" title="WORD报表" name="button" onClick="wordeport()">
<input value="清空" type="button" class="SmallButton" title="清空" name="button" onclick="location='index.php'">
<input type="hidden" name="FIELDMSG">
<input type="hidden" name="FIELDMSGNAME">
</td>
</tr>
</table>
</div>
</body>
</html>
<?
function GETALLDATE($CODE)
{
global $connection;
$query = "SELECT * from SYS_CODE where PARENT_NO='$CODE'";
$connection=OpenConnection();
$cursor= exequery($connection,$query);
echo "<option value= ".">".""."</option>";
while($ROW=mysql_fetch_array($cursor))
{
$CODE_NO=$ROW["CODE_NO"];
$CODE_NAME=$ROW["CODE_NAME"];
echo "<option value=".$CODE_NO.">".$CODE_NAME."</option>";
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -