<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">
            <h5 class="m-0">Graduations</h5>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item">Dashboard</li>
              <li class="breadcrumb-item ">Income</li>
              <li class="breadcrumb-item ">Other Earnings</li>
              <li class="breadcrumb-item ">Graduation</li>
              <li class="breadcrumb-item active">Graduations</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-5 col-sm-5 col-5">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="far fa-dollar"></i></span>
              <?php
                include('../include/config.php');
                $result = mysqli_query($con,"SELECT SUM(Amount) as ama FROM Gradpayment where Year='$year'");
                while($row = $result->fetch_assoc()) 
                {
                  $totincome=$row["ama"];
                }
                ?>
              <div class="info-box-content">
                <span class="info-box-text">Graduation Income Year -   (<small><?php echo $year;?></small>)</span>
            <h4 class="info-box-number budge"><?php echo $totincome.' Ksh'; ?></h4>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
           <div class="col-md-3 col-sm-3 col-6">
            <div class="info-box">
              <div class="info-box-content">
                 <a href="index.php?page=Other_Earning" class="btn btn-success"> <i class="fa fa-arrow-left"></i> Other Income </a>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
           <div class="col-md-3 col-sm-3 col-6">
            <div class="info-box">
              <div class="info-box-content">
                 <a href="index.php?page=Graduation" class="btn btn-primary" id=""> <i class="fa fa-arrow-left"></i> Graduation Payment </a>
              </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-4"> 
              <h5 class="m-0 alert-success">Add New Graduation data</h5>
                <div class="modal-body panel-primary">
                    <center><marquee class="text-danger">Ensure information you enter is correct before saving</marquee></center>
                  <form action="" method="POST" onsubmit="return false">
                   
                      <div class="form-group">
                      <label for="inputProjectLeader">Graduation Title <span class="requireds">*</span></label>
                      <input type="text" class="form-control" name="" id="gtit" required />
                      </div>
                      
                      <div class="form-group">
                      <label for="inputProjectLeader">Graduation Date <span class="requireds">*</span></label>
                      <input type="date"  class="form-control" name="" id="gdate" required />
                      </div>
                      
                      <div class="form-group">
                      <label for="inputProjectLeader">Graduation Fee <span class="requireds">*</span></label>
                      <input type="text"  onkeypress="return /[0-9]/i.test(event.key)" class="form-control" name="" id="gfee" required />
                      </div>
                      
                      <div class="form-group">
                      <label for="inputProjectLeader">Class/Classes Graduating</label>
                      <textarea class="form-control" id="gclaz"></textarea>
                     </div>
                     
                     <div class="form-group">
                      <label for="inputProjectLeader">Any other info? </label>
                      <textarea class="form-control" id="gdes"></textarea>
                     </div>
                    
                     <div class="form-group">
                         <label id="otherincomemsg" style="color:#FFF">.</label> <br />
                         <button style="margin-right:0px;position:relative" class="btn btn-info btn-sm pull-right" id="submitgraddata">Save <i class="fa fa-save"></i>
                        </button>
                     </div>
                  </form>
                </div>
              </div>
               
             <div class="col-md-8">  
             <div class="table-responsive" id="divbus">
                 <table class="table table-bordered table-secondary" id="tabletour" >
                     <thead>
                         <tr>
                             <th>#</th>
                             <th>Graduation Title</th>
                             <th>Graduation Date</th>
                             <th>Class/Classes</th>
                             <th>Fee</th>
                             <th>Description</th>
                             <th>Entry Date</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                        <?php
                        //include('../include/config.php');
                        $sql = "select * from  graduations order by gid DESC";
                        $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["Title"]; ?></td>
                        <td class="alert-success"><?php echo $row["Dat"];?>
                        </td>
                        <td><?php echo $row["Clazz"]; ?></td>
                        <td><?php echo 'KES '. $row["Fee"]; ?></td>
                        <td><?php echo $row["Description"]; ?></td>
                        <td> <?php echo $row["EntryDate"]; ?></td>
                        <td>
                        <input type="hidden" name="otid" class="gid" value="<?php echo $row["gid"]; ?>" />
                        <i class="fa fa-trash btn-xs text-danger deletegraddata btn" id="otherdelete">
                        </i>
                        </td>
                            </tr>
                            <?php
                            $cnt=$cnt+1;
                            }
                        }
                            ?>
                     </tbody>
                 </table> 
              </div>
              </div>
              
            </div>
    </section>
</div>

