<?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 | CBT sccreening Examination Result</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']?>  CONTINUOUS ACADEMIC PROGRAMME SPREADSHEET REPORT</h2>
        <h2 style="font-weight:bold; font-size:18px;text-decoration:underline"> HND -  <?php echo $_SESSION['courses']?> Weekend 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>yr</th>
                    <th>grd</th>
                    <th>R_date</th>
                    <th>Remark</th>
                </tr>
            </thead>
        						<?php
								if($_SESSION['fromdate']=="" || $_SESSION['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,
										higher1,grade1,yr1
										FROM admission_2018_students_details 
										WHERE type='CA' AND courses = '{$_SESSION['courses']}'
										AND programme = 'Adv. Cert.'");
                           
                        $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="80px"><?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="40px"><?php echo substr($row['reg_date'],5);?></td>
                                            <td width="40px">&nbsp;</td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                           <?php
								}else{
						   		$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,
										higher1,grade1,yr1
										FROM admission_2018_students_details 
										WHERE courses='{$_SESSION['courses']}' AND formno LIKE '%CA%'
										AND reg_date Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}' AND type='CA'
										AND programme LIKE '%Adv. Cert.%'
										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 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="80px"><?php echo $row['reg_date'];?></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();  ?>