<?php require_once("includes/initialize.php");
 global $database;
 error_reporting(0);
ini_set('display_errors',0);

$atranzact='';
    $stranzact='';

if(isset($_POST['submit']))
{
    $id = $session->user_id;
    $message='';
    // $table = $_POST['payment'];
    $matricno = $_POST['matricno'];
    // $level = $_POST['level'];
    
    $_SESSION['matricno']=$matricno;
    
    
    // if ($table =='acceptance_tranzact'){
    //     if($level=='ND I'){
    //     $level='ND';
    // }else{
    //     $level='HND';
    // }
    
    // echo $table.' '. $formno.' '. $level;
     $guy =  ONLINEPAY::restrictBl();
     
      error_reporting(0);
    ini_set('display_errors',0);
      
    $atranzact = ONLINEPAY:: search_txtid($matricno);
    // }else if ($table =='schoolfees_tranzact'){
    $stranzact = ONLINEPAY:: search_schoolfees_txtid($matricno);
    // }
    
    // echo "Form No Fetched: ".$atranzact->formno;
    // if ($ftranzact->verified==0){
    //  foreach ($ftranzact as $student)
    //  {
    //     $student->formno;
    //     $student->surname;
    //     $student->department;
    //     $student->txt_ref;
    //     $student->faculty;
    //     $student->amount;
    //     $student->level;
    //     $sudent->session;
    //     $student->datetime;
    //  }
      
// echo $ftranzact->formno;
//   $findpic = ONLINEPAY:: find_pic($ftranzact->formno);
//  echo "piii ".$pix =  $findpic->pix;
   
 
// //   ONLINEPAY::update_txtid($table, $tranzID,$id);
// }else if (($ftranzact->verified==1)){
//         $d = date("jS \of F, Y", strtotime($ftranzact->verified_date));
//       $message='Student already verified on '.$d;
        
//     }
}

?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
-->
</style></head>
<body ng-app="iswapp">
<div class="container"><!-- container 1 -->
	<!-- row 1: navigation -->
	
    
            <div class="panel-group"><br>
                <form action="" method="post">
          
    			    
    			   
    			    
    			
    			<div class="row" style="text-align: center">
                  <div class="col-md-offset-0 col-md-11 col-md-offset-0">
                            
                            
                                
                <div class="panel panel-primary">
                    <div class="panel-heading">Payment Verification</div>
                    <div class="panel-body">
                               <!-- admission_status.php  --> 
                               
                                    <fieldset class="form-group">
                                        <!--<label for="formGroupExampleInput">Matric No: <?php //echo $ftranzact->formno;?></label>-->
                                        <input type="text" class="form-control" placeholder="Enter Student's Matric No"  name="matricno" id="tranzact" required />
                                    </fieldset>
                                    
                                    <input type="submit" class="btn btn-info" name="submit" id="submit" value ="Verify ID" data-toggle="tooltip"/>
                                    
                                
                    </div>
                     <?php if ($message !=''){
                                    echo '<center><span style="color:#F00">'.$message .'</span></center>';
                                }else {?>
                        <div name = "display">
                            
                            
                       <?php $count=0;?> 


<?php if (isset($atranzact->formno)){?>
                           <table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Payment Reference</th>
      <th scope="col">Matric No</th>
      <th scope="col">Surname</th>
      <th scope="col">Othernames</th>
      <th scope="col">Department</th>
      <th scope="col">Level</th>
      <th scope="col">Fees Type</th>
      <th scope="col">Amount</th>
      <th scope="col">Date of Transaction</th>
    </tr>
  </thead>
  <tbody class="table-group-divider">
      
     
    <tr>
      <th scope="row"><?php echo ++$count ?></th>
        <td><?php echo $atranzact->txt_ref ?></td>
      <td><?php echo $atranzact->formno ?></td>
      <td><?php echo strtoupper($atranzact->surname) ?></td>
      <td><?php echo strtoupper($atranzact->othernames) ?></td>
      <td><?php echo strtoupper($atranzact->department) ?></td>
      <td><?php echo strtoupper($atranzact->level.' I') ?></td>
      <td><?php echo strtoupper('Acceptance fee') ?></td>
      <td><?php echo $atranzact->amount ?></td>
      <td><?php echo $atranzact->datetime ?></td>
    </tr>
    <?php } ?>
    
    <?php if (!empty($stranzact)){?>
        
       <?php foreach($stranzact as $fees){?>
    <tr>
      <th scope="row"><?php echo ++$count ?></th>
      <td><?php echo $fees->txt_ref ?></td>
      <td><?php echo $_SESSION['matricno'] ?></td>
      <td><?php echo strtoupper($fees->surname) ?></td>
      <td><?php echo strtoupper($fees->othernames) ?></td>
      <td><?php echo strtoupper($fees->department) ?></td>
      <td><?php 
            if (($fees->level=='ND') OR ($fees->level=='HND')){
                    echo strtoupper($fees->level.' I');
            }
            else {
                
                 echo strtoupper($fees->level);
                
            }?></td>
      <td><?php echo strtoupper('School fee') ?></td>
      <td><?php echo $fees->amount ?></td>
      <td><?php echo $fees->datetime ?></td>
    </tr>
    <?php }?> 
    <?php }?>
   
  </tbody>
</table>
                            
                            
                            
                            <!--<label for="formGroupExampleInput"><img src ="<?php //echo $path."/".$pics; ?>"></label><br>
                            <label for="formGroupExampleInput"><? //echo $formno.$ftranzact->formno;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $surname.$ftranzact->surname;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $othername.$ftranzact->othernames;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $department.$ftranzact->department;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $level;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $ses.$ftranzact->session;?></label><br>
                            <label for="formGroupExampleInput"><? //echo $amount.$ftranzact->amount;?></label><br>
                            <label for="formGroupExampleInput"><h2><? //echo $status; ?></h2></label>
-->                        
                            </div>
                        </div>
                        </div>
                </div></form>
            </div>
        </div>
    </div>
</div> <!-- end container 1 -->
<div class="container"> <!-- container 2 -->
        
        
    </div>
    
</div><!-- end container 2 -->









<p></p>
<p align="center" style="font-size:10px;"><?php
		$yea = date("Y");
		 echo '&copy;'." ".$yea;?> OSCOTECH, Esa-Oke | Powered by: OSCOTECH ICT Directorate </p>
	</body>
</html>
<?php }?>





<!--<script type="text/javascript" language="javascript" >-->

<!--$(document).ready(function(){-->
<!--    $('#submit').on("click", function(e){-->
<!--        e.preventDefault(e);-->
        
<!--        var payment = $('#payment').val();-->
<!--        var tranzact = $('#tranzact').val();-->
<!--            {-->
<!--                $.ajax({-->
<!--                	url:"z_authen.php",-->
<!--                	method:"POST",-->
<!--                	data:{payment:payment,tranzact:tranzact},-->
<!--                	success:function(data)-->
<!--                	{-->
<!--                	    $('#display').html(data);-->
<!--                	}-->
<!--                });-->
<!--            }-->
<!--     });-->
         
<!-- });-->
<!-- </script>-->