Page
[ class tree: Page ] [ index: Page ] [ all elements ]

Source for file LC_Page_Mypage_HistoryDetail.php

Documentation is available at LC_Page_Mypage_HistoryDetail.php

  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.lockon.co.jp/
  8.  *
  9.  * This program is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU General Public License
  11.  * as published by the Free Software Foundation; either version 2
  12.  * of the License, or (at your option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  22.  */
  23.  
  24. // {{{ requires
  25. require_once(CLASS_PATH "pages/LC_Page.php");
  26.  
  27. /**
  28.  * 受注履歴 のページクラス.
  29.  *
  30.  * @package Page
  31.  * @author LOCKON CO.,LTD.
  32.  * @version $Id: LC_Page_Mypage_HistoryDetail.php 18735 2010-06-22 08:53:31Z nanasess $
  33.  */
  34.  
  35.     // }}}
  36.     // {{{ functions
  37.  
  38.     /**
  39.      * Page を初期化する.
  40.      *
  41.      * @return void 
  42.      */
  43.     function init({
  44.         parent::init();
  45.     }
  46.  
  47.     /**
  48.      * Page のプロセス.
  49.      *
  50.      * @return void 
  51.      */
  52.     function process({
  53.     }
  54.  
  55.     /**
  56.      * モバイルページを初期化する.
  57.      *
  58.      * @return void 
  59.      */
  60.     function mobileInit({
  61.         $this->tpl_mainpage = 'mypage/history_detail.tpl';
  62.         $this->tpl_title = "MYページ/購入履歴詳細";
  63.     }
  64.  
  65.     /**
  66.      * Page のプロセス(モバイル).
  67.      *
  68.      * @return void 
  69.      */
  70.     function mobileProcess({
  71.         $objView new SC_MobileView();
  72.         $objQuery new SC_Query();
  73.         $objCustomer new SC_Customer();
  74.         $objDb new SC_Helper_DB_Ex();
  75.  
  76.  
  77.         //不正アクセス判定
  78.         $from "dtb_order";
  79.         $where "del_flg = 0 AND customer_id = ? AND order_id = ? ";
  80.         $arrval array($objCustomer->getValue('customer_id')$_POST['order_id']);
  81.         //DBに情報があるか判定
  82.         $cnt $objQuery->count($from$where$arrval);
  83.  
  84.         //ログインしていない、またはDBに情報が無い場合
  85.         if (!$objCustomer->isLoginSuccess(trueor $cnt == 0){
  86.             SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR""false""true);
  87.         else {
  88.             //受注詳細データの取得
  89.             $this->arrDisp $this->lfGetOrderData($_POST['order_id']);
  90.             // 支払い方法の取得
  91.             $this->arrPayment $objDb->sfGetIDValueList("dtb_payment""payment_id""payment_method");
  92.             // お届け時間の取得
  93.             $arrRet $objDb->sfGetDelivTime($this->arrDisp['payment_id']);
  94.             $this->arrDelivTime SC_Utils_Ex::sfArrKeyValue($arrRet'time_id''deliv_time');
  95.  
  96.             //マイページトップ顧客情報表示用
  97.             $this->CustomerName1 $objCustomer->getvalue('name01');
  98.             $this->CustomerName2 $objCustomer->getvalue('name02');
  99.             $this->CustomerPoint $objCustomer->getvalue('point');
  100.         }
  101.  
  102.         $objView->assignobj($this);
  103.         $objView->display(SITE_FRAME);
  104.     }
  105.  
  106.     /**
  107.      * デストラクタ.
  108.      *
  109.      * @return void 
  110.      */
  111.     function destroy({
  112.         parent::destroy();
  113.     }
  114.  
  115.  
  116.     //受注詳細データの取得
  117.     function lfGetOrderData($order_id{
  118.         //注文番号が数字であれば
  119.         if(SC_Utils_Ex::sfIsInt($order_id)) {
  120.             // DBから受注情報を読み込む
  121.             $objQuery new SC_Query();
  122.             $col "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, ";
  123.             $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, ";
  124.             $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date ";
  125.             $from "dtb_order";
  126.             $where "order_id = ?";
  127.             $arrRet $objQuery->select($col$from$wherearray($order_id));
  128.             $arrOrder $arrRet[0];
  129.             // 受注詳細データの取得
  130.             $arrRet $this->lfGetOrderDetail($order_id);
  131.             $arrOrderDetail SC_Utils_Ex::sfSwapArray($arrRet);
  132.             $arrData array_merge($arrOrder$arrOrderDetail);
  133.         }
  134.         return $arrData;
  135.     }
  136.  
  137.     // 受注詳細データの取得
  138.     function lfGetOrderDetail($order_id{
  139.         $objQuery new SC_Query();
  140.         $col "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate";
  141.         $where "order_id = ?";
  142.         $objQuery->setOrder("classcategory_id1, classcategory_id2");
  143.         $arrRet $objQuery->select($col"dtb_order_detail"$wherearray($order_id));
  144.         return $arrRet;
  145.     }
  146. }
  147. ?>

Documentation generated on Fri, 24 Feb 2012 13:59:37 +0900 by Seasoft