Contents of this section:
A class for exporting documents in php
Example:
/**
* Class for generating word documents
*
*/
class word
{
function start()
{
ob_start();
echo ' xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR /REC-html40">';
}
function save($path)
{ > ob_end_clean(); > $fp=fopen($fn,"wb"); /Exported program files
//Export---start---
require SITE_ROOT.'include/word.class.php'; //Class files are placed in the include folder in the root directory
$word = new word();
//Fill the query data into word
$result = $db->query("SELECT * FROM ".DB_PRE."box where status='9' order by boxid DESC");
while($r = $db->fetch_array($result))
{
$r['orderinfo'] = $db->get_one("SELECT * FROM ".DB_PRE."order where orderid='".$r['orderid']."'");
$r['wrapinfo'] = $db->get_one("SELECT * FROM ". DB_PRE."wrap where orderid='".$r['orderid']."'");
$boxlist[] = $r;
}
foreach($boxlist as $key=>$val){
$order->UPCAbarcode($val['box_code']);
$html .='
iGo运 单号 | '.$val['box_code'].' | 日期 | '.date('Y-m-d',$val[create_date]).' | 标示 姓名 | '.$val[code].'/'.$val['orderid'].' '.$val['orderinfo']['user_name'].' |
件数 | 3 | 重量 | 56.5 | 品名 | 咬咬了,吸盘碗,学饮杯,鱼干油 |
服务 类别 | 库房服务 | 服务 要求 | 合小箱 | ||
客户 备注 | '.$val['orderinfo']['beizhu'].' | ||||
到货 情况 | 什么问题?果点不到 什么问题?果点不到 什么问题?果点不到 |