Ignore:
Timestamp:
2009/05/15 16:30:40 (15 years ago)
Author:
kajiwara
Message:

2.4.0 正式版のコミット。コミット内容の詳細はこちら(http://svn.ec-cube.net/open_trac/query?status=closed&milestone=EC-CUBE2.4.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/class/SC_Fpdf.php

    r17724 r18007  
    1 <?php 
     1<?php 
    22/* 
    33 * This file is part of EC-CUBE 
     
    3333 
    3434class SC_Fpdf { 
    35     function SC_Fpdf($arrData, $tpl_pdf = "template_nouhin01.pdf") { 
     35    function SC_Fpdf($download, $title, $tpl_pdf = "template_nouhin01.pdf") { 
    3636        $this->arrData = $arrData; 
    3737        // デフォルトの設定 
    3838        $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; 
    4141        $this->tpl_dispmode = "real";      // 表示モード 
    4242        $masterData = new SC_DB_MasterData_Ex(); 
     
    6868        // PDFを読み込んでページ数を取得 
    6969        $pageno = $this->pdf->setSourceFile($this->tpl_pdf); 
     70    } 
     71 
     72 
     73    function setData($arrData) { 
     74        $this->arrData = $arrData; 
    7075 
    7176        // ページ番号よりIDを取得 
     
    9297 
    9398        //ロゴ画像 
    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 
    97102    } 
    98103 
    99104    function setShopData() { 
    100105        // ショップ情報 
    101         $objInfo = new SC_SiteInfo(); 
     106 
     107        $objInfo = new SC_SiteInfo(); 
    102108        $arrInfo = $objInfo->data; 
    103109 
     
    110116        $this->lfText(125, 74, $text, 8);  //都道府県+住所1 
    111117        $this->lfText(125, 77, $arrInfo['law_addr02'], 8);          //住所2 
     118 
    112119        $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        } 
    118123        $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        } 
    121129    } 
    122130 
     
    131139 
    132140    function setOrderData() { 
    133         $objInfo = new SC_SiteInfo();  
    134         $arrInfo = $objInfo->data;  
     141        // ショップ情報 
     142        $objInfo = new SC_SiteInfo(); 
     143        $arrInfo = $objInfo->data; 
    135144        // DBから受注情報を読み込む 
    136145        $this->lfGetOrderData($this->arrData['order_id']); 
     
    165174        $this->pdf->Cell(0, 45, '', 0, 2, '', 0, ''); 
    166175 
    167         $this->pdf->SetFont('SJIS', '', 9); 
     176        $this->pdf->SetFont('SJIS', '', 8); 
    168177 
    169178        $monetary_unit = $this->sjis_conv("円"); 
     
    275284        // PDFをブラウザに送信 
    276285ob_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          } 
    279291          $this->pdf->Output($this->sjis_conv($filename), D); 
    280         } else { 
    281           $this->pdf->Output(); 
    282         } 
    283292 
    284293        // 入力してPDFファイルを閉じる 
Note: See TracChangeset for help on using the changeset viewer.