<?php
session_start();
include("header.php");
if(trim($_SESSION['accountName'])=="" &&  trim($_SESSION['accountID'])=="" && trim($_SESSION['pgid'])!="i3g3e3nious7")
{
	echo '<script>';
	echo 'location.replace("index.php");';
	echo '</script>';
}
else
{

$errmsg = "";
$action=$_POST['action'];
$syName=$_POST['syName'];

if ($action=="CREATE")
{
	if(trim($syName)== "")
		$errmsg = "School Year Desc field is empty<br/>";
	else
	{
		$strSql = mysql_query("insert into ma_schoolyear(syName,sStatus) values('".$syName."','1');");
		$errmsg = "You have successfully created your New School Year.";
	}
}
?>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td></td><td align="center" class="fs14"><u><b>Create New School Year</b></u></td></tr>
	<tr><td width="200" class="fs12" valign="top"><?php include("sidemenu.php");?></td>
		<td width="700" class="fs12" valign="top">
			<table width="680" cellpadding="1" cellspacing="1" border="0">
				<tr><td colspan="4" valign="top"><hr /></td></tr>
				<?php
				if(substr(trim($errmsg),1,8) == "YOU HAVE")
				{
						echo "<tr valign='top' align='center'><td colspan='4'>".$errmsg."</td></tr>";					
					?>
						<br/><meta http-equiv="Refresh" content="3;url=schoolYear.php"><br/>
					<?php
					}
					else 
					{
					?>
					<form action="schoolYearNew.php" method="post" name="frm">
					<tr><td height="10" width="17%"></td><td width="33%" class="fs12"><i>* required fields</i></td><td height="10" width="15%"></td><td width="35%"></td></tr>
					<tr><td align="right"><b>* </b>SY Desc:&nbsp;</td><td><input class="formInput" type="text" name="syName" value="<?=$syName?>" /></td>
						<td colspan="2"><input class="fs12" type="submit" name="action" value="CREATE" /></td></tr>
					<tr valign="top"><td></td><td class="errmsg" colspan="3"><?=$errmsg?></td></tr>
					</form>
				<?php
				}
				?>

				<tr><td colspan="4"><hr /></td></tr>
			</table></td></tr>
</table>
<?php
include("footer.php");
}
?>
<!-- #include file="include\footer.inc"-->