Changeset 18561 for branches/version-2/data/class/pages/admin/contents/LC_Page_Admin_Contents_Inquiry.php
- Timestamp:
- 2010/02/12 18:13:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/pages/admin/contents/LC_Page_Admin_Contents_Inquiry.php
r17846 r18561 110 110 for ( $j=0; $j<count( $_POST['question'][$i]['option'] ); $j++ ){ 111 111 $_POST['question'][$i]['option'][$j] = mb_convert_kana( trim ( $_POST['question'][$i]['option'][$j] ) ); 112 } 113 } 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; 112 125 } 113 126 } … … 294 307 if( $_POST["question"][$i]["kind"] == 3 || $_POST["question"][$i]["kind"] == 4 ) { 295 308 296 $temp_data = array();297 309 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; 310 // 同じ回答がないかチェック 311 if (strlen($_POST["question"][$i]["option"][$j]) > 0) { 312 $checkArray = $_POST["question"][$i]["option"]; 313 // 自身の値をunset 314 unset($checkArray[$j]); 315 if (in_array($_POST["question"][$i]["option"][$j], $checkArray)) { 316 $objErr->arrErr["question"][$i]["option"][$j] = "同じ質問に同じ回答は設定出来ません。"; 317 } 318 } 319 } 305 320 306 321 if( ( strlen( $_POST["question"][$i] ["option"][0] ) == 0 ) || ( strlen( $_POST["question"][$i] ["option"][0] ) > 0 307 322 && strlen( $_POST["question"][$i] ["option"][1] ) == 0 ) ) $objErr->arrErr["question"][$i]['kind'] = "下記の2つ以上の項目に記入してください。"; 323 308 324 } 309 325 }
Note: See TracChangeset
for help on using the changeset viewer.