Problems with exporting PDFs
This post was last edited by Zhuhao on 2012-12-31 19:54:16
$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 ' Shi Pments ' =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= "〒". $rs [' Ship-postal-code '];
$ship _city= "Japan". $rs [' ship-state ']. " ". $rs [' ship-city '];
$recipient _name= $rs [' Recipient-name ']. "Like";
$buyer _phone_number= "Tel:" $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, $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);