<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config.php');
	require_once('classes/session.php');
	
	
?>
<title>OSCOTECH, ESA-OKE :: Admin-Dashboard > Previous Registered Students List</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Previous Registered Students List</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                	<div class="well" style="background:#FFF">
                    	<form method="post" action="" role="form">                        	
                        	<div class="form-group input-group">
                        	<table class="table table-bordered table-hover">
                            	<tr>
                                	<td>
                                        <select name="courses" id="courses"  class="form-control">
                                          <option value="">-- Select Department -- </option>
                                            <?php 
                                                    $getdept = mysql_query("SELECT department FROM school_setup WHERE programme='BF'");
                                                    while($row = mysql_fetch_array($getdept)){
                                                ?>
                                                    <option value="<?php echo $row['department'] ?>"><?php echo $row['department']?></option>
                                                <?php
                                                    }
                                            ?>
                                        </select>
                                	</td>
                                    <td>
                                    	<select name="programme" class="form-control" id="programme">
                                            <option value="">--Select Programme--</option>
                                            <option value="Cert.">Certificates</option>
                                            <option value="AD">Advance Certificates</option>
                                            <option value="ND">National Diploma</option>
                                            <option value="HND">Higher National Diploma</option>
                                            <option value="PGD">Post Graduate Diploma</option>
                                            <option value="PreND">Basic and Foundational Studies</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="mode" class="form-control" id="mode">
                                            <option value="">--Select Mode--</option>
                                            <option value="FT">Full Time</option>
                                            <option value="DPT">Daily Part-Time</option>
                                            <option value="PT">Weekend Part-Time</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="session" class="form-control" id="session">
                                            <option value="">--Select Session--</option>
                                            <option value="2009/2010">2009/2010</option>
                                            <option value="2010/2011">2010/2011</option>
                                            <option value="2011/2012">2011/2012</option>
                                            <option value="2012/2013">2012/2013</option>
                                            <option value="2013/2014">2013/2014</option>
                                            <option value="2014/2015">2014/2015</option>
                                        </select>
                                    </td>
                                	<td>
                                        <span class="input-group-btn">
                                            <input type="submit" class="btn btn-danger" name="btnsearch" value="Search" id="button-search" title="Search Student">
                                        </span>
                                    </td>
                             	</tr>
                            </table>
                            </div>
                        </form>
                    </div>
                    <form action="" method="post">
                    <div class="panel panel-primary chat-panel">
                        <div class="panel-heading ">
                            Student Details Table
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                        <tr height="20">
                                            <th>S/N</th>
                                            <th>MATRIC NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAMES</th>
                                            <th>FACULTY</th>
                                            <th>DEPARTMENT</th>
                                            <th>PROGRAMME</th>
                                            <th>MODE</th>
                                            <th>SESSION</th>
                                        </tr>
                                    </thead>
					<?php
							$_SESSION['sek']= $_POST['session'];
							$_SESSION['courses']= strtoupper($_POST['courses']);
							$_SESSION['programme']= strtoupper($_POST['programme']);
							$_SESSION['mode']= strtoupper($_POST['mode']);
						
							echo $_POST[courses],$_POST[programme],$_POST[mode],$_POST[session];
							
                        	if($_POST[course]=="" AND  $_POST[programme]=="" AND $_POST[mode]=="" AND $_POST[session]=="")
								$sql = mysql_query("SELECT * FROM registered_bank 
										ORDER BY department,session,level,mode ASC");
										
							else
								$sql = mysql_query("SELECT * FROM registered_bank
										WHERE courses='$_POST[courses]' 
										AND programme='$_POST[programme]'
										AND session='$_POST[session]'
										AND mode='$_POST[mode]'
										ORDER BY department,session,level,mode ASC");	
                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $i;?></td>
                                            <td><?php echo $row['matric_no'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othernames'];?></td>
                                            <td><?php echo $row['faculty'];?></td>
                                            <td><?php echo $row['department'];?></td>
                                            <td><?php echo $row['level'];?></td>
                                            <td><?php echo $row['mode'];?></td>
                                            <td><?php echo $row['session'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}
							if ($_SESSION['programme']=='PreND'){ ($_SESSION['pass'] ="PND") AND ($_SESSION['entry'] ="Foundational and Basic Studies-1year"); }
							if ($_SESSION['programme']=='Cert'){ ($_SESSION['pass'] ="CER") AND ($_SESSION['entry'] ="Certificate"); }
							if ($_SESSION['programme']=='ADV'){ ($_SESSION['pass'] ="ADV") AND ($_SESSION['entry'] ="Advance Certificate");}
							if ($_SESSION['programme']=='ND'){ ($_SESSION['pass'] ="DPT") AND ($_SESSION['entry'] ="National Diploma Daily Part Time-2years");}
							if ($_SESSION['programme']=='HND'){ ($_SESSION['pass'] ="HND") AND ($_SESSION['entry'] ="Higher National Diploma, FULL TIME-2 years");}
							if ($_SESSION['programme']=='PGD'){ ($_SESSION['pass'] ="PGD") AND ($_SESSION['entry'] ="Post Graduate Diploma, FULL TIME-1 year");}
							if ($_SESSION['programme']=='Weekend Part-Time'){ ($_SESSION['pass'] ="WPT") AND ($_SESSION['entry'] ="National Diploma"); }														
														
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                          
                        </div>
                        <!-- /.panel-body --> 
                    </div> 
                    <!-- /.panel -->
                    	<center>
                       		<!-- <a href="#" target="_new" class="btn btn-success">ADMITTED</a> -->
                            <input type="submit" class="btn btn-success" value="Send to Printer" name="adm" />
                            <p>&nbsp;</p>
                        </center>
                    </form>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

        </div>
        <!-- /#page-wrapper -->
       

    </div>
    <!-- /#wrapper -->
    
