<?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 > Form Editing</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">HND Departmental 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='ND'");
                                                    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="Adv. Cert.">Advance Certificates</option>
                                            <option value="ND">National Diploma</option>
                                            <option value="HND">Higher National Diploma</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="type" class="form-control" id="type">
                                            <option value="">--Select Session--</option>
                                            <option value="PU">Post UTME</option>
                                            <option value="DP">Daily-Part-Time</option>
                                            <option value="FT">Full Time HND</option>
                                        </select>
                                    </td>
                                    <td>
                                    	<select name="session" class="form-control" id="session">
                                            <option value="">--Select Session--</option>
                                            <option value="2015/2016">2015/2016</option>
                                            <option value="2016/2017">2016/2017</option>
                                            <option value="2017/2018">2017/2018</option>
                                            <option value="2018/2019">2018/2019</option>
                                            <option value="2019/2020">2019/2020</option>
                                            <option value="2020/2021">2019/2020</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>
                    <div class="panel panel-default">
                        <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>
                                            <th>S/N</th>
                                            <th>FORM NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAMES</th>            
                                            <th>SEX</th>
                                            <th>PHONE</th>
                                            <th>PROGRAMME</th>
                                        </tr>
                                    </thead>
					<?php
							$programme=$_POST['programme'];
							$sek= $_POST['session'];
							$courses=$_POST['courses'];
							$type=$_POST['type'];
							
							echo $courses,$programme,$sek,$type;
							
                        	if($courses=="" || $type=="" || $session=="" || $programme=="")
								echo "<span style=color:#f00;>No Record to Display</span>";
							else
                            	$sql=mysql_query("SElECT * FROM admission_students_details WHERE courses='$courses' AND formno LIKE '%$type%' AND programme LIKE '%$programme%'");
                            
                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
							$emailS=$row['email'];
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
                    ?>
                                    <tbody>
                                        <tr >
                                        	<td><?php echo $i;?></td>
                                            <td><?php echo $row['formno'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othernames'];?></td>
                                            <td><?php echo $row['sex'];?></td>
                                            <td><?php echo $row['phone'];?></td>
                                            <td><?php echo $row['programme'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                            
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

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

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