<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h4 class="m-0">Manage Learners</h4>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item">Dashboard</li>
              <li class="breadcrumb-item ">Learner's Data</li>
              <li class="breadcrumb-item active">Manage Learners'</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="far fa-envelope"></i>
              </span>
              <?php
                //include('../include/config.php');
                $result = mysqli_query($con,"SELECT * FROM pupils where Status='Active'");
                $num_rows1 = mysqli_num_rows($result);
                {
                    $sts=htmlentities($num_rows1); 
                }
                ?>
            
              <div class="info-box-content">
                <span class="info-box-text">Active Learners</span>
                <h4 class="info-box-number budge" title="Active Learners"><?php echo $sts; ?></h4>
              </div>
                
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
        
          <div class="col-md-2 col-sm-6 col-12">
            <div class="info-box">
  
              <div class="info-box-content">
                <center>
                    <button type="button" class="btn btn-info" data-toggle="modal" data-target="#modaladdpupils" id="seemodal">
                  <i class="fa fa-plus"></i> Add new learner
                </button>
                </center>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
          
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
  
              <div class="info-box-content">
                <center>
                    <button type="button" class="btn btn-success" data-toggle="modal" data-target="#modalbulk" id="seemodal">
                  <i class="fa fa-refresh"></i> Bulk Learner's Update
                </button>
                </center>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
           <!--div class="col-md-2 col-sm-6 col-12">
            <div class="info-box">
  
              <div class="info-box-content">
                <center>
                <a type="button" class="btn btn-success" href="Pupils.php?page=Quick_Update">
                  <i class="fa fa-refresh"></i> Quick Update
                </a>
                </center>
              </div>
            </div>
          </div-->
          
            <div class="col-md-2 col-sm-6 col-12">
            <div class="info-box">
          
              <div class="info-box-content">
                   
             <button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#modalfreeze" id="">
                  <i class="fa fa-gears"></i> Freeze/Activate Pupils
                </button>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
          </div>
         </div>
    </section>
          
    
    <section class="content">
         <div class="table-responsive" id="tableresponsivee">
                 <table class="table table-bordered tabledatas" id="tablepupils">
                     <thead>
                         <tr>
                             <th>#</th>
                             <th>Name</th>
                             <th>Adm No</th>
                             <th>Class</th>
                             <th>Category</th>
                             <th>Parent Contact</th>
                             <th>Add to Fee Structure </th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <?php
                        $sql = "select * from pupils ORDER BY Status ASC,Claz DESC, Names DESC";
                        $result = $con->query($sql);
                        if ($result->num_rows > 0) 
                        {
                            $cnt='1';
                            while($row = $result->fetch_assoc()) 
                            {
                            $sta=$row["Status"];
                            if($sta=='Inactive')
                            {
                            ?>
                            <tr class="alert-warning">
                            <td><?php echo $cnt; ?></td>
                            <td><?php echo $row["Sirname"].' '.$row["Names"]; ?></td>
                            <td><?php echo $row["AdmNo"]; ?></td>
                            <td><?php echo $row["Claz"]; ?></td>
                            <td><?php echo $row["Locat"]; ?></td>
                            <td><?php echo $row["Boarder"]; ?></td>
                            <td><?php echo $row["Contact"]; ?></td>
                            <td><a href="Pupils.php?page=Add_To_Fee_Statement&HJJGBzxYYjYMNMNUkllixxgt=<?php echo $row["count"]; ?>"> <i class="fa fa-plus btn"></i> </a>
                            </td>
                            <td>
                                <input type="hidden" name="pupilidholder" class="pupilidholder" value="<?php echo $row["count"]; ?>" />
                                <i class="fa fa-edit text-green btnpupiledit" id="bed"></i> || <i class="fa fa-trash text-danger pupildelete" id="bedit"></i>
                            </td>
                            </tr>   
                            <?php 
                            $cnt=$cnt+1;
                            }else
                            {
                            ?>
                            <tr>
                            <td><?php echo $cnt; ?></td>
                            <td><?php echo $row["Sirname"].' '.$row["Names"]; ?></td>
                            <td><?php echo $row["AdmNo"]; ?></td>
                            <td><?php echo $row["Claz"]; ?></td>
                            <td><?php echo $row["Boarder"]; ?></td>
                            <td><?php echo $row["Contact"]; ?></td>
                             <td><a href="Pupils.php?page=Add_To_Fee_Statement&HJJGBzxYYjYMNMNUkllixxgt=<?php echo $row["count"]; ?>"> <i class="fa fa-plus btn"></i>  </a></td>
                            <td>
                                <input type="hidden" name="pupilidholder" class="pupilidholder" value="<?php echo $row["count"]; ?>" />
                                <i class="fa fa-edit text-green btnpupiledit" id="bed"></i> || <i class="fa fa-trash text-danger pupildelete" id="bedit"></i>
                            </td>
                            </tr>
                            <?php
                            $cnt=$cnt+1;
                            }
                            }
                        }
                            ?>
                     </tbody>
                 </table> 
              </div>
    </section>
  
</div>

