Output PDF question this post was last edited by zhuhao from 2012-12-3119: 54: 16 & lt ;? PHP $ id = $ _ GET ['Number']; $ uploaddir & nbsp ;=& nbsp; 'download/'; $ Date & nbsp ;=& nbsp output PDF
This post was last edited by zhuhao at 19:54:16 on
$ Id = $ _ GET ['Number'];
$ Uploaddir = 'download /';
$ Date = date ("YmdHis ");
$ Filenamepdf = $ uploaddir. "Label_print". $ Date. ". pdf ";
Require_once ('tcpdf/config/lang/eng. php ');
Require_once ('tcpdf/tcpdf. php ');
Include ("conn. php ");
$ Pdf = new TCPDF ('L', 'mm', 'Business _ CARD_JP ', true, 'utf-8', false );
$ Pdf-> setPrintHeader (false );
$ Pdf-> setPrintFooter (false );
$ Pdf-> SetFont ('arialunicid0', '', 10 );
$ Pdf-> SetMargins (1, 1, 2, false );
$ Pdf-> setFooterMargin (1 );
$ Pdf-> SetAutoPageBreak (true, 1 );
$ SQL _hkpdf = "SELECT *, group_concat ('', concat_ws ('X', 'sku ', 'quantity-purchased'), if ('quantity-purchased'> 1, '*****', ''), group_concat ('', 'Order _ id ','') FROM (select * from 'sale _ orders 'Order by 'sku ') t where 'shippinges' = 0 AND 'number' = $ id group by 'recipient-name ', 'ship-address-1 'Order BY length (group_concat ('', concat_ws ('X', 'sku ', 'quantity-purchased'),'') DESC, 'sku '";
$ Result = mysql_query ($ SQL _hkpdf );
While ($ rs = mysql_fetch_array ($ Result )){
$ Ship_address = $ rs ['ship-address-1 ']. $ rs ['ship-address-2']. $ rs ['ship-address-3 '];
$ Sku = $ rs ["group_concat ('', concat_ws ('X', 'sku ', 'quantity-purchased'), if ('quantity-purchased'> 1, '*****', '')"];
$ Ship_postal_code = "courier". $ rs ['ship-postal-Code'];
$ Ship_city = "Japan". $ rs ['ship-state']. "". $ rs ['ship-City'];
$ Recipient_name = $ rs ['recipient-name']. "like ";
$ Buyer_phone_number = "telephone:". $ rs ['buyer-phone-number'];
// $ Hkdizhi = 'from: Unit A1, 7/F, Cheung Kong Factory Bldg, 6 Cheung Yee Street, Lai Chi Kok, Hong Kong ';
$ Pdf-> AddPage ();
$ Pdf-> SetFont ('arialunicid0', '', 8 );
$ Pdf-> Write (0, $ sku, '', 0, 'R', true, 0, false, false, 0 );
$ Yy = $ pdf-> GetY ();
$ Xx = $ pdf-> GetX ();
$ Style = array ('width' => 0.2, 'cap' => 'butt', 'join' => 'miter', 'dash '=> 0, 'color' => array (0, 0, 0 ));
$ Pdf-> Line (2, $ yy + 0.3, 89, $ yy + 0.3, $ style );
$ Pdf-> SetFont ('arialunicid0', '', 10 );
$ Pdf-> Write (0, $ ship_postal_code, '', 0, 'L', true, 0, false, false, 0 );
$ Pdf-> Write (0, "\ n", '', 0, 'L', true, 0, false, false, 0 );
$ Pdf-> Write (0, $ ship_city, '', 0, 'L', true, 0, false, false, 0 );
$ Pdf-> Write (0, $ ship_address, '', 0, 'L', true, 0, false, false, 0 );
$ Pdf-> Write (0, "\ n", '', 0, 'L', true, 0, false, false, 0 );
$ Pdf-> SetFont ('arialunicid0', '', 12 );
$ Pdf-> Write (0, $ recipient_name, '', 0, 'C', true, 0, false, false, 0 );
$ Pdf-> SetFont ('arialunicid0', '', 10 );
$ Pdf-> Write (0, $ buyer_phone_number, '', 0, 'C', true, 0, false, false, 0 );