<main role="main" class="container">

      
      <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-purple rounded box-shadow">
        
        <div class="lh-100">
          <h6 class="mb-0 text-white lh-100">Members</h6>
       
        </div>
      </div>

  
        <div class="my-3 p-3 bg-white rounded box-shadow">
          <?=form_open("subject")?>
          <form>
          <div class="row">
            <div class="col-md-2"> Search For Member</div>  
            <div class="col-md-3"> <input class="form-control" type="text" name="subjectdesc"  value="<?=$subjectdesc?>" placeholder="Subject" > </div>
             <div class="col-md-3">
              <input type="submit" name="filtersubject" class="btn btn-info" value="Search" style="width: 100px">
              <input type="submit" name="clearsubject" class="btn btn-secondary" value="Clear" style="width: 100px">
             </div>
          </div>
        </form>
           <hr> 
           <?php
             $set_data = $this->session->all_userdata(); 
            $message = !empty($set_data['flashmessages']['message']) ? $set_data['flashmessages']['message']: "";
            $status = !empty($set_data['flashmessages']['status']) ? $set_data['flashmessages ']['status']: "";
            if(!empty($message) && $status == 'negative'){
                echo '<p class = "alert alert-danger">'.$message. '</p>';
            }else if(!empty($message) && $status= 'positive'){
                 echo '<p class = "alert alert-success">' .$message.'</p>';
            }  
            $this->session->unset_userdata('flashmessages');
           ?>




          <table class="table table-hover table-sm">
            <thead>
              <tr>
                <th>No.</th>
                <th>Subject Code</th>
                <th> Subject Description</th>
                <th>Subject Unit</th>
                <th>Action</th>
              </tr>
            </thead>
            <tbody>
              <?php
              $pagecnt = $cnt;
                foreach($subs as $s){
                echo "<tr>";
                echo "<td>".$pagecnt."</td>";
                echo "<td>".$s['subjectdesc']."</td>";
                echo "<td>".$s['subjectunit']."</td>";
                echo "<td> <a href = '".base_url()."editsubject/".$s['subjectid']."'
                role = 'button' class = 'btn btn-sm btn-success'>Edit</a></td>";
                echo "</tr>";
                $pagecnt++;
                }

              ?>
            </tbody>
          </table>
          <div class="row text-center-right mt-3">
            <div class="col-md-12 text-center">
              <?php echo $links?>            
            </div>
          </div>
        <small class="d-block text-right mt-3">
         <a href="<?=base_url()?>addsubject" class = "btn btn-primary" role = "button">Add Subject</a>
        </small>
      </div>
    </main>