<?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 | Advance Certificate 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:30px">OSUN STATE COLLEGE OF TECHNOLOGY, ESA-OKE</h1>
    	<h2 style="font-weight:bold; font-size:18px; text-decoration:underline"><?php echo $_SESSION['sek']?>  CBT SCREENING EXAMINATION SPREADSHEET REPORT</h2>
        <h2 style="font-weight:bold; font-size:18px;text-decoration:underline">HND <?php echo $_SESSION['programme']. " " .$_SESSION['courses']?> Daily-Part-Time</h2>
        <br>
        <table class="table table-bordered  table-condensed table-responsive" style="width:100%; font-size:12px">
        	<thead>
                <tr height="10px">
                    <th>S/N</th>
                    <th>FORM NO</th>
                    <th>FULL MAME</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>P/Schl</th>
                    <th>grd</th>
                    <th>yr</th>
                    <th style="background:#9F3">score</th>
                    <th>Remark</th>
                </tr>
            </thead>
        						<?php
								if($_SESSION['fromdate']=="" || $_SESSION['todate']==""){					
								$sql = mysql_query("SELECT admission_cbt_result.formno,admission_cbt_result.scores,
										admission_students_details.surname,admission_students_details.othernames,admission_students_details.sex,
										admission_students_details.sb1,admission_students_details.grd1,
										admission_students_details.sb2,admission_students_details.grd2,
										admission_students_details.sb3,admission_students_details.grd3,
										admission_students_details.sb4,admission_students_details.grd4,
										admission_students_details.sb5,admission_students_details.grd5,
										admission_students_details.sb6,admission_students_details.grd6,
										admission_students_details.sb7,admission_students_details.grd7,
										admission_students_details.sb8,admission_students_details.grd8,
										admission_students_details.sb9,admission_students_details.grd9,
										admission_students_details.higher1,admission_students_details.grade1,admission_students_details.yr1
										FROM admission_cbt_result, admission_students_details 
										WHERE admission_students_details.courses='{$_SESSION['courses']}' AND admission_cbt_result.formno LIKE '%DP%'
										AND admission_cbt_result.formno = admission_students_details.formno 
										AND admission_students_details.programme='HND'
										AND admission_students_details.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 width="230px"><?php echo $row['surname']. " " .$row['othernames'];?></td>
                                            <td width="20px"><?php echo substr($row['sb1'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd1'];?></td>
                                            <td width="20px"><?php echo substr($row['sb2'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd2'];?></td>
                                            <td width="20px"><?php echo substr($row['sb3'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd3'];?></td>
                                            <td width="20px"><?php echo substr($row['sb4'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd4'];?></td>
                                            <td width="20px"><?php echo substr($row['sb5'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd5'];?></td>
                                            <td width="20px"><?php echo substr($row['sb6'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd6'];?></td>
                                            <td width="20px"><?php echo substr($row['sb7'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd7'];?></td>
                                            <td width="20px"><?php echo substr($row['sb8'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd8'];?></td>
                                            <td width="20px"><?php echo substr($row['sb9'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd9'];?></td>
                                            <td width="100px"><?php echo substr($row['higher1'],0,15);?></td>
                                            <td width="10px"><?php echo substr($row['yr1'],2,4);?></td>
                                            <td width="20px"><?php echo substr($row['grade1'],0,3);?></td>
                                            <td width="20px" align="center" style="background:#9F3"><?php echo $row['scores'];?></td>
                                            <td width="50px">&nbsp;</td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                           <?php
								}else{
						   		$sql = mysql_query("SELECT admission_cbt_result.formno,admission_cbt_result.scores,
										admission_students_details.surname,admission_students_details.othernames,admission_students_details.sex,
										admission_students_details.sb1,admission_students_details.grd1,
										admission_students_details.sb2,admission_students_details.grd2,
										admission_students_details.sb3,admission_students_details.grd3,
										admission_students_details.sb4,admission_students_details.grd4,
										admission_students_details.sb5,admission_students_details.grd5,
										admission_students_details.sb6,admission_students_details.grd6,
										admission_students_details.sb7,admission_students_details.grd7,
										admission_students_details.sb8,admission_students_details.grd8,
										admission_students_details.sb9,admission_students_details.grd9,
										admission_students_details.higher1,admission_students_details.grade1,admission_students_details.yr1
										FROM admission_cbt_result, admission_students_details 
										WHERE admission_students_details.courses='{$_SESSION['courses']}' AND admission_cbt_result.formno LIKE '%DP%'
										AND admission_cbt_result.date_upload Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}'
										AND admission_cbt_result.formno = admission_students_details.formno 
										AND admission_students_details.programme='HND'
										AND admission_students_details.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 width="20px"><?php echo substr($row['sb1'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd1'];?></td>
                                            <td width="20px"><?php echo substr($row['sb2'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd2'];?></td>
                                            <td width="20px"><?php echo substr($row['sb3'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd3'];?></td>
                                            <td width="20px"><?php echo substr($row['sb4'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd4'];?></td>
                                            <td width="20px"><?php echo substr($row['sb5'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd5'];?></td>
                                            <td width="20px"><?php echo substr($row['sb6'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd6'];?></td>
                                            <td width="20px"><?php echo substr($row['sb7'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd7'];?></td>
                                            <td width="20px"><?php echo substr($row['sb8'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd8'];?></td>
                                            <td width="20px"><?php echo substr($row['sb9'],0,3);?></td>
                                            <td width="10px"><?php echo $row['grd9'];?></td>
                                            <td width="100px"><?php echo substr($row['higher1'],0,15);?></td>
                                            <td width="10px"><?php echo substr($row['yr1'],2,4);?></td>
                                            <td width="20px"><?php echo substr($row['grade1'],0,3);?></td>
                                            <td width="20px" align="center" style="background:#9F3"><?php echo $row['scores'];?></td>
                                            <td width="50px">&nbsp;</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();  ?>