- Timestamp:
- 2009/02/04 13:29:30 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php
r17700 r17758 91 91 //別のお届け先DB登録用カラム配列 92 92 $arrRegistColumn = array( 93 array( "column" => "name01", "convert" => "aKV"),94 array( "column" => "name02", "convert" => "aKV"),95 array( "column" => "kana01", "convert" => "CKV"),96 array( "column" => "kana02", "convert" => "CKV"),97 array( "column" => "zip01", "convert" => "n"),98 array( "column" => "zip02", "convert" => "n"),99 array( "column" => "pref", "convert" => "n"),100 array( "column" => "addr01", "convert" => "aKV"),101 array( "column" => "addr02", "convert" => "aKV"),102 array( "column" => "tel01", "convert" => "n"),103 array( "column" => "tel02", "convert" => "n"),104 array( "column" => "tel03", "convert" => "n"),93 array("column" => "name01", "convert" => "aKV"), 94 array("column" => "name02", "convert" => "aKV"), 95 array("column" => "kana01", "convert" => "CKV"), 96 array("column" => "kana02", "convert" => "CKV"), 97 array("column" => "zip01", "convert" => "n"), 98 array("column" => "zip02", "convert" => "n"), 99 array("column" => "pref", "convert" => "n"), 100 array("column" => "addr01", "convert" => "aKV"), 101 array("column" => "addr02", "convert" => "aKV"), 102 array("column" => "tel01", "convert" => "n"), 103 array("column" => "tel02", "convert" => "n"), 104 array("column" => "tel03", "convert" => "n"), 105 105 ); 106 106 … … 121 121 } 122 122 } else { 123 //別のお届け先登録数の取得 124 $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id'))); 125 if ($deliv_count < DELIV_ADDR_MAX or isset($_POST['other_deliv_id'])){ 126 if(strlen($_POST['other_deliv_id'] != 0)){ 127 $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id'])); 128 if ($deliv_count == 0) { 129 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 130 }else{ 131 $this->lfRegistData($_POST,$arrRegistColumn, $objCustomer); 132 } 133 }else{ 134 $this->lfRegistData($_POST,$arrRegistColumn, $objCustomer); 135 } 123 124 if ($_POST['ParentPage'] == MYPAGE_DELIVADDR_URL || $_POST['ParentPage'] == URL_DELIV_TOP) { 125 $this->tpl_onload = "fnUpdateParent('". $this->getLocation($_POST['ParentPage']) ."'); window.close();"; 126 } else { 127 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR . 'E1'); 136 128 } 137 if( $_POST['ParentPage'] == MYPAGE_DELIVADDR_URL || $_POST['ParentPage'] == URL_DELIV_TOP ){ 138 $this->tpl_onload = "fnUpdateParent('". $this->getLocation($_POST['ParentPage']) ."'); window.close();"; 139 }else{ 140 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); 141 } 129 130 $this->lfRegistData($_POST, $arrRegistColumn, $objCustomer); 142 131 } 143 132 break; … … 169 158 $objErr->doFunc(array("郵便番号", "zip01", "zip02"), array("ALL_EXIST_CHECK")); 170 159 $objErr->doFunc(array("都道府県", 'pref'), array("SELECT_CHECK","NUM_CHECK")); 171 $objErr->doFunc(array(" ご住所(1)", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));172 $objErr->doFunc(array(" ご住所(2)", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK"));173 $objErr->doFunc(array(" お電話番号1", 'tel01'), array("EXIST_CHECK","NUM_CHECK"));174 $objErr->doFunc(array(" お電話番号2", 'tel02'), array("EXIST_CHECK","NUM_CHECK"));175 $objErr->doFunc(array(" お電話番号3", 'tel03'), array("EXIST_CHECK","NUM_CHECK"));176 $objErr->doFunc(array(" お電話番号", "tel01", "tel02", "tel03", TEL_LEN) ,array("TEL_CHECK"));160 $objErr->doFunc(array("住所(1)", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK")); 161 $objErr->doFunc(array("住所(2)", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","MAX_LENGTH_CHECK")); 162 $objErr->doFunc(array("電話番号1", 'tel01'), array("EXIST_CHECK","NUM_CHECK")); 163 $objErr->doFunc(array("電話番号2", 'tel02'), array("EXIST_CHECK","NUM_CHECK")); 164 $objErr->doFunc(array("電話番号3", 'tel03'), array("EXIST_CHECK","NUM_CHECK")); 165 $objErr->doFunc(array("電話番号", "tel01", "tel02", "tel03", TEL_LEN) ,array("TEL_CHECK")); 177 166 return $objErr->arrErr; 178 167 … … 182 171 function lfRegistData($array, $arrRegistColumn, &$objCustomer) { 183 172 $objConn = new SC_DBConn(); 173 $objQuery = new SC_Query(); 184 174 foreach ($arrRegistColumn as $data) { 185 175 if (strlen($array[ $data["column"] ]) > 0) { … … 190 180 $arrRegist['customer_id'] = $objCustomer->getvalue('customer_id'); 191 181 192 //-- 編集登録実行 193 $objConn->query("BEGIN"); 194 if ($array['other_deliv_id'] != ""){ 182 // 追加 183 if (strlen($_POST['other_deliv_id'] == 0)) { 184 // 別のお届け先登録数の取得 185 $deliv_count = $objQuery->count("dtb_other_deliv", "customer_id=?", array($objCustomer->getValue('customer_id'))); 186 // 別のお届け先最大登録数に達している場合、エラー 187 if ($deliv_count >= DELIV_ADDR_MAX) { 188 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", false, '別のお届け先最大登録数に達しています。'); 189 } 190 191 // 実行 192 $objConn->autoExecute("dtb_other_deliv", $arrRegist); 193 194 // 変更 195 } else { 196 $deliv_count = $objQuery->count("dtb_other_deliv","customer_id=? and other_deliv_id = ?" ,array($objCustomer->getValue('customer_id'), $_POST['other_deliv_id'])); 197 if ($deliv_count != 1) { 198 SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", false, '一致する別のお届け先がありません。'); 199 } 200 201 // 実行 195 202 $objConn->autoExecute("dtb_other_deliv", $arrRegist, 196 203 "other_deliv_id = " 197 204 . SC_Utils_Ex::sfQuoteSmart($array["other_deliv_id"])); 198 }else{ 199 $objConn->autoExecute("dtb_other_deliv", $arrRegist); 200 } 201 $objConn->query("COMMIT"); 205 } 202 206 } 203 207 … … 205 209 function lfConvertParam($array, $arrRegistColumn) { 206 210 /* 207 * 208 * 209 * 210 * 211 * 211 * 文字列の変換 212 * K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換 213 * C : 「全角ひら仮名」を「全角かた仮名」に変換 214 * V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します 215 * n : 「全角」数字を「半角(ハンカク)」に変換 212 216 * a : 全角英数字を半角英数字に変換する 213 217 */
Note: See TracChangeset
for help on using the changeset viewer.