Changeset 21925
- Timestamp:
- 2012/06/19 16:15:24 (12 years ago)
- Location:
- branches/version-2_12-dev/data/class
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_CartSession.php
r21920 r21925 51 51 } 52 52 // 1世代古いコピー情報は、削除しておく 53 foreach ( $_SESSION as $k => $val) {53 foreach (array_keys($_SESSION) as $k) { 54 54 if ($k != $this->key_tmp && preg_match('/^savecart_/', $k)) { 55 55 unset($this->cartSession[$productTypeId][$k]); … … 87 87 // 一時カートのクリア 88 88 unset($_SESSION[$this->key_tmp]); 89 $this->cartSession[$productTypeId][ $key]['cancel_purchase'] = true;89 $this->cartSession[$productTypeId]['cancel_purchase'] = true; 90 90 } else { 91 91 $this->cartSession[$productTypeId]['cancel_purchase'] = false; … … 96 96 // 次に割り当てるカートのIDを取得する 97 97 function getNextCartID($productTypeId) { 98 foreach ($this->cartSession[$productTypeId] as $key => $val) { 99 $arrRet[] = $this->cartSession[$productTypeId][$key]['cart_no']; 100 } 101 return max($arrRet) + 1; 98 $count = array(); 99 foreach (array_keys($this->cartSession[$productTypeId]) as $key) { 100 $count[] = $this->cartSession[$productTypeId][$key]['cart_no']; 101 } 102 return max($count) + 1; 102 103 } 103 104 … … 143 144 $max = 0; 144 145 if (count($this->cartSession[$productTypeId]) > 0) { 145 foreach ( $this->cartSession[$productTypeId] as $key => $val) {146 foreach (array_keys($this->cartSession[$productTypeId]) as $key) { 146 147 if (is_numeric($key)) { 147 148 if ($max < $key) { … … 393 394 function getAllProductID($productTypeId) { 394 395 $max = $this->getMax($productTypeId); 396 $productIDs = array(); 395 397 for ($i = 0; $i <= $max; $i++) { 396 398 if ($this->cartSession[$productTypeId][$i]['cart_no'] != '') { 397 $ arrRet[] = $this->cartSession[$productTypeId][$i]['id'][0];398 } 399 } 400 return $ arrRet;399 $productIDs[] = $this->cartSession[$productTypeId][$i]['id'][0]; 400 } 401 } 402 return $productIDs; 401 403 } 402 404 … … 409 411 function getAllProductClassID($productTypeId) { 410 412 $max = $this->getMax($productTypeId); 413 $productClassIDs = array(); 411 414 for ($i = 0; $i <= $max; $i++) { 412 415 if ($this->cartSession[$productTypeId][$i]['cart_no'] != '') { 413 $ arrRet[] = $this->cartSession[$productTypeId][$i]['id'];414 } 415 } 416 return $ arrRet;416 $productClassIDs[] = $this->cartSession[$productTypeId][$i]['id']; 417 } 418 } 419 return $productClassIDs; 417 420 } 418 421 … … 497 500 */ 498 501 function getProductClassId($cart_no, $productTypeId) { 499 for ($i = 0; $i < = $max; $i++) {502 for ($i = 0; $i < count($this->cartSession[$productTypeId]); $i++) { 500 503 if ($this->cartSession[$productTypeId][$i]['cart_no'] == $cart_no) { 501 504 return $this->cartSession[$productTypeId][$i]['id']; … … 625 628 ) { 626 629 630 $results = array(); 627 631 $total_point = $this->getAllProductsPoint($productTypeId); 628 632 $results['tax'] = $this->getAllProductsTax($productTypeId); -
branches/version-2_12-dev/data/class/SC_CheckError.php
r21920 r21925 59 59 $this->createParam($value); 60 60 // HTMLに含まれているタグを抽出する 61 preg_match_all('/<\/?([a-z]+)/i', $this->arrParam[$value[1]], $arrTagIncludedHtml );61 preg_match_all('/<\/?([a-z]+)/i', $this->arrParam[$value[1]], $arrTagIncludedHtml = array()); 62 62 63 63 $arrDiffTag = array_diff($arrTagIncludedHtml[1], $value[2]); … … 630 630 $quoted_string = "\"$qcontent*\""; 631 631 $atext = '[a-zA-Z0-9!#$%&\'*+\-\/\=?^_`{|}~]'; 632 $dot_atom_text = "$atext+(?:[.]$atext+)*"; 633 $dot_atom = $dot_atom_text; 632 $dot_atom = "$atext+(?:[.]$atext+)*"; 634 633 $local_part = "(?:$dot_atom|$quoted_string)"; 635 634 $domain = $dot_atom; 636 $addr_spec = " ${local_part}[@]$domain";635 $addr_spec = "{$local_part}[@]$domain"; 637 636 638 637 $dot_atom_loose = "$atext+(?:[.]|$atext)*"; 639 638 $local_part_loose = "(?:$dot_atom_loose|$quoted_string)"; 640 $addr_spec_loose = " ${local_part_loose}[@]$domain";639 $addr_spec_loose = "{$local_part_loose}[@]$domain"; 641 640 642 641 if (RFC_COMPLIANT_EMAIL_CHECK) { 643 $regexp = "/\A ${addr_spec}\z/";642 $regexp = "/\A{$addr_spec}\z/"; 644 643 } else { 645 644 // 携帯メールアドレス用に、..や.@を許容する。 646 $regexp = "/\A ${addr_spec_loose}\z/";645 $regexp = "/\A{$addr_spec_loose}\z/"; 647 646 } 648 647 … … 932 931 } 933 932 $this->createParam($value); 934 $error = 0;935 933 if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 936 934 $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; … … 983 981 } 984 982 $this->createParam($value); 985 $error = 0;986 983 if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 987 984 $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; … … 1027 1024 } 1028 1025 $this->createParam($value); 1029 $error = 0;1030 1026 if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]])) { 1031 1027 $this->arrErr[$value[2]] = '※ ' . $value[0] . 'を正しく指定してください。<br />'; … … 1123 1119 1124 1120 $pattern = '/' . join('|', $prohibitedStr) . '/i'; 1125 if (preg_match_all($pattern, $t his->arrParam[$value[1]], $matches)) {1121 if (preg_match_all($pattern, $targetStr, $matches = array())) { 1126 1122 $this->arrErr[$value[1]] = '※ ' . $value[0] . 'は入力できません。<br />'; 1127 1123 } -
branches/version-2_12-dev/data/class/SC_CustomerList.php
r21867 r21925 31 31 function __construct($array, $mode = '') { 32 32 parent::__construct($array); 33 34 $masterData = new SC_DB_MasterData_Ex();35 33 36 34 $objDb = new SC_Helper_DB_Ex(); -
branches/version-2_12-dev/data/class/SC_Date.php
r21867 r21925 146 146 function getHour() { 147 147 148 $ day_array = array();148 $hour_array = array(); 149 149 for ($i=0; $i<=23; $i++) { 150 150 $hour_array[$i] = $i; -
branches/version-2_12-dev/data/class/SC_Display.php
r21867 r21925 142 142 $nu = new Net_UserAgent_Mobile(); 143 143 $su = new SC_SmartphoneUserAgent_Ex(); 144 $retDevice = 0;145 144 if ($nu->isMobile()) { 146 145 return DEVICE_TYPE_MOBILE; -
branches/version-2_12-dev/data/class/SC_FormParam.php
r21921 r21925 336 336 function getHashArray($arrKey = array()) { 337 337 $arrRet = array(); 338 foreach ($this->keyname as $ index => $keyname) {338 foreach ($this->keyname as $keyname) { 339 339 if (empty($arrKey) || in_array($keyname, $arrKey)) { 340 340 $arrRet[$keyname] = $this->getValue($keyname); … … 346 346 // DB格納用配列の作成 347 347 function getDbArray() { 348 $dbArray = array(); 348 349 foreach ($this->keyname as $index => $key) { 349 350 if ($this->input_db[$index]) { 350 $ arrRet[$key] = $this->getValue($key);351 } 352 } 353 return $ arrRet;351 $dbArray[$key] = $this->getValue($key); 352 } 353 } 354 return $dbArray; 354 355 } 355 356 … … 378 379 // フォームに渡す用のパラメーターを返す 379 380 function getFormParamList() { 381 $formParamList = array(); 380 382 foreach ($this->keyname as $index => $key) { 381 383 // キー名 382 $ arrRet[$key]['keyname'] = $key;384 $formParamList[$key]['keyname'] = $key; 383 385 // 表示名 384 $ arrRet[$key]['disp_name'] = $this->disp_name[$index];386 $formParamList[$key]['disp_name'] = $this->disp_name[$index]; 385 387 // 文字数制限 386 $ arrRet[$key]['length'] = $this->length[$index];388 $formParamList[$key]['length'] = $this->length[$index]; 387 389 // 入力値 388 $ arrRet[$key]['value'] = $this->getValue($key);389 } 390 return $ arrRet;390 $formParamList[$key]['value'] = $this->getValue($key); 391 } 392 return $formParamList; 391 393 } 392 394 … … 403 405 function getValue($keyname, $default = '') { 404 406 $ret = null; 405 foreach ($this->keyname as $ index => $key) {407 foreach ($this->keyname as $key) { 406 408 if ($key == $keyname) { 407 409 $ret = isset($this->arrValue[$key]) ? $this->arrValue[$key] : $this->arrDefault[$key]; … … 482 484 function getSearchArray($prefix = 'search_') { 483 485 $arrResults = array(); 484 foreach ($this->keyname as $ index => $key) {486 foreach ($this->keyname as $key) { 485 487 if (preg_match('/^' . $prefix . '/', $key)) { 486 488 $arrResults[$key] = $this->getValue($key); … … 497 499 */ 498 500 function getFormDispArray() { 501 $formDispArray = array(); 499 502 foreach ($this->keyname as $index => $key) { 500 503 // キー名 501 $ arrRet[$index]['keyname'] = $key;504 $formDispArray[$index]['keyname'] = $key; 502 505 // 表示名 503 $ arrRet[$index]['disp_name'] = $this->disp_name[$index];506 $formDispArray[$index]['disp_name'] = $this->disp_name[$index]; 504 507 // 文字数制限 505 $ arrRet[$index]['length'] = $this->length[$index];508 $formDispArray[$index]['length'] = $this->length[$index]; 506 509 // 入力値 507 $ arrRet[$index]['value'] = $this->getValue($key);508 } 509 return $ arrRet;510 $formDispArray[$index]['value'] = $this->getValue($key); 511 } 512 return $formDispArray; 510 513 } 511 514 … … 521 524 // $this->paramに歯抜けが存在する場合は、NULLで埋めておく。 522 525 // 最後に配列を詰める際に、全ての項目が埋まっている必要がある。 523 foreach ( $this->keyname as $key => $val) {526 foreach (array_keys($this->keyname) as $key) { 524 527 if (!isset($this->param[$key])) { 525 528 $this->param[$key] = NULL;
Note: See TracChangeset
for help on using the changeset viewer.