<?php
include "connect.php";
$nim=$_POST['nim'];
$semester =$_POST['semester'];
$ta =$_POST['ta'];

echo"<table>";

$sqlmhs=mysql_query("select * from mhs where nim='$nim'");
$datamhs=mysql_fetch_row($sqlmhs);

echo "<tr><td>NIM</td><td>: $datamhs[0]</td></tr>
      <tr><td>Nama</td><td>: $datamhs[1]</td></tr>
	  <tr><td>Tingkat</td><td>: $datamhs[2] $datamhs[3]</td></tr>
	  <tr><td>Semester</td><td>: $semester</td></tr>
	  <tr><td>TA</td><td>: $ta </td></tr>";

//set cookie
setcookie("nim",$nim);
setcookie("namamhs",$datamhs[1]);
setcookie("tingkat",$datamhs[2]);
setcookie("kelas",$datamhs[3]);
setcookie("semester",$semester);
setcookie("ta",$ta);
//'</table>';
?>

<html>
<body>
<form method=post action=inputkrs.php>
<table width="773" border="1">
<tr align="center">
 <th width="131">kode</th>
 <th width="494">Matakuliah </th>
 <th width="61">SKS</th>
 <th width="59">Ambil </th></tr>
<?php
$sqlmtk=mysql_query("select * from mtk where semester='$semester'");
while($data2=mysql_fetch_array($sqlmtk))
{
 echo "<tr align=center><td>$data2[0]</td>";
 echo "<td align=left>$data2[1]</td>";
 echo "<td>$data2[2]</td>";
 echo "<td><input type=checkbox name=kd_mtk[]
 value=$data2[0]></td></tr>";
}
?>
<tr><td colspan=4><input type=submit Value="Submit">
<input type=reset Value="Cancel"></td></tr>
</table>
</form>
</body>
</html>

