<?php 
require_once("includes/initialize.php");
//$alldept = ONLINEPAY::showdept();
$date='';
$output='';

if (isset($_GET['type']) && ($_GET['type']=='certificate_pending')){
    //echo "test";
    $_SESSION['pending']= $_GET['type'];
 $details= ONLINEPAY::find_other_certificate_details_pending('certificate_tranzact');
   
$i=0;
 $date = strtotime($candidate->datetime);
 
 $output='<h1 style="text-align:center; margin-bottom:20px; color: #F55">Certificate Request: Pending List
 <input type="submit" name="submit" value="Print" id="print" class="btn btn-danger" style="float:right; font-weight:bolder">
 </h1>';
$output.='
<table  class="table table-striped table-bordered" style="width:100%; height:100px; overflow:scroll; background-color:; margin-left:8px">
<tr><th>S/N</th><th>FUll Name</th> <th>Department</th> <th>Programme type</th> <th>Requesting Certificate</th> <th>Graduated Session</th><th>Study Center</th><th>Application Date</th></tr>';

if (sizeof($details)>0){
      
    
foreach ($details as $candidate){



$output.= '<tr><td>'. ++$i  .'</td>






<td >'. $candidate->fullname .'</td>
<td>'. $candidate->department. '</td>';

if ($candidate->ptype =='FT'){
$output.='<td>'. $candidate->ptype='Full Time'.'</td>';
}else if ($candidate->ptype =='DP'){
$output.='<td>'. $candidate->ptype='Daily Part Time'.'</td>';
}else if ($candidate->ptype =='PT'){
$output.= '<td>'.$candidate->ptype='Part Time'.'</td>';
}else if ($candidate->ptype =='EAP'){
$output.='<td>'.$candidate->ptype='Evening Academic Program'.'</td>';
}else if ($candidate->ptype =='certificate'){
$output.='<td>'. $candidate->ptype='Certificate'.'</td>';
}else if ($candidate->ptype =='advancecertificate'){
$output.='<td>'. $candidate->ptype='Advance Certificate'.'</td>';
}else if ($candidate->ptype =='PGD'){
$output.='<td>'. $candidate->ptype='PGD'.'</td>';
}


 if ($candidate->level =='nd'){
 $output.='<td>'. $candidate->level='ND'.'</td>';
}else if ($candidate->level =='hnd'){
$output.= '<td>'. $candidate->level='HND'.'</td>';
}else if ($candidate->level =='both'){
$output.='<td>'. $candidate->level='ND AND HND'.'</td>';
}else if ($candidate->level =='certificate'){
$output.='<td>'. $candidate->level='Certificate'.'</td>';
}else if ($candidate->level =='advancecertificate'){
$output.='<td>'. $candidate->level='Advance Certificate'.'</td>';
}else if ($candidate->level =='pgd'){
$output.='<td>'. $candidate->level='PGD'.'</td>';
}





$output.='<td>'. $candidate->session.'</td>

<td> '. $candidate->center .'  </td>

<td>'.$date = strftime($candidate->datetime) ; 
date($date). '</td>
</tr>';

 } 


  }


$output .='</table>';

echo $output;

}


?>

<script type="text/javascript">




$(document).ready(function() {
    
$('#print').on("click", function(e){
    e.preventDefault(e);
    
   
        {
    		window.open("certificate_report.php");
        }
 });
    
});

</script>
