Changeset 18469 for branches/version-2_4-dev
- Timestamp:
- 2010/01/07 12:02:22 (13 years ago)
- Location:
- branches/version-2_4-dev/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_4-dev/data/Smarty/templates/default/admin/contents/inquiry.tpl
r16761 r18469 145 145 </tr> 146 146 <!--{section name=question loop=$cnt_question}--> 147 <!--{assign var=index value=$smarty.section.question.index}--> 147 148 <tr class="fs12n"> 148 149 <td width="140" bgcolor="#f2f1ec">質問<!--{$smarty.section.question.iteration}--><!--{if $smarty.section.question.iteration eq 1}--><span class="red">*</span><!--{/if}--></td> 149 150 <td width="637" bgcolor="#ffffff"> 150 <input type="text" name="question[<!--{$ smarty.section.question.index}-->][name]" size="70" class="box70" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].name|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].name}--><!--{sfSetErrorStyle}--><!--{/if}-->>151 <!--{if $ERROR.question[$ smarty.section.question.index].name}--><br><span class="red"><!--{$ERROR.question[$smarty.section.question.index].name}--></span><!--{/if}-->151 <input type="text" name="question[<!--{$index}-->][name]" size="70" class="box70" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].name|escape}-->" <!--{if $ERROR.question[$index].name}--><!--{sfSetErrorStyle}--><!--{/if}-->> 152 <!--{if $ERROR.question[$index].name}--><br><span class="red"><!--{$ERROR.question[$index].name}--></span><!--{/if}--> 152 153 </td> 153 154 </tr> 154 155 <tr class="fs12n" bgcolor="#ffffff"> 155 156 <td colspan="2"> 156 <span style=background-color:"<!--{$ERROR_COLOR.question[$ smarty.section.question.index].kind}-->">157 <!--{html_radios_ex onClick="func_disp(`$ smarty.section.question.index`)" name="question[`$smarty.section.question.index`][kind]" options="$arrQuestion" selected="`$smarty.post.question[$smarty.section.question.index].kind`"}-->157 <span style=background-color:"<!--{$ERROR_COLOR.question[$index].kind}-->"> 158 <!--{html_radios_ex onClick="func_disp(`$index`)" name="question[`$index`][kind]" options="$arrQuestion" selected="`$smarty.post.question[$index].kind`"}--> 158 159 </span> 159 <!--{if $ERROR.question[$smarty.section.question.index].kind}--><br><span class="red"><!--{$ERROR.question[$smarty.section.question.index].kind}--></span><!--{/if}--> 160 </td> 161 </tr> 160 <!--{if $ERROR.question[$index].kind}--><br><span class="red"><!--{$ERROR.question[$index].kind}--></span><!--{/if}--> 161 </td> 162 </tr> 163 <!--{** 回答 **}--> 162 164 <tr class="fs12n" bgcolor="#ffffff"><td colspan="2"> 163 <table id="TD<!--{$smarty.section.question.index}-->"> 164 <tr class="fs12n" bgcolor="#ffffff"> 165 <td colspan="2">1 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][0]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.0|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].kind}--><!--{sfSetErrorStyle}--><!--{/if}-->> 2 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][1]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.1|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].kind}--><!--{sfSetErrorStyle}--><!--{/if}-->></td> 166 </tr> 167 <tr class="fs12n" bgcolor="#ffffff"> 168 <td colspan="2">3 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][2]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.2|escape}-->"> 4 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][3]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.3|escape}-->"></td> 169 </tr> 170 <tr class="fs12n" bgcolor="#ffffff"> 171 <td colspan="2">5 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][4]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.4|escape}-->"> 6 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][5]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.5|escape}-->"></td> 172 </tr> 173 <tr class="fs12n" bgcolor="#ffffff"> 174 <td colspan="2">7 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][6]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.6|escape}-->"> 8 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][7]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.7|escape}-->"></td> 175 </tr> 165 <table id="TD<!--{$index}-->"> 166 <!--{section name=option loop=4 start=0 max=7}--> 167 <tr class="fs12n" bgcolor="#ffffff"> 168 <td colspan="2"> 169 <!--{assign var=option_index1 value=$smarty.section.option.index*2}--> 170 <!--{assign var=option_index2 value=$option_index1+1}--> 171 <!--{assign var=num1 value=$option_index1+1}--> 172 <!--{assign var=num2 value=$option_index2+1}--> 173 <!--{** 回答エラー **}--> 174 <!--{assign var=error1 value=$ERROR.question[$index].option[$option_index1]}--> 175 <!--{if $error1}--><span class="red"><!--{$error1}--></span><br /><!--{/if}--> 176 <!--{assign var=error2 value=$ERROR.question[$index].option[$option_index2]}--> 177 <!--{if $error2}--><span class="red"><!--{$error2}--></span><br /><!--{/if}--> 178 <!--{** 回答フォーム **}--> 179 <!--{$num1}--> <input type="text" name="question[<!--{$index}-->][option][<!--{$option_index1}-->]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].option[$option_index1]|escape}-->" <!--{if $error1}--><!--{sfSetErrorStyle}--><!--{/if}-->> 180 <!--{$num2}--> <input type="text" name="question[<!--{$index}-->][option][<!--{$option_index2}-->]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].option[$option_index2]|escape}-->" <!--{if $error2}--><!--{sfSetErrorStyle}--><!--{/if}-->> 181 </td> 182 </tr> 183 <!--{/section}--> 176 184 </table> 177 185 </td></tr> -
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.