Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title><%= title %></title>
- <link rel='stylesheet' href='/stylesheets/style.css' />
- <link rel='stylesheet' href='/bootstrap/css/bootstrap.min.css' />
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
- </head>
- <body>
- <h1><%= title %></h1>
- <p>Welcome to <%= title %></p>
- <p> Data Warga</p>
- <table class="table">
- <thead>
- <tr>
- <th scope="col">#</th>
- <th scope="col">Nama</th>
- <th scope="col">Umur</th>
- <th scope="col">Pekerjaan</th>
- <th scope="col">Action</th>
- </tr>
- </thead>
- <tbody>
- <% var no=1 %>
- <% for(var i = 0; i < warga.length; i++) {%>
- <tr>
- <th scope="row"><%= no++ %></th>
- <td><%= warga[i].nama %></td>
- <td><%= warga[i].umur %></td>
- <td><%= warga[i].pekerjaan %></td>
- <!-- menambahkan aksi edit dan delete dengan ambil _id -->
- <td><a href='/warga/edit/<%= warga[i]._id %>'> <i class="far fa-edit"></i> </a>
- <a href='/warga/delete/<%= warga[i]._id %>' onclick="return confirm('Are you sure you want to delete this item?');">
- <i class="fas fa-trash"></i></a></td>
- </tr>
- <% } %>
- </tbody>
- </table>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement