<div class="page-header">
 <ol class="breadcrumb">
  <li class="breadcrumb-item"><a href="<%= origami_root_path  %>"><%= t("views.right_panel.button.home") %></a></li>
  <li class="breadcrumb-item active"><%= t("views.right_panel.detail.account") %></li>
  <span class="float-right">
    <%= link_to t('.back', :default => t("views.btn.back")), origami_root_path %>
  </span>
</ol>
</div>

<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
    <div class="card">
      <table class="table table-striped">
        <thead>
          <tr>
            <th><%= t("views.right_panel.detail.title") %></th>
            <th><%= t("views.right_panel.detail.account_type") %></th>
            <th><%= t("views.right_panel.detail.discount") %></th>
            <th><%= t("views.right_panel.detail.point") %></th>
            <th><%= t("views.right_panel.detail.bonus") %></th>
            <th><%= t("views.right_panel.detail.rebate") %></th>
            <th><%= t("views.right_panel.detail.actions") %></th>
          </tr>
        </thead>

        <tbody>
          <% @settings_accounts.each do |account| %>
          <tr>
            <td><%= account.title %></td>
            <td><%= account.account_type == 1 ? "Expense" : "Income"%></td>
            <td><%= account.discount %></td>
            <td><%= account.point %></td>
            <td><%= account.bonus %></td>
            <td><%= account.rebate %></td>
            <td>
              <%= link_to t("views.btn.show"), settings_account_path(account),:class => 'btn btn-info btn-sm waves-effect' %>
              <%= link_to t("views.btn.edit"), edit_settings_account_path(account),:class => 'btn btn-primary btn-sm waves-effect' %> 
            </td>
          </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>
  <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
    <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.title") %> - <%= t("views.right_panel.detail.title_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.account_txt") %> <br>
          2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.account_type_txt") %> <br>
          3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
          4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
          5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
          6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
          7) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt") %> <%= t("views.right_panel.detail.account_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.new") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
          2) <%= t("views.right_panel.button.show") %> - <%= t("views.right_panel.detail.show_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
          2) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.account_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.dashboard_txt") %> <br>
          </p>
      </div>
    </div>  
  </div>
  <div class="col-lg-1 col-md-1 col-sm-1">
   <button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
 </div>
</div>

<script type="text/javascript">
  $(document).ready(function(){
    $('#back').on('click',function(){
      table_type = '<%=@table_type%>';
      table      = '<%=@dining_facility.id%>';
      if(table_type == "Table"){
        window.location.href = "/origami/table/" + table_id
      }
      else {
        window.location.href = "/origami/room/" + table_id
      }
    })
  });
</script>