<div style="background-color: rgb(250, 207, 210);">
  <%= image_tag_mobile "title_pink", :width => "100%", :height => 6 %>
  <%= image_tag_mobile "spacer", :width => "1", :height => "4" %>
  <span style="color: rgb(205, 37, 37);">◆</span>
  <span style="color: rgb(95, 67, 71);">アンケート</span>
</div>

<%=h flash[:notice] %>

<% if @questionnaire && @questionnaire.operation %>
<% form_tag :action=>"confirm", :id => @questionnaire.id do %>
  <p><span style="color: rgb(205, 37, 37);">◆</span><%=h @questionnaire.name %><br/ >
  <%=h @questionnaire.content %></p>
    <% @questions.each_with_index do | question, question_idx | %>
      <span>質問<%=h question_idx+1 %>：</span>　<%=h question.content %><br />
        <% question_choices = question.question_choices.find(:all, :conditions => ["content is not null or position=?", 1], :order => "position") %>
        <% question_choices.each_with_index do |question_choice, choice_idx| %>
          <% if question_choices[0][:format] == QuestionChoice::TEXTAREA %>
            <%= text_area_tag "answers[#{question.id}]", @answers[question_idx][choice_idx].answer, :rows=>"3", :style=>"width:100%;" %>
          <% elsif question_choices[0][:format] == QuestionChoice::TEXTBOX %>
            <%= text_field_tag "answers[#{question.id}]", @answers[question_idx][choice_idx].answer, :style=>"width:100%;" %>
          <% elsif question_choices[0][:format] == QuestionChoice::CHECKBOX %>
            <%= check_box_tag "answers[#{question.id}][#{question_choice.id}]", @answers[question_idx][choice_idx][:answer], "on"==@answers[question_idx][choice_idx][:answer] %>
            <label for="question_answer_content">　<%=h question_choice.content %>　</label><br />
          <% elsif question_choices[0][:format] == QuestionChoice::RADIOBUTTON %>
            <%= radio_button_tag "answers[#{question.id}]", question_choice.content, question_choice.content==@answers[question_idx][0].answer %>
            <label for="question_answer_content">　<%=h question_choice.content %>　</label><br />
          <% end %>
        <% end %>
    <% end %>
  <br />

  <p><span style="color: rgb(205, 37, 37);">◆</span>回答者情報<br />
  ※印は入力必須項目です。</p>
  <%= error_messages_for "respondent" if @respondent%>
  ※お名前<br />
    姓 <%= text_field "respondent", "customer_family_name", :size => "10" %><br />
    名 <%= text_field "respondent", "customer_first_name", :size => "10" %><br />
  ※フリガナ<br />
    セイ <%= text_field "respondent", "customer_family_name_kana", :size => "10" %><br />
    メイ <%= text_field "respondent", "customer_first_name_kana", :size => "10" %><br />
  郵便番号<br />
  〒 <%= text_field "respondent", "zipcode01", :size => "3" %> - <%= text_field "respondent", "zipcode02", :size => "4" %><br />
  ※ご住所<br />
  都道府県名<%= collection_select "respondent", "prefecture_name", Prefecture.find(:all, :order=>"position"), 'name', 'name', {:include_blank => true} %><br />
  市区町村名<%= text_field "respondent", "address_city", :size => "30" %><br />
  番地・ビル名<%= text_field "respondent", "address_details", :size => "30" %><br />
  住所は必ず二つに分けてご記入ください。<br />マンション名は必ず記入してください。>br/>
  ※お電話番号<br />
  <%= text_field "respondent", "tel01", :size => "4" %> - <%= text_field "respondent", "tel02", :size => "4" %> - <%= text_field "respondent", "tel03", :size => "4" %><br />
  ※メールアドレス<br />
    <%= text_field "respondent", "email", :size => "30" %><br />
    <%= text_field "respondent", "email_confirmation", :size => "30" %><br />
    確認のため2度入力してください。
  <div class="btn_box">
    <%= submit_tag("確認", :class=>"btn_s") %>
  </div>
<% end %>
<% end %>
