<?php 
require_once("includes/initialize.php");
$alldept = ONLINEPAY::showpayment_online('admitted_students');
$count = 0;

function fetch_all_depart()
{
    foreach($alldept as $pay) 
    {
        $output .= '<tr>
        			.<td>'.++$count.'</td>
        			.<td>'.$pay->formno.'</td>
        			.<td>'.$pay->surname.'</td>
        			.<td>'.$pay->othernames.'</td>
        			.<td>'.$pay->department.'</td>
        			.<td>'.$pay->sex.'</td>
        			.<td>'.$pay->level.'</td>
        			.<td>'.$pay->session.'</td>
        			.<td>'.$pay->admitted_date.'</td>
        		.</tr>'; 
    }
    return $output;
}

if(isset($_POST['all_dept']))
{
    echo '<table id="admin_table" class="table table-striped table-bordered">
            <thead>
                  <tr height="20">
                      <th>S/N</th>  
                      <th>FORM NO</th>
                      <th>SURNAME</th>     
                      <th>OTHER NAMES</th>
                      <th>DEPARTMENT</th>
                      <th>SEX</th>
                      <th>LEVEL</th>
                      <th>SESSION</th>
                      <th>DATE/TIME</th>                         
                  </tr>
            </thead>';
    		foreach($alldept as $pay) 
            {
                echo'<tr>'
                	.'<td>'.++$count.'</td>'
                	.'<td>'.$pay->formno.'</td>'
                	.'<td>'.$pay->surname.'</td>'
                	.'<td>'.$pay->othernames.'</td>'
                	.'<td>'.$pay->department.'</td>'
                	.'<td>'.$pay->sex.'</td>'
                	.'<td>'.$pay->level.'</td>'
                	.'<td>'.$pay->session.'</td>'
                	.'<td>'.$pay->admitted_date.'</td>'
                .'</tr>';   
				
            }
          echo '</table>';
}
          
?>




