<%= f.error_messages %>
<table class="data" cellspacing="1">
  <tr>
    <th>顧客コード</th><td><%= f.text_field :customer_id, :class=>"data_m" %></td>
    <th>都道府県</th><td><%=
      prefectures = Prefecture.find(:all, :order => "position").map {|p| [p.name, p.id.to_s]}
      f.select :prefecture_id, prefectures, :include_blank=>true %></td>
  </tr>
  <tr>
    <th>顧客名</th><td><%= f.text_field :customer_name_kanji, :class=>"data_m" %></td>
    <th>顧客名（カナ）</th><td><%= f.text_field :customer_name_kana, :class=>"data_m" %></td>
  </tr>
  <tr>
    <th>性別</th>
    <td>
      <%= f.check_box :sex_male, {}, "1", "0" %>男性&nbsp;
      <%= f.check_box :sex_female, {}, "1", "0" %>女性
    </td>
    <th>誕生月</th><td><%= f.select :birth_month, ((1..12).map &:to_s), :include_blank=>true %></td>
  </tr>
  <tr>
    <th>誕生日</th>
    <td colspan="3" style="width:600px">
      <%= f.birthday_select :birthday_from, :use_month_numbers => true, :include_blank=>true %>&nbsp〜&nbsp
      <%= f.birthday_select :birthday_to, :use_month_numbers => true, :include_blank=>true %>
    </td>
  </tr>
  <tr>
    <th>メールアドレス</th>
    <td colspan="3">
      <%= f.text_field :email, :class=>"data_m" %>
      <%= f.check_box :reachable %><%= f.label :reachable, '到達可能', :title=>'メールマガジン送信に失敗するとオフになります' %>
    </td>
  </tr>
  <tr>
    <th>電話番号</th><td colspan="3"><%= f.text_field :tel_no, :class=>"data_m" %></td>
  </tr>
  <tr>
    <th>職業</th>
    <td colspan="3" style="width:600px">
      <% Occupation.find(:all, :order => 'position').each do |occupation| %>
        <%= check_box_tag "condition[occupation_id][]", occupation.id,
          (@condition.occupation_id || []).include?(occupation.id.to_s) %>
        <%= occupation.name %>
      <% end %>
    </td>
  </tr>
  <tr>
    <th>購入金額</th>
    <td>
      <%= f.text_field :total_up %>&nbsp;円〜<br /><br /><%= f.text_field :total_down %>&nbsp;円
    </td>
    <th>購入回数</th>
    <td>
      <%= f.text_field :order_count_up, :class=>"data_s" %>&nbsp;回〜<br /><br /><%= f.text_field :order_count_down, :class=>"data_s" %>&nbsp;回
    </td>
  </tr>
  <tr>
    <th>登録・更新日</th>
    <td colspan="3" style="width:600px">
      <%= f.date_select :updated_at_from, :use_month_numbers => true, :include_blank=>true %>&nbsp〜&nbsp
      <%= f.date_select :updated_at_to, :use_month_numbers => true, :include_blank=>true %>
    </td>
  </tr>
  <tr>
    <th>最終購入日</th>
    <td colspan="3" style="width:600px">
      <%= f.date_select :last_order_from, :use_month_numbers => true, :include_blank=>true %>&nbsp〜&nbsp
      <%= f.date_select :last_order_to, :use_month_numbers => true, :include_blank=>true %>
    </td>
  </tr>
  <tr>
    <th>購入商品名</th><td><%= f.text_field :product_name, :class=>"data_m" %></td>
    <th>購入商品コード</th><td><%= f.text_field :product_code, :class=>"data_m" %></td>
  </tr>
  <tr>
    <th>カテゴリ</th>
    <td colspan="3">
      <%=
        categories = Category.find(:all, :order => 'position').map {|p| [p.name, p.id.to_s]}
        f.select :category_id, categories, :include_blank=>true %></td>
    </td>
  </tr>
  <tr>
    <td class="btn_t" colspan="4">
    検索結果表示件数
    <%= f.select :search_par_page, (10..100).step(10).map(&:to_s) %>
        件
        <%= f.submit 'この条件で検索する', :class=>"btn_s" %></td>
  </tr>
</table>
