<?php
error_reporting(0);
define('INCLUDE_CHECK',true);
session_start();
require ('classes/config.php');
require_once('classes/session.php');
			 		   
?>



<!DOCTYPE html>
<html>
<head>
<title>OSCOTECH | Admitted List</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:25px">OSUN STATE COLLEGE OF TECHNOLOGY, ESA-OKE</h1>
        <h2 style="font-weight:bold; font-size:16px; text-decoration:underline"><?php echo $_SESSION['sek']?>  CONCESSIONARY ADMISSION LIST</h2>
    	<h2 style="font-weight:bold; font-size:16px;text-decoration:underline"> PART - TIME <?php echo $_SESSION['programme']. " " .$_SESSION['courses']?> ADMITTED SHEET</h2>
        <br>
        <table class="table table-bordered  table-condensed table-responsive" style="width:750px; font-size:12px">
        	<thead>
                <tr height="10px">
                    <th>S/N</th>
                    <th>FORM NO</th>
                    <th>SURNAME</th>
                    <th>OTHERNAMES</th>
                    <th>SEX</th>
                    <th>REMARK</th>
                </tr>
            </thead>
        						<?php
								if($_SESSION[fromdate]!="" || $_SESSION[todate]!="")
								$sql = mysql_query("SELECT admission_status.formno,admission_status.status,
										admission_status.type,admission_status.entry,
										admission_2018_students_details.surname,admission_2018_students_details.othernames,
										admission_2018_students_details.courses,admission_2018_students_details.sex,admission_2018_students_details.phone 
										FROM admission_status, admission_2018_students_details 
										WHERE admission_2018_students_details.programme='$_SESSION[programme]' 
										AND admission_status.session='$_SESSION[sek]' 
										AND admission_status.formno = admission_2018_students_details.formno 
										AND admission_status.date_admitted Between '$_SESSION[fromdate]' 
										AND '$_SESSION[todate]' AND admission_status.type='CON' 
										AND admission_status.formno LIKE '%CA%'
										AND admission_2018_students_details.courses='$_SESSION[courses]'
										ORDER BY admission_2018_students_details.courses,admission_status.type ASC");		

							elseif($_SESSION[courses]!="" || $_SESSION[programme]!="" || $_SESSION[session]!="" || $_SESSION[fromdate]!="" || $_SESSION[todate]!="")
								$sql = mysql_query("SELECT admission_status.formno,admission_status.status,admission_status.type,
										admission_status.entry,
										admission_2018_students_details.surname,admission_2018_students_details.othernames,
										admission_2018_students_details.courses,admission_2018_students_details.sex,admission_2018_students_details.phone 
										FROM admission_status, admission_2018_students_details 
										WHERE admission_2018_students_details.programme='$_SESSION[programme]' 
										AND admission_status.session='$_SESSION[sek]' 
										AND admission_status.formno = admission_2018_students_details.formno 
										AND admission_status.type='CON'
										AND admission_status.formno LIKE '%CA%'
										AND admission_2018_students_details.courses='$_SESSION[courses]'
										ORDER BY admission_2018_students_details.courses,admission_status.type ASC");
													
							else							
								$sql = mysql_query("SELECT admission_status.formno,admission_status.status,admission_status.type,
										admission_status.entry,admission_status.entry,
										admission_2018_students_details.surname,admission_2018_students_details.othernames,
										admission_2018_students_details.courses,admission_2018_students_details.sex,admission_2018_students_details.phone
										FROM admission_status, admission_2018_students_details 
										WHERE admission_status.formno = admission_2018_students_details.formno
										AND admission_status.type='CON'
										AND admission_status.formno LIKE '%CA%'
										ORDER BY admission_2018_students_details.formno ASC");
                           
                        $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="100px"><?php echo $row['formno'];?></td>
                                            <td width="120px"><?php echo $row['surname'];?></td>
                                            <td width="180px"><?php echo $row['othernames'];?></td>
                                            <td width="50px"><?php echo $row['sex'];?></td>
                                            <td width="50px"></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();  ?>