<% breadcrumb_add t('commissioners'), settings_commissioners_path, settings_commissioners_path, t("views.btn.#{action_name}") %>

<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
    <div class="card">
      <div class="body">
        <%= simple_form_for([:settings, @commissioner]) do |f| %>
        <%= f.error_notification %>
        <div class="form-group p-l-15">
          <%= f.input :name %>

          <label>Commissioner Image</label>
          <div class="panel padding-10">
            <div class="form-group">
              <div class="menu-item-img">
                <% if f.object.image_path? %>
                  <p><%= f.object.name %></p>
                     <%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
                <% else %>                
                  <%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
                <% end %>          
              </div>
              <%= f.file_field :image_path, :class => "img-thumbnail" %>
            </div>
          </div> 
          
          <%= f.label :emp_id, 'Employee' %>

          <%= f.collection_select :emp_id, Employee.all.order('name asc'), :id, :name, {prompt: 'Select an Employee'}, {class: "form-control"} %>

          <br/>

          <%= f.label :commission_id, 'Commission'%>
          <%= f.select :commission_id, Commission.all.map {|l| [l.name, l.id]}, { :include_blank => 'Choose Commission Product', :selected => ''}, {class: 'form-control'} %>
          <br/>
          <%= f.label :joined_date %><br/>
          <%= f.text_field :joined_date, {class: 'form-control datepicker', id: 'joined_date', readonly: true} %><br/>
          <%= f.label :resigned_date %><br/>
          <%= f.text_field :resigned_date, {class: 'form-control datepicker', id: 'resigned_date', readonly: true} %><br/>
          <%= f.input :is_active %> 
          <input type="hidden" name="from_induty" value="" class="from_induty">
          <input type="hidden" name="booking_id" value="" class="booking_id">
        </div>

        <div class="form-actions">
         <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
       </div>
       <% end %>
     </div>
   </div>
 </div>
 <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
  <div class="card">
    <div class="body">
      <h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
      <p>
        1) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
        2) <%= t("views.right_panel.detail.employee") %> <%= t("views.right_panel.detail.name_txt2") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.employee") %> <%= t("views.right_panel.detail.name_txt2") %> <br>
        3) <%= t("views.right_panel.detail.commission_type") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.commission_type_txt") %> <br>
        4) <%= t("views.right_panel.detail.joined_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.joined_date_txt") %> <br>
        5) <%= t("views.right_panel.detail.resigned_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.resigned_date_txt") %> <br>
        6) <%= t("views.right_panel.detail.active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.active_txt") %> <br>
      </p>
      <h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
      <p>
        1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.commissioner_txt") %> <br>
      </p>
      <h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
      <p>
        1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
        2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.commissioner_txt") %> <br>
      </p>
    </div>
  </div>  
</div>
</div>
<script type="text/javascript">
  $('.from_induty').val(localStorage.getItem('from_induty'));
  $('.booking_id').val(localStorage.getItem('booking_id'));
</script>
