  <div class="main-content">



   <div class="page-content">

     <div class="container-fluid">



       <div class="row">



         <div class="col-lg-12">

          <div class="card">

           <div class="card-body">    

            <h4 class="mt-0 header-title m-b-30">Manage Blogs</h4>

            <?php  if($this->session->flashdata()) {

             echo Helpers::showFlash($this->session->flashdata("response"));

           } ?>



           <table id="datatable" class="table table-striped table-bordered dt-responsive nowrap">

             <thead>

              <tr>

                <th>S.No</th>

                <th>Username</th>

                <th>Title</th>

                <th>Content</th>

                <th>Date</th>

                <th>Status</th>

              </tr>

           </thead>

           <tbody>

              <?php $key = 1; foreach ($data as $value) {  $user = Helpers::userdetails($value["user_id"]);?>

                <tr>

                  <td><?= $key; ?></td>

                  <td><?= $user["username"]; ?></td>

                  <td><?= $value["title"]; ?></td>

                  <td><?= $value["content"]; ?></td>

                  <td><?= $value["date"]; ?></td>

                  <td><?= $value["status"] ? 'Approved': 'Not Approved'; ?></td>

                  <?php if(!$value["marked"]) {?>

                <td><div class="row text-center"> <div class="col-md-12" style="margin-bottom: 10px">

                    <a class="btn btn-info" href='<?= base_url()."admin/approve_post?id={$value["id"]}"; ?>'>Yes</a></div>

                     <div class="col-md-12">

                    <a class="btn btn-info" href='<?= base_url()."admin/disapprove_post?id={$value["id"]}"; ?>'>No</a> 

                  </div>

                  </td>

                  <?php } ?>

                </tr>

              <?php $key = $key+1; } ?>

            </tbody>

          </table> 



        </div>

      </div>



    </div>



  </div>

</div>

</div>