<html lang="en">

<%- include('../partials/header.ejs'); %>

  <body>

    <div class="container-scroller">

      <%- include ('../partials/nav.ejs') %>


        <div class="container-fluid page-body-wrapper">

          <%- include ('../partials/theme-setting') %>


            <%- include('../partials/sidebar.ejs') %>

              <div class="main-panel">
                <div class="content-wrapper p-0">

                  <div class="welcome-message">
                    <div class="d-lg-flex justify-content-between align-items-center">
                      <div class="pl-4">
                        <h2 class="text-white font-weight-bold mb-1">Service Instruction List</h2>
                      </div>
                    </div>
                  </div>

                  <!-- form -->
                  <div class="content-wrapper">
                    <div class="card">
                      <div class="card-body">
                        <div class="row">
                          <div class="col-12">
                            <div class="table-responsive">
                              <table id="order-listing" class="table">
                                <thead>
                                  <tr align="center">
                                    <th>#</th>
                                    <th>Code</th>
                                    <th>Service Instruction</th>
                                    <th>Status</th>
                                    <th>Actions</th>
                                  </tr>
                                </thead>
                                <tbody>
                                  <tbody>
                                    <% for(let i=0; i < data.length; i++) { %>
                                    <tr align="center">
                                      <td>1</td>
                                      <td> <%= data[i].title %></td>
                                      <td><%= data[i].details %></td>
                                      <td>
                                        <% if(data[i].status==1){ %> <label class="badge badge-success">Active</label> <% }
                                         else if (data[i].status==2) { %> <label class="badge badge-info">Disabled</label> <% } 
                                         else { %> <label class="badge badge-danger">Deleted</label> <% } %>
                                      </td>
                                      <td>
                                        <% if(data[i].status !== 0){ %>
                                          <a class="btn btn-outline-primary" href="<%= url %>service-instruction/edit/<%= data[i].id %>">Edit</a>
                                          <a class="btn btn-outline-primary" href="<%= url %>service-instruction/statusChange/<%= data[i].id %>">Change status</a>
                                          <a class="btn btn-outline-danger" href="<%= url %>service-instruction/delete/<%= data[i].id %>" onclick="return confirm('Are you sure you want to delete this item?');" >Delete Price Type</a>
                                        <% } %>
                                      </td>
                                    </tr>
                                    <% } %>
                                   
                                  </tbody>
                                 
                                </tbody>
                              </table>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>


                </div>
                <%- include ('../partials/footer.ejs'); %>

              </div>
        </div>
    </div>

    <%- include('../partials/footer_js.ejs'); %>

  </body>

</html>