Changeset 18007 for branches/version-2/data/class/SC_Fpdf.php
- Timestamp:
- 2009/05/15 16:30:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/SC_Fpdf.php
r17724 r18007 1 <?php1 <?php 2 2 /* 3 3 * This file is part of EC-CUBE … … 33 33 34 34 class SC_Fpdf { 35 function SC_Fpdf($ arrData, $tpl_pdf = "template_nouhin01.pdf") {35 function SC_Fpdf($download, $title, $tpl_pdf = "template_nouhin01.pdf") { 36 36 $this->arrData = $arrData; 37 37 // デフォルトの設定 38 38 $this->tpl_pdf = PDF_TEMPLATE_DIR . $tpl_pdf; // テンプレートファイル 39 $this->pdf_download = $ arrData[download]; // PDFのダウンロード形式(0:表示、1:ダウンロード)40 $this->tpl_title = $ arrData['title'];39 $this->pdf_download = $download; // PDFのダウンロード形式(0:表示、1:ダウンロード) 40 $this->tpl_title = $title; 41 41 $this->tpl_dispmode = "real"; // 表示モード 42 42 $masterData = new SC_DB_MasterData_Ex(); … … 68 68 // PDFを読み込んでページ数を取得 69 69 $pageno = $this->pdf->setSourceFile($this->tpl_pdf); 70 } 71 72 73 function setData($arrData) { 74 $this->arrData = $arrData; 70 75 71 76 // ページ番号よりIDを取得 … … 92 97 93 98 //ロゴ画像 94 $ this->pdf->Image(PDF_IMG_DIR. 'logo.png', 124, 46, 60);95 96 $this->createPdf(); 99 $logo_file = PDF_TEMPLATE_DIR . 'logo.png'; 100 $this->pdf->Image($logo_file, 124, 46, 40); 101 97 102 } 98 103 99 104 function setShopData() { 100 105 // ショップ情報 101 $objInfo = new SC_SiteInfo(); 106 107 $objInfo = new SC_SiteInfo(); 102 108 $arrInfo = $objInfo->data; 103 109 … … 110 116 $this->lfText(125, 74, $text, 8); //都道府県+住所1 111 117 $this->lfText(125, 77, $arrInfo['law_addr02'], 8); //住所2 118 112 119 $text = "TEL: ".$arrInfo['law_tel01']."-".$arrInfo['law_tel02']."-".$arrInfo['law_tel03']; 113 //FAX番号が存在しない場合は表示していない 114 //." "."FAX: ".$arrInfo['law_fax01']."-".$arrInfo['law_fax02']."-".$arrInfo['law_fax03'] 115 if(strlen($arrInfo['law_fax01']) > 0){ 116 $text .= " "."FAX: ".$arrInfo['law_fax01']."-".$arrInfo['law_fax02']."-".$arrInfo['law_fax03']; 117 } 120 if ( strlen($arrInfo['law_fax01']) > 0 && strlen($arrInfo['law_fax02']) > 0 && strlen($arrInfo['law_fax03']) > 0 ) { 121 $text .= " FAX: ".$arrInfo['law_fax01']."-".$arrInfo['law_fax02']."-".$arrInfo['law_fax03']; 122 } 118 123 $this->lfText(125, 80, $text, 8); //TEL・FAX 119 $text = "Email: ".$arrInfo['law_email']; 120 $this->lfText(125, 83, $text, 8); //Email 124 125 if ( strlen($arrInfo['law_email']) > 0 ) { 126 $text = "Email: ".$arrInfo['law_email']; 127 $this->lfText(125, 83, $text, 8); //Email 128 } 121 129 } 122 130 … … 131 139 132 140 function setOrderData() { 133 $objInfo = new SC_SiteInfo(); 134 $arrInfo = $objInfo->data; 141 // ショップ情報 142 $objInfo = new SC_SiteInfo(); 143 $arrInfo = $objInfo->data; 135 144 // DBから受注情報を読み込む 136 145 $this->lfGetOrderData($this->arrData['order_id']); … … 165 174 $this->pdf->Cell(0, 45, '', 0, 2, '', 0, ''); 166 175 167 $this->pdf->SetFont('SJIS', '', 9);176 $this->pdf->SetFont('SJIS', '', 8); 168 177 169 178 $monetary_unit = $this->sjis_conv("円"); … … 275 284 // PDFをブラウザに送信 276 285 ob_clean(); 277 if($this->pdf_download == 1) { 278 $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 286 if ($this->pdf->PageNo() == 1) { 287 $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 288 } else { 289 $filename = "nouhinsyo.pdf"; 290 } 279 291 $this->pdf->Output($this->sjis_conv($filename), D); 280 } else {281 $this->pdf->Output();282 }283 292 284 293 // 入力してPDFファイルを閉じる
Note: See TracChangeset
for help on using the changeset viewer.