21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
/*
* 文件创建时间 2010-8-26
*
* 创建人:森林
* 联系方式:QQ 83202700 Email:83202700@qq.com
*/
if(!$_COOKIE[username]) exit("请登陆后导出数据");
header("Content-type:appliction/vnd.ms-excel");
header("content-disposition:filename=CW-YCL".date("Ymdhis").".xls");
include("data/conn.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<body>
<TABLE cellSpacing=0 cellPadding=0 width="1000px" border=1>
<tr><td colspan=8><font size=5><b><center>EXCEL导出</center></b></font></td> </tr>
<tr><td colspan=8><center>半成品入库记录</center></td> </tr>
<tr><td colspan=8>制表日期:<?php echo date("Y-m-d")?>
</td></tr>
<tr>
<td>工令号</td>
<td>单据编号</td>
<td>料号</td>
<td>品名</td>
<td>数量</td>
<td>类型</td>
<td>日期</td>
<td>仓管操作员</td>
</tr>
</tr>
<?php
$sqllld=mysql_query("SELECT * FROM `tyt_ckbcp_1` where dt>='$_POST[dtks]' && dt<='$_POST[dtjs]' order by id");
while($rowslld=mysql_fetch_array($sqllld)){
?>
<tr>
<td style="vnd.ms-excel.numberformat:@"><?php echo $rowslld[gldh]?></td>
<td><?php echo $rowslld[bianhao]?></td>
<td><?php echo $rowslld[liaohao]?></td>
<td><?php echo $rowslld[pingm]?></td>
<td><?php echo $rowslld[sl]?></td>
<td><?php echo $rowslld[bz]?></td>
<td><?php echo $rowslld[dt]?></td>
<td><?php echo $rowslld[username]?></td>
</tr>
<?php
}
?>
</table>
本报表最终由:<?php echo $_COOKIE[username]?> 导出
</body>
</head>
</html>