<% layout('admin_layout') %>
<div class="page-content--bgf7">
    <!-- WELCOME-->
    <section class="welcome p-t-10">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="title-4">Post
                        <!-- <a href="" class="au-btn au-btn-icon purple-bg au-btn--small float-right">
                            <i class="zmdi zmdi-plus"></i>List Post
                        </a> -->
                    </h1>
                    <hr class="line-seprate">
                </div>
            </div>
        </div>
    </section>
    <!-- END WELCOME-->

    <!-- DATA TABLE-->
    <section class="p-t-20" style="min-height: 420px !important;">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    
                   
                    <div class="table-responsive table-responsive-data2">
                        <table class="table table-borderless table-data3">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Title</th>
                                    <th>Description</th>
                                    <th>Owner</th>
                                    <th>CreatedAt</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <% if(category_data != ""){ 
                              category_data.forEach(function(val, index) {
                                    if(1 == 1)
                            var key = index+1;
                                else
                                    var key = ((0current-1)*10)+(index+1);
                              %>
                                <tr class="tr-shadow">
                                    <td><%= key %></td>
                                    <td><%= val.title %></td>
                                    <td><%= val.postDescription %></td>
                                    <td>Dherbs</td>
                                    <td><%= new Date(val.createdAt) %></td>
                                    <td>
                                        <a style="cursor:pointer;" href="/admin/del/<%= val.id %>"
                                            id="DelBtn" class="item" onclick="return confirm('Are you sure you want to delete this item?');" title="Delete">
                                            <i class="fa fa-trash"></i>
                                        </a>
                                    </td>
                                </tr>
                                <tr class="spacer"></tr>
                                <% });
                                }else{ %>
                                <tr class="tr-shadow">
                                    <td colspan="5" class="text-center">No Record Found</td>
                                </tr>
                                <% } %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- END DATA TABLE-->

    <!-- COPYRIGHT-->
    <section class="p-t-0">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="copyright">
                        <p>Copyright © <%= new Date().getFullYear();%> Dherb.    All rights reserved.</p>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- END COPYRIGHT-->
</div>