Changeset 20237
- Timestamp:
- 2011/02/20 06:29:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/admin/customer/LC_Page_Admin_Customer_Edit.php
r20232 r20237 92 92 if ($_SERVER["REQUEST_METHOD"] == "POST") { 93 93 if (!SC_Helper_Session_Ex::isValidToken()) { 94 // SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); 95 echo "不正アクセス"; 94 SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); 96 95 exit; 97 96 } … … 107 106 // モードによる処理切り替え 108 107 switch ($this->getMode()) { 109 case 'edit':110 108 case 'edit_search': 111 109 //検索引き継ぎ用パラメーター処理 … … 120 118 $this->arrForm = SC_Helper_Customer::sfGetCustomerData($objFormSearchParam->getValue("edit_customer_id"), true); 121 119 //購入履歴情報の取得 122 // $this->arrPurchaseHistory = $this->lfPurchaseHistory($objFormSearchParam->getValue("edit_customer_id")); 120 list($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($objFormSearchParam->getValue("edit_customer_id")); 121 $this->arrPagenavi = $this->objNavi->arrPagenavi; 122 $this->arrPagenavi['mode'] = 'return'; 123 $this->tpl_pageno = '0'; 123 124 break; 124 125 case 'confirm': … … 158 159 } 159 160 //購入履歴情報の取得 160 // $this->arrPurchaseHistory = $this->lfPurchaseHistory($objFormParam->getValue("customer_id")); 161 list($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($objFormParam->getValue("customer_id"), $objFormParam->getValue("search_pageno")); 162 $this->arrPagenavi = $this->objNavi->arrPagenavi; 163 $this->arrPagenavi['mode'] = 'return'; 164 $this->tpl_pageno = $objFormParam->getValue("search_pageno"); 165 161 166 break; 162 167 case 'complete': … … 205 210 // 検索結果一覧画面への戻り用パラメーター 206 211 $objFormParam->addParam("検索用データ", "search_data", "", "", array(), "", false); 212 // 顧客購入履歴ページング用 213 $objFormParam->addParam("", "search_pageno", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"), "", false); 207 214 } 208 215 … … 295 302 } 296 303 297 //購入履歴情報の取得 298 function lfPurchaseHistory($customer_id){ 299 $objQuery =& SC_Query::getSingletonInstance(); 300 $this->tpl_pageno = $_POST['search_pageno']; 301 $this->edit_customer_id = $customer_id; 302 303 // ページ送りの処理 304 /** 305 * 購入履歴情報の取得 306 * 307 * @param array $arrParam 検索パラメーター連想配列 308 * @return array( integer 全体件数, mixed 顧客データ一覧配列, mixed SC_PageNaviオブジェクト) 309 */ 310 function lfPurchaseHistory($customer_id, $pageno = 0){ 311 if(SC_Utils_Ex::isBlank($customer_id)) { 312 return array('0', array(), NULL); 313 } 314 $objQuery =& SC_Query::getSingletonInstance(); 304 315 $page_max = SEARCH_PMAX; 316 $table = "dtb_order"; 317 $where = "customer_id = ? AND del_flg <> 1"; 318 $arrVal = array($customer_id); 305 319 //購入履歴の件数取得 306 $this->tpl_linemax = $objQuery->count("dtb_order","customer_id=? AND del_flg = 0 ", array($customer_id)); 307 $linemax = $this->tpl_linemax; 308 320 $linemax = $objQuery->count($table, $where, $arrVal); 309 321 // ページ送りの取得 310 $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage2", NAVI_PMAX); 311 $this->arrPagenavi = $objNavi->arrPagenavi; 312 $this->arrPagenavi['mode'] = 'edit'; 313 $startno = $objNavi->start_row; 314 322 $objNavi = new SC_PageNavi($pageno, $linemax, $page_max, "fnNaviSearchPage2", NAVI_PMAX); 315 323 // 取得範囲の指定(開始行番号、行数のセット) 316 $ this->objQuery->setLimitOffset($page_max, $startno);324 $objQuery->setLimitOffset($page_max, $objNavi->start_row); 317 325 // 表示順序 318 326 $order = "order_id DESC"; 319 $ this->objQuery->setOrder($order);327 $objQuery->setOrder($order); 320 328 //購入履歴情報の取得 321 $arrPurchaseHistory = $this->objQuery->select("*", "dtb_order", "customer_id=? AND del_flg = 0 ", array($customer_id)); 322 323 return $arrPurchaseHistory; 324 } 325 329 $arrPurchaseHistory = $objQuery->select("*", $table, $where, $arrVal); 330 331 return array($linemax, $arrPurchaseHistory, $objNavi); 332 } 326 333 } 327 334 ?>
Note: See TracChangeset
for help on using the changeset viewer.