<?php
error_reporting(0);
define('INCLUDE_CHECK',true);
session_start();
require ('classes/config1.php');
//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:10px">OSUN STATE COLLEGE OF TECHNOLOGY, ESA-OKE</h1>
        <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']?>  NATIONAL DIPLOMA WEEKEND 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" border="1">
        	<thead>
        	    
        	    <tr height="10">
                                            <th>S/N</th>
                                            <th>FORM NO</th>
                                            <th>SURNAME</th>
                                                       
                                            <th>SEX</th>
                                            <th>sub1</th>
                                            
                                            <th>sub2</th>
                                           
                                            <th>sub3</th>
                                            
                                            <th>sub4</th>
                                           
                                            <th>sub5</th>
                                               
                                           <th>Reg_date</th>
                                             <th>Institution</th>
                                            <th>Year</th>
                                            <th>Grade</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 admitted_student_details_2019 
							//			WHERE type='CA' AND department = '{$_SESSION['courses']}'
							//			AND level = 'HND'
							//			");
			
			                //	$sql = mysql_query("SELECT student_account.id, student_account.level, student_account.activated, student_account.surname, student_account.othernames,student_account.progtype, form_data.sex,form_data.formno,
                            //	student_account.date, academics_data.sub1,academics_data.sub2,academics_data.sub3,academics_data.sub4,academics_data.sub5, academics_data.institution,
                            //	academics_data.grag, academics_data.gragd
                            //	FROM  academics_data, form_data, student_account 
                            //	WHERE  student_account.level='PGD' AND 
                           // 	 student_account.progtype='PGD' AND
                           // 	student_account.activated='Y' AND student_account.department = '$_SESSION[courses]' AND form_data.acc_id=student_account.id 
                           // 	ANd academics_data.acc_id=student_account.id AND form_data.formno LIKE '%FT2%' AND student_account.date Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}' order by form_data.formno");
                                                                               
			
				if($_SESSION['sek']=='2020/2021' )
				
			                	$sql = ("SELECT student_account.id, student_account.level, student_account.activated, student_account.surname, student_account.othernames, form_data.sex,form_data.formno,
                            	student_account.date, academics_data.sub1,academics_data.sub2,academics_data.sub3,academics_data.sub4,academics_data.sub5, academics_data.institution,
                            	academics_data.grag, academics_data.gragd
                            	FROM  academics_data, form_data, student_account 
                            	WHERE  student_account.level='HND' AND student_account.activated='Y' AND student_account.department = '$_SESSION[courses]' AND form_data.acc_id=student_account.id 
                            	ANd academics_data.acc_id=student_account.id AND form_data.formno LIKE '%CA2%' AND student_account.date Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}'");
                                                                               
			
									//	AND status = 'not-admitted'
                elseif($_SESSION['sek']=='2021/2022' )
				
			                	$sql = ("SELECT student_account.id, student_account.level, student_account.activated, student_account.surname, student_account.othernames, form_data21.sex,form_data21.formno,
                            	student_account.date, academics_data.sub1,academics_data.sub2,academics_data.sub3,academics_data.sub4,academics_data.sub5, academics_data.institution,
                            	academics_data.grag, academics_data.gragd
                            	FROM  academics_data, form_data21, student_account 
                            	WHERE  student_account.level='HND' AND student_account.activated='Y' AND student_account.department = '$_SESSION[courses]' AND form_data21.acc_id=student_account.id 
                            	ANd academics_data.acc_id=student_account.id AND form_data21.formno LIKE '%CA2%' AND student_account.date Between '{$_SESSION['fromdate']}' AND '{$_SESSION['todate']}'");
                                                                               
			          $result = $conn->query($sql); 
									//	AND status = 'not-admitted'
                        $i=0;
                       // while($row=mysql_fetch_array($sql)){
                        while($row = $result->fetch_assoc()) {
                        $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 $row['sex'];?></td>
                                            <td width="20px"><?php echo $row['sub1'];?></td>
                                           
                                            <td width="20px"><?php echo $row['sub2'];?></td>
                                            
                                            <td width="20px"><?php echo $row['sub3'];?></td>
                                             
                                            <td width="20px"><?php echo $row['sub4'];?></td>
                                             
                                            <td width="20px"><?php echo $row['sub5'];?></td>
                                              
                                            <td width="50px"><?php echo substr($row['date'],0,10);?></td>
                                             
                                             <td width="90px"><?php echo substr($row['institution'],0,15);?></td>
                                            <td width="20px"><?php echo substr($row['gragd'],0,4);?></td>
                                            <td width="20px"><?php echo substr($row['grag'],0,3);?></td>
                                            <td width="40px">&nbsp;</td>
                                        </tr>
                                    </tbody>
                          <?php	
							}														
							?>
                                </table>
                           <?php
					//		 }													
							?>
                                </table>
						   

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

<?php $conn->close();  ?>