<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 - Tution Fee</h4>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item">Dashboard</li>
              <li class="breadcrumb-item ">Extra</li>
              <li class="breadcrumb-item active">School Fees</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");
                $num_rows1 = mysqli_num_rows($result);
                {
                 $sts=htmlentities($num_rows1); 
                }
                ?>
                                  
              <div class="info-box-content">
                <span class="info-box-text">Registered Pupils</span>
                <h4 class="info-box-number budge"><?php echo $sts; ?></h4>
              </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>
                    <a href="Pupils.php?page=Fee" class="btn btn-warning" id="">
                  <i class="fa fa-id-card"></i> Whole Fee structure
                </a>
                </center>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
          </div>
         </div>
    </section>
          
    
    <section class="content" style="text-decoration:none;font-weight:normal;font-family:Times;font-size:12px">
           <div class="row">
            <div class="col-md-5 col-sm-5 col-lg-5">
                <center><h5 class="text-success">Tution Fee</h5></center>
             <div class="table-responsive" id="tablefeefolde">
                 <table class="table table-bordered" id="feeorigin" >
                     <thead>
                         <tr>
                             <th>#</th>
                             <th>Class/Grade</th>
                             <th>Tution Fee (KES)</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <?php
                        $sql = "select * from Fees ORDER BY Grade ASC";
                        $result = $con->query($sql);
                        if ($result->num_rows > 0) 
                        {
                            $cnt='1';
                            while($row = $result->fetch_assoc()) 
                            {
                            ?>	
                            <tr>
                            <td><?php echo $cnt; ?></td>
                            <td><?php echo $row["Grade"]; ?></td>
                            <td>
                                <input style="font-weight:bold;font-size:15px" type="text"  onkeypress="return /[0-9]/i.test(event.key)" value="<?php echo $row['Tution']; ?>" class="tutioninput text-danger" />
                            </td>
                            <td>
                                <input type="hidden"  onkeypress="return /[0-9]/i.test(event.key)" name="feeidholder" class="feeipholderr" value="<?php echo $row["count"]; ?>" />
                                <i class="fa fa-save text-green btnfeeedit btn-xs" id="bed" title="Click to Update">
                                </i>
                            </td>
                            </tr>
                            <?php
                            $cnt=$cnt+1;
                            }
                        }
                            ?>
                     </tbody>
                 </table> 
              </div>
              </div>
              
              <!---Manage Boarding Feee -->
               <div class="col-md-2 col-sm-2 col-lg-2">
                <center><h5 class="text-success">Boarding Fee</h5></center>
             <div class="table-responsive" id="">
                 <table class="table table-bordered" id="" >
                     <thead>
                         <tr>
                             <th>Amount (KES)</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <tr>
                            <?php
                            $sql = "select * from bofee";
                            $result = $con->query($sql);
                            while($row = $result->fetch_assoc()) 
                            {
                               $bofe=$row["Fee"];
                            }
                            ?>
                            <td><input type="text" style="font-size:18px;font-weight:800" name="amt" value="<?php echo $bofe; ?>" id="bofee" onkeypress="return /[0-9]/i.test(event.key)" class="form-control text-danger" /> 
                            </td>
                            <td>
                                <button class="btn btn-primary btn-sm btnbofee" id="btnbofee">  Save</button>
                            </td>
                            </tr>
                     </tbody>
                 </table> 
              </div>
              </div>
        
              <!-- Manage Motivation Fee -->
            <div class="col-md-2 col-sm-2 col-lg-2">
                <center><h5 class="text-success">Motivation Fee</h5></center>
                <label class="text-danger">Grade: 1-6</label>
             <div class="table-responsive" id="">
                 <table class="table table-bordered" id="" >
                     <thead>
                         <tr>
                             <th>Amount (Ksh)</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <tr>
                            <?php
                            $sql = "select * from motifee where Grad='Lower'";
                            $result = $con->query($sql);
                            while($row = $result->fetch_assoc()) 
                            {
                               $bofe=$row["Amount"];
                            }
                            ?>
                            <td><input type="text" style="font-size:18px;font-weight:800" name="amt" value="<?php echo $bofe; ?>" id="mofee" onkeypress="return /[0-9]/i.test(event.key)" class="form-control text-danger mofee" /> 
                            </td>
                            <td>
                                 <input type="hidden" value="Lower" class="gradee" name="gradee" />
                                <button class="btn btn-success btn-sm btnmofee" id=""> Save</button>
                            </td>
                            </tr>
                     </tbody>
                 </table> 
              </div>
              </div>
              
            <div class="col-md-2 col-sm-2 col-lg-2">
            <center><h5 class="text-success">Motivation Fee</h5></center>
              <label class="text-danger">Grade: 7,8,9</label>
             <div class="table-responsive" id="">
                 <table class="table table-bordered" id="" >
                     <thead>
                         <tr>
                             <th>Amount (Ksh)</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <tr>
                            <?php
                            $sql = "select * from motifee where Grad='Upper'";
                            $result = $con->query($sql);
                            while($row = $result->fetch_assoc()) 
                            {
                               $bofe=$row["Amount"];
                            }
                            ?>
                            <td><input type="text" style="font-size:18px;font-weight:800" name="amt" value="<?php echo $bofe; ?>" id="mofee" onkeypress="return /[0-9]/i.test(event.key)" class="form-control text-danger mofee" /> 
                            </td>
                            <td>
                                <input type="hidden" value="Upper" class="gradee" name="gradee" />
                                <button class="btn btn-success btn-sm btnmofee" id="">  Save</button>
                            </td>
                            </tr>
                     </tbody>
                 </table> 
              </div>
              </div>
            </div>
    </section>
</div>

