<%= f.error_messages %>
<p class="req"><span class="pnt">※</span>は必須入力です</p>
<table class="data" cellspacing="1">
  <tr>
    <th>顧客ID</th>
    <td><%=h @customer.id %></td>
  </tr>
  <tr>
    <th>会員状態 <span class="pnt">※</span></th>
    <td>
      <% if params[:action] =~ /confirm/ || params[:action]=~ /update/ %>
        <%=h Customer::ACTIVATE_NAMES[@customer.activate] %>
      <% else %>
        <%= f.radio_button :activate, 1 %>仮会員&nbsp;
        <%= f.radio_button :activate, 2 %>本会員&nbsp;
        <%= f.radio_button :activate, 3 %>退会
      <% end %>
    </td>
  </tr>
  <tr>
    <th>お名前 <span class="pnt">※</span></th>
    <td>
      <%= confirm_tag :text_field, :customer, :family_name %>
      <%= confirm_tag :text_field, :customer, :first_name %>
    </td>
  </tr>
  <tr>
    <th>フリガナ <span class="pnt">※</span></th>
    <td>
      <%= confirm_tag :text_field, :customer, :family_name_kana %>
      <%= confirm_tag :text_field, :customer, :first_name_kana %>
    </td>
  </tr>
  <tr>
    <th>郵便番号 <span class="pnt">※</span></th>
    <td>
      〒 <%= confirm_tag :text_field, :customer, :zipcode01, :size => 10 %>－
      <%= confirm_tag :text_field, :customer, :zipcode02, :size => 10 %>
      <% unless (params[:action] =~ /confirm/ || params[:action] =~ /update/) && @customer.errors.empty? %>
        <input name="zipcode_input" value="住所入力" onclick="address_by_zip('customer_zipcode01','customer_zipcode02', 'customer_prefecture_name', 'customer_address_city', 'customer_address_detail', 'customer_prefecture_id', 'admin/customers', '<%=h ActionController::Base.relative_url_root %>');" type="button" class="btn_s">
      <% end %>
    </td>
  </tr>
  <tr>
    <th>ご住所 <span class="pnt">※</span></th>
    <td>
      <% prefectures = Prefecture.find(:all, :order => "position").map {|p| [p.name, p.id]} %>
      <%= confirm_select(confirm_tag(:select, :customer, :prefecture_id, prefectures, :include_blank=>true), @customer.prefecture_name, "customer") %>
      <br/><br/>
      <%= confirm_tag :text_field, :customer, :address_city, :class=>"data_m" %><br />
      <span>（上限50文字）</span><br/>
      ※市区町村を入力（例：大阪市北区堂島）
      <br/><br />
      <%= confirm_tag :text_field, :customer, :address_detail, :class=>"data_m" %><br />
      <span>（上限50文字）</span><br/>
      ※番地、建物、マンション名などを入力（例：2丁目1-31 ORIX堂島ビル5階）<br/>
    </td>
  </tr>
  <tr>
    <th>メールアドレス <span class="pnt">※</span></th>
    <td><%= confirm_tag :text_field, :customer, :email, :class=>"data_m" %><span>（上限50文字）</span></td>
  </tr>
  <tr>
    <th>TEL <span class="pnt">※</span></th>
    <td>
      <%= confirm_tag :text_field, :customer, :tel01, :class=>"data_s" %>－
      <%= confirm_tag :text_field, :customer, :tel02, :class=>"data_s" %>－
      <%= confirm_tag :text_field, :customer, :tel03, :class => "data_s" %>
    </td>
  </tr>
  <tr>
    <th>FAX</th>
    <td>
      <%= confirm_tag :text_field, :customer, :fax01, :class => "data_s" %>－
      <%= confirm_tag :text_field, :customer, :fax02, :class => "data_s" %>－
      <%= confirm_tag :text_field, :customer, :fax03, :class => "data_s" %>
    </td>
  </tr>
  <tr>
    <th>性別 <span class="pnt">※</span></th>
    <td>
      <%= confirm_select("#{f.radio_button :sex, 1}男性&nbsp;#{f.radio_button :sex, 2}女性", @customer.sex_view, "customer") %>
    </td>
  </tr>
  <tr>
    <th>職業</th>
    <td>
      <% occupations = Occupation.find(:all, :order => "position").map {|p| [p.name, p.id]} %>
      <%= confirm_select(confirm_tag(:select, :customer, :occupation_id, occupations, :include_blank=>true), @customer.occupation_name, "customer") %>
    </td>
  </tr>
  <tr>
    <th>生年月日</th>
    <td>
      <%= confirm_tag :calendar_date_select,
                      :customer,
                      :birthday,
                     {:start_year => 100.years.ago.year,
                      :end_year => Date.today.year,
                      :use_month_numbers => true} %>
    </td>
  </tr>
  <tr>
    <th>パスワード <span class="pnt">※</span></th>
    <td>
      <%=confirm_select(confirm_tag(:password_field, :customer, :raw_password, :class => "data_m"), "●●●●●●", "customer") %>
    </td>
  </tr>
  <tr>
    <th>メールマガジン <span class="pnt">※</span></th>
    <td>
      <% if (params[:action] =~ /confirm/ || params[:action]=~ /update/) && @customer.errors.empty?  %>
        <%=h @customer.receive_mailmagazine_view %>
      <% else %>
        <% [Customer::HTML_MAIL, Customer::TEXT_MAIL, Customer::NO_MAIL].each do | value | %>
          <% label = Customer::MAILMAGAZINE_NAMES[value] %>
          <%= f.radio_button :receive_mailmagazine, value %>
          <%= content_tag :label, label, :for => "customer_receive_mailmagazine_%d" % value %>
        <% end %>
      <% end %>
      <br />
      <%= confirm_select("#{f.check_box(:reachable)} #{f.label(:reachable, "到達可能", :title=>"メールマガジン送信に失敗するとOFFになります")}", @customer.reachable_view, "customer") %>
    </td>
  </tr>
  <tr>
    <th>購入回数</th>
    <td>
      <%=h @order_count %>
      <%= hidden_field_tag :order_count, @order_count %>
    </td>
  </tr>
  <tr>
    <th>ポイント</th>
    <td>
      <%= confirm_tag :text_field, :customer, :point, :size => 20  %>pt
    </td>
  </tr>
  <tr>
    <th>ブラックリスト <span class="pnt">※</span></th>
    <td>
      <%= confirm_select("#{f.radio_button :black, true}ON&nbsp;#{f.radio_button :black, false}OFF", @customer.black_view, "customer") %>
    </td>
  </tr>
</table>
<%= hidden_field_tag :id, params[:id] %>
