  <div class="main-content">



   <div class="page-content">

     <div class="container-fluid">



       <div class="row">



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

          <div class="card">

           <div class="card-body ">    

            <h4 class="mt-0 header-title m-b-30">Time Table Requests</h4>

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

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

           } ?>





           <table class="table" id="datatable">

            <thead class=" text-primary">  



              <tr>

                <th>Sr No</th>

                <th>Username</th>

                <th>Package Name</th>

                <th>Book Time</th>             

                <th>Date</th>

              </tr>

            </thead>

            <tbody>

             <?php $i = 1; 

             foreach ($data as $value) { 



              $user = helpers::getUserObj($value['user_id']);

              $pack = MemberHelper::packageNameFromId($value['package_id']);

              $monthNum =  $value['book_timing'];

              $monthName = date("F", mktime(0, 0, 0, $monthNum, 10));

              ?>

              <tr>

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

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

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

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



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

                <?php if($value['status'] == '0'){ ?>

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

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

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

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

                    </div>

                  </td>

                <?php }?>



                <?php if($value['status'] == '1'){ ?>

                  <td> <b class="text-success">Accepted</b>

                  </td>

                <?php }?>



                <?php if($value['status'] == '2'){ ?>

                  <td> <b class="text-danger">Rejected</b>

                  </td>

                <?php }?>



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



              </tr>

            </tbody>

          </table>





        </div>

      </div>



    </div>



  </div>

</div>

</div> 





