- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/class/pages/mypage/LC_Page_Mypage_History.php
r18562 r18609 45 45 parent::init(); 46 46 $this->tpl_mainpage = TEMPLATE_DIR . 'mypage/history.tpl'; 47 $this->tpl_title = "MYページ/購入履歴詳細"; 47 $this->tpl_title = 'MYページ'; 48 $this->tpl_subtitle = '購入履歴詳細'; 48 49 $this->tpl_navi = TEMPLATE_DIR . 'mypage/navi.tpl'; 49 50 $this->tpl_column_num = 1; 50 51 $this->tpl_mainno = 'mypage'; 51 52 $this->tpl_mypageno = 'index'; 52 $this->allowClientCache(); 53 } 53 $this->httpCacheControl('nocache'); 54 $masterData = new SC_DB_MasterData_Ex(); 55 $this->arrMAILTEMPLATE = $masterData->getMasterData("mtb_mail_template"); 56 $this->arrPref = $masterData->getMasterData("mtb_pref", array("pref_id", "pref_name", "rank")); 57 } 54 58 55 59 /** … … 68 72 $objLayout->sfGetPageLayout($this, false, "mypage/index.php"); 69 73 74 // FIXME 他の画面と同様のバリデーションを行なう 75 if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { 76 SC_Utils_Ex::sfDispException(); 77 } 78 79 $orderId = $_GET['order_id']; 80 70 81 //不正アクセス判定 71 82 $from = "dtb_order"; 72 83 $where = "del_flg = 0 AND customer_id = ? AND order_id = ? "; 73 $arrval = array($objCustomer->getValue('customer_id'), $ _POST['order_id']);84 $arrval = array($objCustomer->getValue('customer_id'), $orderId); 74 85 //DBに情報があるか判定 75 86 $cnt = $objQuery->count($from, $where, $arrval); … … 77 88 if (!$objCustomer->isLoginSuccess() || $cnt == 0){ 78 89 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 79 } else { 80 //受注詳細データの取得 81 $this->arrDisp = $this->lfGetOrderData($_POST['order_id']); 82 // 支払い方法の取得 83 $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); 84 // お届け時間の取得 85 $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']); 86 $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time'); 87 88 //マイページトップ顧客情報表示用 89 $this->CustomerName1 = $objCustomer->getvalue('name01'); 90 $this->CustomerName2 = $objCustomer->getvalue('name02'); 91 $this->CustomerPoint = $objCustomer->getvalue('point'); 92 } 93 94 $masterData = new SC_DB_MasterData_Ex(); 95 $this->arrPref = $masterData->getMasterData("mtb_pref", 96 array("pref_id", "pref_name", "rank")); 90 } 91 92 //受注詳細データの取得 93 $this->arrDisp = $this->lfGetOrderData($orderId); 94 // 支払い方法の取得 95 $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); 96 // お届け時間の取得 97 $arrRet = $objDb->sfGetDelivTime($this->arrDisp['payment_id']); 98 $this->arrDelivTime = SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time'); 99 100 //マイページトップ顧客情報表示用 101 $this->CustomerName1 = $objCustomer->getvalue('name01'); 102 $this->CustomerName2 = $objCustomer->getvalue('name02'); 103 $this->CustomerPoint = $objCustomer->getvalue('point'); 104 105 // 受注商品明細の取得 106 $this->tpl_arrOrderDetail = $this->lfGetOrderDetail($orderId); 107 108 // 受注メール送信履歴の取得 109 $this->tpl_arrMailHistory = $this->lfGetMailHistory($orderId); 110 97 111 $objView->assignobj($this); 98 112 $objView->display(SITE_FRAME); … … 116 130 $this->tpl_mainpage = MOBILE_TEMPLATE_DIR . 'mypage/history.tpl'; 117 131 $this->tpl_title = 'MYページ/購入履歴一覧'; 118 $this-> allowClientCache();132 $this->httpCacheControl('nocache'); 119 133 } 120 134 … … 134 148 // ログインチェック 135 149 if(!isset($_SESSION['customer'])) { 136 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR , "", false, "", true);150 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 137 151 } 138 152 … … 182 196 } 183 197 184 //受注詳細データの取得 185 function lfGetOrderData($order_id) { 186 //注文番号が数字であれば 187 if(SC_Utils_Ex::sfIsInt($order_id)) { 188 // DBから受注情報を読み込む 189 $objQuery = new SC_Query(); 190 $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, "; 191 $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, "; 192 $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date "; 193 $from = "dtb_order"; 194 $where = "order_id = ?"; 195 $arrRet = $objQuery->select($col, $from, $where, array($order_id)); 196 $arrOrder = $arrRet[0]; 197 // 受注詳細データの取得 198 $arrRet = $this->lfGetOrderDetail($order_id); 199 $arrOrderDetail = SC_Utils_Ex::sfSwapArray($arrRet); 200 $arrData = array_merge($arrOrder, $arrOrderDetail); 201 } 202 return $arrData; 203 } 204 205 // 受注詳細データの取得 206 function lfGetOrderDetail($order_id) { 198 /** 199 * 受注の取得 200 * 201 * @param integer $orderId 注文番号 202 * @return array 受注の内容 203 */ 204 function lfGetOrderData($orderId) { 205 // DBから受注情報を読み込む 206 $objQuery = new SC_Query(); 207 $col = "order_id, create_date, payment_id, subtotal, tax, use_point, add_point, discount, "; 208 $col .= "deliv_fee, charge, payment_total, deliv_name01, deliv_name02, deliv_kana01, deliv_kana02, "; 209 $col .= "deliv_zip01, deliv_zip02, deliv_pref, deliv_addr01, deliv_addr02, deliv_tel01, deliv_tel02, deliv_tel03, deliv_time_id, deliv_date "; 210 $from = "dtb_order"; 211 $where = "order_id = ?"; 212 $arrRet = $objQuery->select($col, $from, $where, array($orderId)); 213 return $arrRet[0]; 214 } 215 216 /** 217 * 受注商品明細の取得 218 * 219 * @param integer $orderId 注文番号 220 * @return array 受注商品明細の内容 221 */ 222 function lfGetOrderDetail($orderId) { 207 223 $objQuery = new SC_Query(); 208 224 $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 225 $col .= ",CASE WHEN EXISTS(SELECT * FROM dtb_products WHERE product_id = dtb_order_detail.product_id AND del_flg = 0 AND status = 1) THEN '1' ELSE '0' END AS enable"; 209 226 $where = "order_id = ?"; 210 227 $objQuery->setorder("classcategory_id1, classcategory_id2"); 211 $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order _id));228 $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($orderId)); 212 229 return $arrRet; 230 } 231 232 /** 233 * 受注メール送信履歴の取得 234 * 235 * @param integer $orderId 注文番号 236 * @return array 受注メール送信履歴の内容 237 */ 238 function lfGetMailHistory($orderId) { 239 $objQuery = new SC_Query(); 240 $col = 'send_date, subject, template_id, send_id'; 241 $where = 'order_id = ?'; 242 $objQuery->setorder('send_date DESC'); 243 $this->arrMailHistory = $objQuery->select($col, 'dtb_mail_history', $where, array($orderId)); 213 244 } 214 245 }
Note: See TracChangeset
for help on using the changeset viewer.