<?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 >Weekend Part-Time List</title>


        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Weekend Part-Time 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="session" class="form-control" id="session">
                                            <option value="">--Select Session--</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>
                                        </select>
                                    </td>
                                    <td>
				                       <input type="text" class="form-control" placeholder="From: yyyy-mm-dd"name="fromdate" title="Uploading Date " autocomplete="on">
                                    </td>
                                    <td>
				                       <input type="text" class="form-control" placeholder="To: yyyy-mm-dd"name="todate" title="Uploading Date " autocomplete="on">
                                    </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>FORM NO</th>
                                            <th>SURNAME</th>
                                            <th>OTHER NAMES</th>            
                                            <th>SEX</th>
                                            <th>sb1</th>
                                            <th>grd</th>
                                            <th>sb2</th>
                                            <th>grd</th>
                                            <th>sb3</th>
                                            <th>grd</th>
                                            <th>sb4</th>
                                            <th>grd</th>
                                            <th>sb5</th>
                                            <th>grd</th>
                                            <th>sb6</th>
                                            <th>grd</th>
                                            <th>sb7</th>
                                            <th>grd</th>
                                            <th>sb8</th>
                                            <th>grd</th>
                                            <th>sb9</th>
                                            <th>grd</th>
                                            <th>Reg Date</th>
                                        </tr>
                                    </thead>
					<?php
							$_SESSION['sek']= $_POST['session'];
							$_SESSION['courses']= $_POST['courses'];
							$_SESSION['fromdate']= $_POST['fromdate'];
							$_SESSION['todate']= $_POST['todate'];
							$courses=$_POST['courses'];
						
							echo $courses, $_POST['session'], $_POST['todate'];
							
                        	if($_POST[fromdate]=="" || $_POST[todate]=="")
								$sql = mysql_query("SELECT surname,othernames,sex,formno,
										sb1,grd1,sb2,grd2,sb3,grd3,sb4,grd4,sb5,grd5,
										sb6,grd6,sb7,grd7,sb8,grd8,sb9,grd9,reg_date
										FROM admitted_student_details_2019
										WHERE  type='CA' AND department = '$courses'
                                                                                AND level = 'ND'
                                                                                ");
							
                           // AND status = 'not-admitted'
                        $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['formno'];?></td>
                                            <td><?php echo $row['surname'];?></td>
                                            <td><?php echo $row['othernames'];?></td>
                                            <td><?php echo $row['sex'];?></td>
                                            <td><?php echo $row['sb1'];?></td>
                                            <td><?php echo $row['grd1'];?></td>
                                            <td><?php echo $row['sb2'];?></td>
                                            <td><?php echo $row['grd2'];?></td>
                                            <td><?php echo $row['sb3'];?></td>
                                            <td><?php echo $row['grd3'];?></td>
                                            <td><?php echo $row['sb4'];?></td>
                                            <td><?php echo $row['grd4'];?></td>
                                            <td><?php echo $row['sb5'];?></td>
                                            <td><?php echo $row['grd5'];?></td>
                                            <td><?php echo $row['sb6'];?></td>
                                            <td><?php echo $row['grd6'];?></td>
                                            <td><?php echo $row['sb7'];?></td>
                                            <td><?php echo $row['grd7'];?></td>
                                            <td><?php echo $row['sb8'];?></td>
                                            <td><?php echo $row['grd8'];?></td>
                                            <td><?php echo $row['sb9'];?></td>
                                            <td><?php echo $row['grd9'];?></td>
                                            <td><?php echo $row['reg_date'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                          
                        </div>
                        <!-- /.panel-body --> 
                    </div> 
                    <!-- /.panel -->
                    	<center>
                       		<a href="wpt_nd_spreadsheet.php" target="_new" class="btn btn-success">Send to Printer</a>
                        </center>
                    </form>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->

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

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