Changeset 18469 for branches/version-2_4-dev/data/class
- Timestamp:
- 2010/01/07 12:02:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_4-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_Inquiry.php
r17845 r18469 113 113 } 114 114 115 for( $i = 0; $i < count( $_POST["question"] ); $i++ ) { 116 if( $_POST["question"][$i]["kind"] == 3 || $_POST["question"][$i]["kind"] == 4 ) { 117 $temp_data = array(); 118 // 項目間(テキストボックス)があいていたら詰めていく 119 for( $j = 0; $j < count( $_POST["question"][$i]["option"] ); $j++ ) { 120 if( strlen( $_POST["question"][$i]["option"][$j] ) > 0 ) $temp_data[] = mb_convert_kana( trim ( $_POST["question"][$i]["option"][$j] ), "asKVn" ); 121 } 122 $_POST["question"][$i]["option"] = $temp_data; 123 } else { 124 $_POST["question"][$i]["option"] = NULL; 125 } 126 } 127 115 128 $error = $this->lfErrCheck(); 116 129 … … 150 163 //エラー表示 151 164 $this->ERROR = $error; 165 var_dump($this->ERROR); 152 166 $this->QUESTION_ID = $_REQUEST['question_id']; 153 167 $this->ERROR_COLOR = $this->lfGetErrColor($error, ERR_COLOR); … … 294 308 if( $_POST["question"][$i]["kind"] == 3 || $_POST["question"][$i]["kind"] == 4 ) { 295 309 296 $temp_data = array();297 310 for( $j = 0; $j < count( $_POST["question"][$i]["option"] ); $j++ ) { 298 299 // 項目間(テキストボックス)があいていたら詰めていく 300 if( strlen( $_POST["question"][$i]["option"][$j] ) > 0 ) $temp_data[] = mb_convert_kana( trim ( $_POST["question"][$i]["option"][$j] ), "asKVn" ); 301 302 } 303 304 $_POST["question"][$i]["option"] = $temp_data; 311 // 同じ回答がないかチェック 312 if (strlen($_POST["question"][$i]["option"][$j]) > 0) { 313 $checkArray = $_POST["question"][$i]["option"]; 314 // 自身の値をunset 315 unset($checkArray[$j]); 316 if (in_array($_POST["question"][$i]["option"][$j], $checkArray)) { 317 $objErr->arrErr["question"][$i]["option"][$j] = "同じ質問に同じ回答は設定出来ません。"; 318 } 319 } 320 } 305 321 306 322 if( ( strlen( $_POST["question"][$i] ["option"][0] ) == 0 ) || ( strlen( $_POST["question"][$i] ["option"][0] ) > 0 307 323 && strlen( $_POST["question"][$i] ["option"][1] ) == 0 ) ) $objErr->arrErr["question"][$i]['kind'] = "下記の2つ以上の項目に記入してください。"; 324 308 325 } 309 326 }
Note: See TracChangeset
for help on using the changeset viewer.
