<?php 
require_once("./includes/initialize.php");
global $database;

session_start();
    $dept = $_POST['department'];
    $lev = $_POST['level'];
    $prog = $_POST['programme'];
    // echo $dept.$prog;
    $_SESSION['department'] =  $dept;
    $_SESSION['level'] =  $lev;
    $_SESSION['programme'] =  $prog;
    if($dept != "" || $lev != "" || $prog != "")
    {
        $get_mat = ONLINEPAY:: view_matricno($dept,$lev,$prog);
    }
    if ($lev == 'ND' && $prog == 'PU')
    {
        $msg = 'National Diploma On Full-Time Programme '.$dept;
    }
    elseif ($lev == 'ND' && $prog == 'DP')
    {
        $msg = 'National Diploma On Daily Part-Time Programme '.$dept;
    }elseif ($lev == 'HND' && $prog == 'FT')
    {
        $msg = 'Higher National Diploma On Full-Time Programme '.$dept;
    }elseif ($lev == 'HND' && $prog == 'DP')
    {
        $msg = 'Higher National Diploma On Daily Part-Time Programme '.$dept;
    }
    

$count = 0;
          echo '<table id="admin_table" class="table table-striped table-bordered">
                              <thead>
                                      <tr height="20">
                                          <th>S/N</th>  
                                          <th>FORM NO</th>
                                          <th>MATRIC NO</th>
                                          <th>SURNAME</th>     
                                          <th>OTHER NAMES</th>
                                          <th>EMAIL</th>
                                          <th>DEPARTMENT</th>
                                          <th>LEVEL</th>                         
                                      </tr>
                                  </thead> 
                                  </div> </div>';            
            		foreach($get_mat as $mat) 
                    {
                        echo '<tbody>
                                    <tr>'
            							.'<td>'.++$count.'</td>'
            							.'<td>'.$mat->formno.'</td>'
            							.'<td>'.$mat->matricno.'</td>'
            							.'<td>'.$mat->surname.'</td>'
            							.'<td>'.$mat->othernames.'</td>'
            							.'<td>'.$mat->email.'</td>'
            							.'<td>'.$mat->department.'</td>'
            							.'<td>'.$mat->level.'</td>'
            						.'</tr>'
    						.'</tbody>'; 
                    } 
                    // echo '</table>';
                    
                    
                    
    //   }else{echo 'No Session90 Post';}
?>