<?php
session_start();
require_once("includes/initialize.php");
global $database;
// global $mail;
date_default_timezone_set('Africa/Lagos');



    $count = 0;
       
        $student_data = ONLINEPAY::find_omoluabi_cert_name('transcript_tranzact');
       
        
?>
<!DOCTYPE html>
<html lang="en">
  <head>

    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
    <meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">

    <title></title>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.css"/>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />            
        <link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />

  </head>
  <body>
       <div class="container">
           <form method="post" action="?type=certificate_tranzact" role="form" enctype="multipart/form-data">                        	
	        <div class="form-group input-group" align="center">
            <div class="col-sm-4">
    	    </div>
  <h2>SUMMARY OF TRANSCRIPT PAYMENT AS AT <?php echo date('d/m/Y h:i:s a')?></h2>
  
  
    <table class="table table-bordered table-hover table-condensed" id="myTable" name="myTable" style="width:95%; float:left; margin-top:20px">
        <thead>
            <tr class="info">
              <th><p align="center">S/N</p></th>
              <th><p align="center">Matric No.</p></th>
              <th><p align="center">Full Name</p></th>
              <th><p align="center">Level</p></th>
              <th><p align="center" >Amount Paid</p></th>
              <th><p align="center">Web ISO</p></th>
             
              <th><p align="center">Application Date</p></th>
             
            </tr>
        </thead>
        <tbody>

            <?php

        $totalAmount=0; $totalTransaction=0;
        if (isset($student_data) && !empty($student_data)){
             foreach ($student_data as $name)
             
             
        {
        
        if (strtolower($name->level)=='both'){
                 $cert='ND AND HND';
             }
            else if (strtolower($name->level)=='nd'){
                 $cert='ND';
            }else if (strtolower($name->level)=='hnd'){
                 $cert='HND';
            }else {
            $cert=strtoupper($name->level);
                
           }
        
        
        
        
        ?>
        
        <?php
        $totalAmount +=$name->amount;
        $totalTransaction +=$name->txt_fees;
        ?>
        <tr>
               <td align="center"><?php echo ++$count; ?></td>
               <td align="center"><?php echo $name->matricno; ?></td>
               <td align="center"><?php echo strtoupper($name->fullname); ?></td>
               <td align="center"><?php echo $cert; ?></td>
               <td align="center"><?php echo $name->amount; ?></td>
                <td align="center"><?php echo $name->txt_fees; ?></td>
               <td align="center"><?php echo $name->datetime; ?></td>
               
             </tr>
             
        <?php } } ?>
          
             
   

        </tbody>
        <tr class="info">
          <th><p align="center">S/N</p></th>
          <th><p align="center">Matric No.</p></th>
          <th><p align="center">Full Name</p></th>
          <th><p align="center">Level</p></th>
          <th><p align="center">Amount paid</p></th>
          <th><p align="center">Web ISO</p></th>
         
          <th><p align="center">Application Date</p></th>
          
        </tr>
        
        <tr>
            <th colspan="7" style="text-align:center"> SUMMARY OF THE TRANSCRIPT NARRATIVES</th>
        </tr>
        
        <tr>
            <td colspan="4" style="text-align:right">Total number of applicants</td>
             
              <td colspan="3"><?php echo $count; ?></td>
        </tr>
        
        <tr>
            <td colspan="4" style="text-align:right">Total amount received</td>
             
              <td colspan="3"><?php echo $totalAmount;?></td>
        </tr>
        
        <tr>
            <td colspan="4" style="text-align:right">Total transaction charges received</td>
             
              <td colspan="3"><?php echo $totalTransaction; ?></td>
        </tr>
        
    </table>
</div>
        </div>
        </form>
</br></br>
        

</div>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
   <script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>  
   <script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
  <script type="text/javascript" src="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.js"></script>

    <!-- FOR DataTable -->
    <script>
      {
        $(document).ready(function()
        {
          $('#myTable').DataTable();
        });
      }
    </script>

    <!-- this function is for modal -->
    <script>
      $(document).ready(function()
      {
        $("#myBtn").click(function()
        {
          $("#myModal").modal();
        });
        
        
    });

</script>
        
        
        
        
        
        
        
        
     
    </script>
  </body>
</html>