<%= form_with model: [:admin_portal, @customer], local: true, html: { class: "needs-validation" }, data: { turbo: false } do |f| %>
Personal Info
<%= f.label :firstname, "First Name", class: "form-label" %> <%= f.text_field :firstname, class: "form-control" %>
<%= f.label :middlename, "Middle Name", class: "form-label" %> <%= f.text_field :middlename, class: "form-control" %>
<%= f.label :lastname, "Last Name", class: "form-label" %> <%= f.text_field :lastname, class: "form-control" %>
<%= f.label :idnumber, "ID Number", class: "form-label" %> <%= f.text_field :idnumber, class: "form-control" %>
<%= f.label :id_type, "ID Type", class: "form-label" %> <%= f.select :id_type, ['nationalid','passport'], { prompt: "Select ID Type" }, class: "form-select" %>
<%= f.label :dob, "Date of Birth", class: "form-label" %> <%= f.date_field :dob, class: "form-control" %>
<%= f.label :sex, "Sex", class: "form-label" %> <%= f.select :sex, [['Male','Male'],['Female','Female']], { prompt: "Select Sex" }, class: "form-select" %>
Contact & Address
<% [:email, :mobile_1, :mobile_2, :phone, :address_1, :address_2, :city, :country].each do |field| %>
<%= f.label field, field.to_s.humanize, class: "form-label" %> <%= f.text_field field, class: "form-control" %>
<% end %>
<%= f.label :customer_address, "Customer Address", class: "form-label" %> <%= f.text_area :customer_address, class: "form-control", rows: 2 %>
Employment & Financial
<%= f.label :employer_name, "Employer Name", class: "form-label" %> <%= f.text_field :employer_name, class: "form-control" %>
<%= f.label :employment_type, "Employment Type", class: "form-label" %> <%= f.text_field :employment_type, class: "form-control" %>
<%= f.label :salary, "Salary", class: "form-label" %> <%= f.number_field :salary, class: "form-control", step: 0.01 %>
Next of Kin
<%= f.fields_for :next_of_kins do |k| %>
<% [:firstname, :lastname, :relation, :mobile_1].each do |field| %>
<%= k.label field, field.to_s.humanize, class: "form-label" %> <%= k.text_field field, class: "form-control" %>
<% end %>
<%= k.check_box :immediate, class: "form-check-input" %> <%= k.label :immediate, "Immediate", class: "form-check-label" %>
<%= k.check_box :active, class: "form-check-input" %> <%= k.label :active, "Active", class: "form-check-label" %>
<% end %>
<%= f.submit "Save Customer", class: "btn btn-primary rounded-pill shadow-sm" %>
<% end %>