Ignore:
Timestamp:
2010/03/11 10:35:11 (14 years ago)
Author:
kajiwara
Message:

正式版にナイトリービルド版をマージしてみるテスト

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tmp/version-2_5-test/data/class/SC_Fpdf.php

    r18562 r18609  
    2828 */ 
    2929 
    30 require(DATA_PATH . 'module/pdf/japanese.php'); 
    31 define('PDF_IMG_DIR', HTML_PATH. USER_DIR. USER_PACKAGE_DIR. TEMPLATE_NAME. '/img/pdf/'); 
     30require(DATA_PATH . 'pdf/japanese.php'); 
     31define('PDF_TEMPLATE_DIR', DATA_PATH . 'pdf/'); 
    3232 
    3333class SC_Fpdf { 
    3434    function SC_Fpdf($download, $title, $tpl_pdf = "template_nouhin01.pdf") { 
    35         $this->arrData = $arrData; 
    3635        // デフォルトの設定 
    37         $this->tpl_pdf = PDF_DIR . $tpl_pdf;  // テンプレートファイル 
     36        $this->tpl_pdf = PDF_TEMPLATE_DIR . $tpl_pdf;  // テンプレートファイル 
    3837        $this->pdf_download = $download;      // PDFのダウンロード形式(0:表示、1:ダウンロード) 
    3938        $this->tpl_title = $title; 
     
    4948 
    5049        $this->arrMessage = array( 
    51           'このたびはお買上げいただきありがとうございます。', 
    52           '下記の内容にて納品させていただきます。', 
    53           'ご確認いただきますよう、お願いいたします。' 
     50            'このたびはお買上げいただきありがとうございます。', 
     51            '下記の内容にて納品させていただきます。', 
     52            'ご確認いただきますよう、お願いいたします。' 
    5453        ); 
    5554 
     
    6968    } 
    7069 
    71  
    7270    function setData($arrData) { 
    7371        $this->arrData = $arrData; 
     
    8280        $this->pdf->SetDisplayMode($this->tpl_dispmode); 
    8381 
    84         if(SC_Utils_Ex::sfIsInt($arrData['order_id'])) { 
    85           $this->disp_mode = true; 
    86           $order_id = $arrData['order_id']; 
     82        if (SC_Utils_Ex::sfIsInt($arrData['order_id'])) { 
     83            $this->disp_mode = true; 
     84            $order_id = $arrData['order_id']; 
    8785        } 
    8886 
     
    113111 
    114112        $text = "TEL: ".$arrInfo['law_tel01']."-".$arrInfo['law_tel02']."-".$arrInfo['law_tel03']; 
    115         if ( strlen($arrInfo['law_fax01']) > 0 && strlen($arrInfo['law_fax02']) > 0 && strlen($arrInfo['law_fax03']) > 0 ) { 
     113        //FAX番号が存在する場合、表示する 
     114        if (strlen($arrInfo['law_fax01']) > 0) { 
    116115            $text .= " FAX: ".$arrInfo['law_fax01']."-".$arrInfo['law_fax02']."-".$arrInfo['law_fax03']; 
    117116        } 
     
    124123 
    125124        //ロゴ画像 
    126         $logo_file = PDF_IMG_DIR . 'logo.png'; 
     125        $logo_file = PDF_TEMPLATE_DIR . 'logo.png'; 
    127126        $this->pdf->Image($logo_file, 124, 46, 40); 
    128127    } 
     
    138137 
    139138    function setOrderData() { 
    140         // ショップ情報 
    141         $objInfo = new SC_SiteInfo(); 
    142         $arrInfo = $objInfo->data; 
    143139        // DBから受注情報を読み込む 
    144140        $this->lfGetOrderData($this->arrData['order_id']); 
     
    176172 
    177173        $monetary_unit = $this->sjis_conv("円"); 
    178         $point_unit = $this->sjis_conv("pt"); 
     174        $point_unit = $this->sjis_conv("Pt"); 
    179175 
    180176        // 購入商品情報 
    181177        for ($i = 0; $i < count($this->arrDisp['quantity']); $i++) { 
    182178 
    183           // 購入数量 
    184           $data[0] = $this->arrDisp['quantity'][$i]; 
    185  
    186           // 税込金額(単価) 
    187           $data[1] = SC_Utils_Ex::sfPreTax($this->arrDisp['price'][$i], $arrInfo['tax'], $arrInfo['tax_rule']); 
    188  
    189           // 小計(商品毎) 
    190           $data[2] = $data[0] * $data[1]; 
    191  
    192           $arrOrder[$i][0]  = $this->sjis_conv($this->arrDisp['product_name'][$i]." / "); 
    193           $arrOrder[$i][0] .= $this->sjis_conv($this->arrDisp['product_code'][$i]." / "); 
    194           if($this->arrDisp['classcategory_name1'][$i]) { 
    195             $arrOrder[$i][0] .= $this->sjis_conv(" [ ".$this->arrDisp['classcategory_name1'][$i]); 
    196             if($this->arrDisp['classcategory_name2'][$i] == "") { 
    197               $arrOrder[$i][0] .= " ]"; 
    198             } else { 
    199               $arrOrder[$i][0] .= $this->sjis_conv(" * ".$this->arrDisp['classcategory_name2'][$i]." ]"); 
     179            // 購入数量 
     180            $data[0] = $this->arrDisp['quantity'][$i]; 
     181 
     182            // 税込金額(単価) 
     183            $data[1] = SC_Helper_DB_Ex::sfPreTax($this->arrDisp['price'][$i]); 
     184 
     185            // 小計(商品毎) 
     186            $data[2] = $data[0] * $data[1]; 
     187 
     188            $arrOrder[$i][0]  = $this->sjis_conv($this->arrDisp['product_name'][$i]." / "); 
     189            $arrOrder[$i][0] .= $this->sjis_conv($this->arrDisp['product_code'][$i]." / "); 
     190            if ($this->arrDisp['classcategory_name1'][$i]) { 
     191                $arrOrder[$i][0] .= $this->sjis_conv(" [ ".$this->arrDisp['classcategory_name1'][$i]); 
     192                if ($this->arrDisp['classcategory_name2'][$i] == "") { 
     193                    $arrOrder[$i][0] .= " ]"; 
     194                } else { 
     195                    $arrOrder[$i][0] .= $this->sjis_conv(" * ".$this->arrDisp['classcategory_name2'][$i]." ]"); 
     196                } 
    200197            } 
    201           } 
    202           $arrOrder[$i][1]  = number_format($data[0]); 
    203           $arrOrder[$i][2]  = number_format($data[1]).$monetary_unit; 
    204           $arrOrder[$i][3]  = number_format($data[2]).$monetary_unit; 
     198            $arrOrder[$i][1]  = number_format($data[0]); 
     199            $arrOrder[$i][2]  = number_format($data[1]).$monetary_unit; 
     200            $arrOrder[$i][3]  = number_format($data[2]).$monetary_unit; 
    205201 
    206202        } 
     
    241237        $arrOrder[$i][3] = number_format($this->arrDisp['payment_total']).$monetary_unit; 
    242238 
    243         $i++; 
    244         $arrOrder[$i][0] = ""; 
    245         $arrOrder[$i][1] = ""; 
    246         $arrOrder[$i][2] = ""; 
    247         $arrOrder[$i][3] = ""; 
    248  
    249239        // ポイント表記 
    250240        if ($this->arrData['disp_point'] && $this->arrDisp['customer_id']) { 
    251           $i++; 
    252           $arrOrder[$i][0] = ""; 
    253           $arrOrder[$i][1] = ""; 
    254           $arrOrder[$i][2] = $this->sjis_conv("利用ポイント"); 
    255           $arrOrder[$i][3] = number_format($this->arrDisp['use_point']).$point_unit; 
    256  
    257           $i++; 
    258           $arrOrder[$i][0] = ""; 
    259           $arrOrder[$i][1] = ""; 
    260           $arrOrder[$i][2] = $this->sjis_conv("加算ポイント"); 
    261           $arrOrder[$i][3] = number_format($this->arrDisp['add_point']).$point_unit; 
    262  
    263           $i++; 
    264           $arrOrder[$i][0] = ""; 
    265           $arrOrder[$i][1] = ""; 
    266           $arrOrder[$i][2] = $this->sjis_conv("所有ポイント"); 
    267           $arrOrder[$i][3] = number_format($this->arrDisp['point']).$point_unit; 
     241            $i++; 
     242            $arrOrder[$i][0] = ""; 
     243            $arrOrder[$i][1] = ""; 
     244            $arrOrder[$i][2] = ""; 
     245            $arrOrder[$i][3] = ""; 
     246 
     247            $i++; 
     248            $arrOrder[$i][0] = ""; 
     249            $arrOrder[$i][1] = ""; 
     250            $arrOrder[$i][2] = $this->sjis_conv("利用ポイント"); 
     251            $arrOrder[$i][3] = number_format($this->arrDisp['use_point']).$point_unit; 
     252 
     253            $i++; 
     254            $arrOrder[$i][0] = ""; 
     255            $arrOrder[$i][1] = ""; 
     256            $arrOrder[$i][2] = $this->sjis_conv("加算ポイント"); 
     257            $arrOrder[$i][3] = number_format($this->arrDisp['add_point']).$point_unit; 
     258 
     259            $i++; 
     260            $arrOrder[$i][0] = ""; 
     261            $arrOrder[$i][1] = ""; 
     262            $arrOrder[$i][2] = $this->sjis_conv("所有ポイント"); 
     263            $arrOrder[$i][3] = number_format($this->arrDisp['point']).$point_unit; 
    268264        } 
    269265 
     
    282278    function createPdf() { 
    283279        // PDFをブラウザに送信 
    284 ob_clean(); 
    285         if ($this->pdf->PageNo() == 1) { 
    286             $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
    287           } else { 
    288             $filename = "nouhinsyo.pdf"; 
    289           } 
    290           $this->pdf->Output($this->sjis_conv($filename), D); 
     280        ob_clean(); 
     281        if ($this->pdf_download == 1) { 
     282            if ($this->pdf->PageNo() == 1) { 
     283                $filename = "nouhinsyo-No".$this->arrData['order_id'].".pdf"; 
     284            } else { 
     285                $filename = "nouhinsyo.pdf"; 
     286            } 
     287            $this->pdf->Output($this->sjis_conv($filename), D); 
     288        } else { 
     289            $this->pdf->Output(); 
     290        } 
    291291 
    292292        // 入力してPDFファイルを閉じる 
     
    301301        $this->pdf->Text($x, $y, $text); 
    302302    } 
    303  
    304303 
    305304    // 受注データの取得 
     
    310309            $where = "order_id = ?"; 
    311310            $arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id)); 
    312             #$objFormParam->setParam($arrRet[0]); 
    313             list($point, $total_point) = SC_Helper_DB_Ex::sfGetCustomerPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
    314             #$objFormParam->setValue('total_point', $total_point); 
    315             #$objFormParam->setValue('point', $point); 
    316             $arrRet[0]['total_point'] = $total_point; 
    317             $arrRet[0]['point'] = $point; 
    318311            $this->arrDisp = $arrRet[0]; 
     312            list($point) = SC_Helper_DB_Ex::sfGetCustomerPoint($order_id, $arrRet[0]['use_point'], $arrRet[0]['add_point']); 
     313            $this->arrDisp['point'] = $point; 
    319314 
    320315            // 受注詳細データの取得 
     
    338333    // 受注詳細データの取得 
    339334    function lfGetOrderDetail($order_id) { 
    340       $objQuery = new SC_Query(); 
    341       $col = "product_id, classcategory_id1, classcategory_id2, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 
    342       $where = "order_id = ?"; 
    343       $objQuery->setorder("classcategory_id1, classcategory_id2"); 
    344       $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id)); 
    345       return $arrRet; 
     335        $objQuery = new SC_Query(); 
     336        $col = "product_id, classcategory_id1, classcategory_id2, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 
     337        $where = "order_id = ?"; 
     338        $objQuery->setorder("classcategory_id1, classcategory_id2"); 
     339        $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id)); 
     340        return $arrRet; 
    346341    } 
    347342 
    348343    // 文字コードSJIS変換 -> japanese.phpで使用出来る文字コードはSJISのみ 
    349344    function sjis_conv($conv_str) { 
    350       return (mb_convert_encoding($conv_str, "SJIS", CHAR_CODE)); 
    351     } 
    352  
     345        return (mb_convert_encoding($conv_str, "SJIS", CHAR_CODE)); 
     346    } 
    353347 
    354348} 
Note: See TracChangeset for help on using the changeset viewer.