/**
  * Page のAction.
  *
  * @return void
  */
 function action()
 {
     $objCustomer = new SC_Customer_Ex();
     $customer_id = $objCustomer->getValue('customer_id');
     $objAddress = new SC_Helper_Address_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     switch ($this->getMode()) {
         // お届け先の削除
         case 'delete':
             if ($objFormParam->checkError()) {
                 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
                 SC_Response_Ex::actionExit();
             }
             $objAddress->delete($objFormParam->getValue('other_deliv_id'));
             break;
             // スマートフォン版のもっと見るボタン用
         // スマートフォン版のもっと見るボタン用
         case 'getList':
             $arrData = $objFormParam->getHashArray();
             //別のお届け先情報
             $arrOtherDeliv = $objAddress->getList($customer_id, ($arrData['pageno'] - 1) * SEARCH_PMAX);
             //県名をセット
             $arrOtherDeliv = $this->setPref($arrOtherDeliv, $this->arrPref);
             $arrOtherDeliv['delivCount'] = count($arrOtherDeliv);
             $this->arrOtherDeliv = $arrOtherDeliv;
             echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv);
             SC_Response_Ex::actionExit();
             break;
             // お届け先の表示
         // お届け先の表示
         default:
             break;
     }
     //別のお届け先情報
     $this->arrOtherDeliv = $objAddress->getList($customer_id);
     //お届け先登録数
     $this->tpl_linemax = count($this->arrOtherDeliv);
     // 1ページあたりの件数
     $this->dispNumber = SEARCH_PMAX;
 }
 /**
  * Page のプロセス.
  *
  * @return void
  */
 function action()
 {
     $objSiteSess = new SC_SiteSession_Ex();
     $objCartSess = new SC_CartSession_Ex();
     $objCustomer = new SC_Customer_Ex();
     $objPurchase = new SC_Helper_Purchase_Ex();
     $objFormParam = new SC_FormParam_Ex();
     $objAddress = new SC_Helper_Address_Ex();
     $this->tpl_uniqid = $objSiteSess->getUniqId();
     $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess);
     $this->cartKey = $objCartSess->getKey();
     // ログインチェック
     if (!$objCustomer->isLoginSuccess(true)) {
         SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
     }
     // ダウンロード商品の場合は、支払方法画面に転送
     if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) {
         $objPurchase->copyFromCustomer($sqlval, $objCustomer, 'shipping');
         $objPurchase->saveShippingTemp($sqlval);
         $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval, $objCustomer);
         $objSiteSess->setRegistFlag();
         SC_Response_Ex::sendRedirect('payment.php');
         SC_Response_Ex::actionExit();
     }
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_POST);
     $objFormParam->convParam();
     $arrErr = $objFormParam->checkError();
     if (!SC_Utils_Ex::isBlank($arrErr)) {
         SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
         SC_Response_Ex::actionExit();
     }
     $arrForm = $objFormParam->getHashArray();
     switch ($this->getMode()) {
         // 削除
         case 'delete':
             $objAddress->delete($arrForm['other_deliv_id']);
             break;
             // 会員登録住所に送る
         // 会員登録住所に送る
         case 'customer_addr':
             $objPurchase->unsetShippingTemp();
             $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check'];
             $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer, $objAddress);
             if (!$success) {
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
             }
             $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id);
             $objSiteSess->setRegistFlag();
             SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH);
             SC_Response_Ex::actionExit();
             break;
             // 前のページに戻る
         // 前のページに戻る
         case 'return':
             // 確認ページへ移動
             SC_Response_Ex::sendRedirect(CART_URLPATH);
             SC_Response_Ex::actionExit();
             break;
             // お届け先複数指定
         // お届け先複数指定
         case 'multiple':
             // 複数配送先指定が無効な場合はエラー
             if (USE_MULTIPLE_SHIPPING === false) {
                 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true);
                 SC_Response_Ex::actionExit();
             }
             SC_Response_Ex::sendRedirect('multiple.php');
             SC_Response_Ex::actionExit();
             break;
         default:
             // 配送IDの取得
             $shippingData = $objPurchase->getShippingTemp();
             $arrShippingId = array_keys($shippingData);
             if (isset($arrShippingId[0])) {
                 $this->arrForm['deliv_check']['value'] = $arrShippingId[0] == 0 ? -1 : $arrShippingId[0];
             }
             break;
     }
     // 登録済み住所を取得
     $addr = array(array('other_deliv_id' => NULL, 'customer_id' => $objCustomer->getValue('customer_id'), 'name01' => $objCustomer->getValue('name01'), 'name02' => $objCustomer->getValue('name02'), 'kana01' => $objCustomer->getValue('kana01'), 'kana02' => $objCustomer->getValue('kana02'), 'zip01' => $objCustomer->getValue('zip01'), 'zip02' => $objCustomer->getValue('zip02'), 'pref' => $objCustomer->getValue('pref'), 'addr01' => $objCustomer->getValue('addr01'), 'addr02' => $objCustomer->getValue('addr02'), 'tel01' => $objCustomer->getValue('tel01'), 'tel02' => $objCustomer->getValue('tel02'), 'tel03' => $objCustomer->getValue('tel03')));
     $this->arrAddr = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id')));
     $this->tpl_addrmax = count($this->arrAddr);
 }