Ignore:
Timestamp:
2008/05/13 12:15:47 (18 years ago)
Author:
Yammy
Message:

納品書PDF一括出力
http://svn.ec-cube.net/open_trac/ticket/297
コミット

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/SC_Fpdf.php

    r17182 r17305  
    3333class SC_Fpdf { 
    3434       
    35     function SC_Fpdf($arrData, $tpl_pdf = "template_nouhin01.pdf") { 
    36         $this->arrData = $arrData; 
     35    function SC_Fpdf($download, $title, $tpl_pdf = "template_nouhin01.pdf") { 
    3736        // デフォルトの設定 
    3837        $this->tpl_pdf = PDF_TEMPLATE_DIR . $tpl_pdf;  // テンプレートファイル 
    39         $this->pdf_download = $arrData[download];      // PDFのダウンロード形式(0:表示、1:ダウンロード) 
    40         $this->tpl_title = $arrData['title']; 
     38        $this->pdf_download = $download;      // PDFのダウンロード形式(0:表示、1:ダウンロード) 
     39        $this->tpl_title = $title; 
    4140        $this->tpl_dispmode = "real";      // 表示モード 
    4241        $masterData = new SC_DB_MasterData_Ex(); 
    … …  
    6867        // PDFを読み込んでページ数を取得 
    6968        $pageno = $this->pdf->setSourceFile($this->tpl_pdf); 
     69        #$this->createPdf(); 
     70    } 
     71 
     72    function setData($arrData) { 
     73        $this->arrData = $arrData; 
    7074 
    7175        // ページ番号よりIDを取得 
    … …  
    9296 
    9397        //ロゴ画像 
    94         $this->pdf->Image(PDF_TEMPLATE_DIR . 'logo.png', 124, 46, 60); 
    95  
    96         $this->createPdf(); 
     98        $logo_file = PDF_TEMPLATE_DIR . 'logo.png'; 
     99        $this->pdf->Image($logo_file, 124, 46, 40); 
     100 
    97101    } 
    98102 
    … …  
    111115        $this->lfText(125, 74, $text, 8);  //都道府県+住所1 
    112116        $this->lfText(125, 77, $arrInfo['addr02'], 8);          //住所2 
    113         $text = "TEL: ".$arrInfo['tel01']."-".$arrInfo['tel02']."-".$arrInfo['tel03']." "."FAX: ".$arrInfo['fax01']."-".$arrInfo['fax02']."-".$arrInfo['fax03']; 
     117 
     118        $text = "TEL: ".$arrInfo['tel01']."-".$arrInfo['tel02']."-".$arrInfo['tel03']; 
     119        if (!empty($arrInfo['fax01']) && $arrInfo['fax02'] && $arrInfo['fax03']) { 
     120            $text .= " FAX: ".$arrInfo['fax01']."-".$arrInfo['fax02']."-".$arrInfo['fax03']; 
     121        } 
    114122        $this->lfText(125, 80, $text, 8);  //TEL・FAX 
    115         $text = "Email: ".$arrInfo['law_email']; 
    116         $this->lfText(125, 83, $text, 8);      //Email 
     123 
     124        if (!empty($arrInfo['law_email'])) { 
     125            $text = "Email: ".$arrInfo['law_email']; 
     126            $this->lfText(125, 83, $text, 8);      //Email 
     127        } 
    117128    } 
    118129 
    … …  
    159170        $this->pdf->Cell(0, 45, '', 0, 2, '', 0, ''); 
    160171 
    161         $this->pdf->SetFont('SJIS', '', 9); 
     172        $this->pdf->SetFont('SJIS', '', 8); 
    162173 
    163174        $monetary_unit = $this->sjis_conv("円"); 
    … …  
    270281ob_clean(); 
    271282        if($this->pdf_download == 1) { 
    272           $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
     283          if ($this->pdf->PageNo() == 1) { 
     284            $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
     285          } else { 
     286            $filename = "nouhinsyo.pdf"; 
     287          } 
    273288          $this->pdf->Output($this->sjis_conv($filename), D); 
    274289        } else { 
Note: See TracChangeset for help on using the changeset viewer.