<?php


require "spconfig.php";



  if (!isset($_SESSION['CREATED'])) {
              $_SESSION['CREATED'] = time();
        } else if (time() - $_SESSION['CREATED'] > 1800) {
            session_destroy();
 echo '<meta http-equiv=REFRESH CONTENT=0;url=timeout.php>';
        }  else {$_SESSION['CREATED'] = time(); 
		}		
	if (isset($_SESSION['URL'])) {
		$URL = $_SESSION['URL'];
	}

$today = date("Y-m-d");
$sql= mysqli_query($splink,"Select SCHYEAR from SCHYEAR where activeyear=\"1\"");
while ($row = mysqli_fetch_row($sql)){
	$todayschyr = $row[0];
}
	$msg = "";



		$sql = mysqli_query($splink, "Select MAX( CASE WHEN grade=\"A\" THEN gradeyear END ) ,MAX( CASE WHEN grade=\"B\" THEN gradeyear END) , MAX(CASE WHEN grade=\"C\" THEN gradeyear END ) from gradeyear where SCHYEAR = \"".$todayschyr."\"");
		while ($row = mysqli_fetch_row($sql)){
			$gradeAyr= $row[0];
			$gradeByr = $row[1];
			$gradeCyr = $row[2];
		}



?>