<?php
error_reporting(0);
define('INCLUDE_CHECK',true);
session_start();
require ('classes/config.php');
require_once('classes/session.php');
	
if ($_SESSION['level'] == 'PU'){$ty = 'ND FULL-TIME';}
else{$ty = 'HND FULL-TIME';}
?>



<!DOCTYPE html>
<html>
<head>
<title>OSCOTECH | Applicant List Report</title>
<link href="http://oscotechesaoke.edu.ng/admission_portal/layout/css/bootstrap.login.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://oscotechesaoke.edu.ng/admission_portal/layout/css/login.css" rel="stylesheet" type="text/css" media="all" />		
<link rel="shortcut icon" href="../images/favicon.ico">
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
<style type="text/css">
	body{margin-top:-40px; padding:0; top:0;}
</style>
</head>
<body>
	<div style="width:97%; margin:0 auto"> 
        <center>
        <h1 style="font-weight:bold; font-size:30px">OSUN STATE COLLEGE OF TECHNOLOGY, ESA-OKE</h1>
    	<h2 style="font-weight:bold; font-size:18px; text-decoration:underline"><?php echo $_SESSION['sek']?>  APPLICANT SPREADSHEET REPORT</h2>
        <h2 style="font-weight:bold; font-size:18px;text-decoration:underline"> <?php echo $ty . " " .$_SESSION['courses']?></h2>
        <br>
        <table class="table table-bordered  table-condensed table-responsive" style="width:100%; font-size:12px">
        	<thead>
                <tr height="10">
                    <th>S/N</th>
                    <th>FORM NO</th>
                    <th>SURNAME</th>
                    <th>EMAIL</th>
                    <th>PHONE</th>
                    <th>STATE</th>
                    <th>Reg Date</th>
                </tr>
            </thead>
        						<?php
								if($_SESSION['fromdate']=="" || $_SESSION['todate']==""){					
								$sql = mysql_query("SELECT * FROM admission_2018_students_details 
										WHERE courses='{$_SESSION['courses']}' AND type='{$_SESSION['level']}' 	AND session='{$_SESSION['sek']}'");
                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
												
                    ?>
                                    <tbody>
                                        <tr height="10px" >
                                        	<td width="30px"><?php echo $i;?></td>
                                            <td width="10px"><?php echo $row['formno'];?></td>
                                            <td><?php echo $row['surname']. " " .$row['othernames'];?></td>
                                            <td><?php echo strtolower($row['email']);?></td>
                                            <td><?php echo $row['phone'];?></td>
                                            <td><?php echo $row['state'];?></td>
                                            <td><?php echo $row['reg_date'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                           <?php
								}else{
						   		$sql = mysql_query("SELECT * FROM admission_2018_students_details 
									WHERE courses='{$_SESSION['courses']}' AND type='{$_SESSION['level']}'	AND date_upload Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}'
									AND session='{$_SESSION['sek']}'");
                           
                        $i=0;
                        while($row=mysql_fetch_array($sql)){
                        $i++;
                        $color=($i%2==0)?"lightblue":"white";
												
                    ?>
                                    <tbody>
                                        <tr height="10px" >
                                        	<td width="30px"><?php echo $i;?></td>
                                            <td width="10px"><?php echo $row['formno'];?></td>
                                            <td><?php echo $row['surname']. " " .$row['othernames'];?></td>
                                            <td><?php echo strtolower($row['email']);?></td>
                                            <td><?php echo $row['phone'];?></td>
                                            <td><?php echo $row['state'];?></td>
                                            <td><?php echo $row['reg_date'];?></td>
                                        </tr>
                                    </tbody>
                          <?php	
							}}													
							?>
                                </table>
						   

        </center>
    </div>
    	<br>
    <center>
   		<INPUT TYPE="button" class="btn btn-success " VALUE="PRINT" ONCLICK="self.print();">
    </center>
    <br>
</body>
</html>

<?php mysql_close();  ?>