<?php 
ob_start();
session_start();

 require("Connection.php");

$sql1="SELECT * FROM lopmn";

	$result1=mysql_query($sql1,$link);

	$tongrec1= mysql_num_rows($result1);

	if ($tongrec1>0)
	{
	while ($row1=mysql_fetch_array($result1))
			{		
				$malopmn=$row1["malopmn"];
				
				
				$soluongbe="soluongbe" . $malopmn;
				$soluongbe=@$_POST[$soluongbe];
				
				$ngaydx="ngaydx" . $malopmn;
				$ngaydx=@$_POST[$ngaydx];
				
				$giaotrinhdx="giaotrinhdx" . $malopmn;
				$giaotrinhdx=@$_POST[$giaotrinhdx];
				
				$nguoidx="nguoidx" . $malopmn;
				$nguoidx=@$_POST[$nguoidx];

				if($giaotrinhdx<>"")
				{
						$sql2="insert into dexuatgiaotrinh(matruongmn,malopmn,soluongbe,ngaydexuat,noidungdx,nguoidx)";
						$sql2 .=" values('".$_SESSION["matruongmn"]."',".$malopmn.",".$soluongbe.",'".$ngaydx."','".$giaotrinhdx."','".$nguoidx."')";	
						$result2=mysql_query($sql2,$link);
						
				}
	}
	
}
header("location:dexuatgiaotrinh.php#xemgt");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML>
	<HEAD>
		<Title>Mainspring School Admin</Title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	    <style type="text/css">
<!--
.style3 {
	font-size: 14pt;
	font-family: Arial, Helvetica, sans-serif;
	color: #990000;
	font-weight: bold;
}
-->
        </style>
	</HEAD>
	<body>
	<span class="style3"> C&#7853;p nh&#7853;t thành c&ocirc;ng. <a href="dexuatgiaotrinh.php#xemgt">Tr&#7903; v&#7873;
    </a>	</span>
	</body>
</HTML>