Changeset 19862 for branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php
- Timestamp:
- 2011/01/11 01:06:14 (13 years ago)
- bzr:base-revision:
- nanasess@fsm.ne.jp-20110110075706-tq0uswsfrsetr0rq
- bzr:committer:
- Kentaro Ohkouchi <nanasess@fsm.ne.jp>
- bzr:file-ids:
data/Smarty/templates/default/shopping/multiple.tpl multiple.tpl-20110109122547-u3fq5xmi1b4jn5n4-1
data/class/helper/SC_Helper_Purchase.php sc_helper_purchase.p-20101020100530-jyaoa7ch9pdfjqzp-1
data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php 16093@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fmypage%2FLC_Page_Mypage_DeliveryAddr.php
data/class/pages/shopping/LC_Page_Shopping_Deliv.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Deliv.php
data/class/pages/shopping/LC_Page_Shopping_Multiple.php lc_page_shopping_mul-20110109122547-u3fq5xmi1b4jn5n4-2
data/mtb_constants_init.php 16505@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fmtb_constants_init.php
html/install/sql/insert_data.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Finsert_data.sql- bzr:mapping-version:
- v4
- bzr:merge:
nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- nanasess@fsm.ne.jp-20110110160608-f5e40kzi21icyxjp
- bzr:revno:
- 2591
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:text-revisions:
data/Smarty/templates/default/shopping/multiple.tpl nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
data/class/helper/SC_Helper_Purchase.php nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
data/class/pages/shopping/LC_Page_Shopping_Deliv.php nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
data/class/pages/shopping/LC_Page_Shopping_Multiple.php nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
data/mtb_constants_init.php nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz
html/install/sql/insert_data.sql nanasess@fsm.ne.jp-20110110160316-nohmzw2i9u84chmz- bzr:timestamp:
- 2011-01-11 01:06:08.532999992 +0900
- bzr:user-agent:
- bzr2.2.2+bzr-svn1.0.4
- svn:original-date:
- 2011-01-10T16:06:08.533000Z
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php
r19860 r19862 68 68 $objSiteSess = new SC_SiteSession(); 69 69 $objCartSess = new SC_CartSession(); 70 $this->objCustomer = new SC_Customer(); 71 72 $this->addrs = $this->getDelivAddrs(); 73 $this->cartKey = $_SESSION['cartKey']; 74 $cartLists =& $objCartSess->getCartList($this->cartKey); 70 $objPurchase = new SC_Helper_Purchase_Ex(); 71 $objCustomer = new SC_Customer(); 72 $objQuery = SC_Query::getSingletonInstance(); 73 $this->objFormParam = new SC_FormParam(); 74 75 $this->addrs = $this->getDelivAddrs($objCustomer); 76 $this->items = $this->splitItems($objCartSess); 77 78 $this->lfInitParam($this->items); 79 $this->objFormParam->setParam($_POST); 80 81 $uniqid = $objSiteSess->getUniqId(); 82 $objPurchase->verifyChangeCart($uniqid, $objCartSess); 83 84 $this->tpl_uniqid = $uniqid; 85 86 $this->cartKey = $objCartSess->getKey(); 87 if ($_SERVER["REQUEST_METHOD"] == "POST") { 88 if (!SC_Helper_Session_Ex::isValidToken()) { 89 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, "", true); 90 } 91 } 92 93 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 94 95 switch ($_POST['mode']) { 96 case 'delete': 97 // TODO 98 break; 99 100 case 'confirm': 101 $this->arrErr = $this->lfCheckError($this->objFormParam); 102 if (SC_Utils_Ex::isBlank($this->arrErr)) { 103 // TODO リファクタリング 104 $params = $this->objFormParam->getHashArray(); 105 $i = 0; 106 while ($params['cart_no' . $i] != null) { 107 $other_deliv_id = $params['shipping' . $i]; 108 if ($other_deliv_id != 0) { 109 $otherDeliv = $objQuery->select("*", "dtb_other_deliv", 110 "other_deliv_id = ?", 111 array($other_deliv_id)); 112 foreach ($otherDeliv[0] as $key => $val) { 113 $sqlval[$other_deliv_id]['shipping_' . $key] = $val; 114 } 115 } else { 116 $objPurchase->copyFromCustomer($sqlval[0], $objCustomer, 117 "shipping"); 118 } 119 $sqlval[$other_deliv_id]['deliv_id'] = $objPurchase->getDeliv($this->cartKey); 120 $sqlval[$other_deliv_id]['shipment_item'][$params['product_class_id' . $i]]['shipping_id'] = $other_deliv_id; 121 $sqlval[$other_deliv_id]['shipment_item'][$params['product_class_id' . $i]]['quantity'] += $params['quantity' . $i]; 122 $sqlval[$other_deliv_id]['shipment_item'][$params['product_class_id' . $i]]['product_class_id'] = $params['product_class_id' . $i]; 123 $i++; 124 } 125 126 foreach ($sqlval as $key => $val) { 127 $objPurchase->saveShippingTemp($val, $key); 128 } 129 130 // FIXME 131 $objPurchase->saveOrderTemp($uniqid, $sqlval[0], $objCustomer); 132 $objSiteSess->setRegistFlag(); 133 SC_Response_Ex::sendRedirect("payment.php"); 134 exit; 135 } 136 break; 137 138 default: 139 } 140 141 $this->arrForm = $this->objFormParam->getFormParamList(); 142 $this->transactionid = SC_Helper_Session_Ex::getToken(); 143 } 144 145 /** 146 * デストラクタ. 147 * 148 * @return void 149 */ 150 function destroy() { 151 parent::destroy(); 152 } 153 154 /** 155 * フォームを初期化する. 156 */ 157 function lfInitParam($items) { 158 for ($i = 0; $i < count($items); $i++) { 159 $this->objFormParam->addParam("商品規格ID", "product_class_id" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 160 $this->objFormParam->addParam("数量", "quantity" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"), 1); 161 $this->objFormParam->addParam("配送先住所", "shipping" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 162 $this->objFormParam->addParam("カート番号", "cart_no" . $i, INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 163 } 164 } 165 166 167 /** 168 * カートの商品を数量ごとに分割する 169 */ 170 function splitItems(&$objCartSess) { 171 $cartLists =& $objCartSess->getCartList($objCartSess->getKey()); 75 172 foreach (array_keys($cartLists) as $key) { 76 173 for ($i = 0; $i < $cartLists[$key]['quantity']; $i++) { 77 $ this->items[] =& $cartLists[$key]['productsClass'];174 $items[] =& $cartLists[$key]['productsClass']; 78 175 } 79 176 } 80 81 } 82 83 /** 84 * デストラクタ. 85 * 86 * @return void 87 */ 88 function destroy() { 89 parent::destroy(); 177 return $items; 90 178 } 91 179 … … 96 184 * 非会員の場合は, 「お届け先の指定」画面で入力した住所を取得する. 97 185 */ 98 function getDelivAddrs( ) {99 if ($ this->objCustomer->isLoginSuccess()) {100 $addrs = $ this->objCustomer->getCustomerAddress($_SESSION['customer']['customer_id']);186 function getDelivAddrs(&$objCustomer) { 187 if ($objCustomer->isLoginSuccess()) { 188 $addrs = $objCustomer->getCustomerAddress($_SESSION['customer']['customer_id']); 101 189 } else { 102 190 // TODO … … 111 199 return $results; 112 200 } 201 202 function lfCheckError(&$objFormParam) { 203 $objFormParam->convParam(); 204 return $objFormParam->checkError(); 205 } 113 206 } 114 207 ?>
Note: See TracChangeset
for help on using the changeset viewer.