<?php

include"connect.php";
include"indo.php";
include"indo2.php";
$idset="DIREKTUR";
	$cset="select * from staf where jabatan='$idset'";
	$hset=mysql_query($cset);
	$pset=mysql_fetch_array($hset);
$pudir="PUDIR I";
	$cset="select * from staf where jabatan='$pudir'";
	$hset=mysql_query($cset);
	$setpu=mysql_fetch_array($hset);
$nim= $_POST['nim'];
$krssql = mysql_query("select * from krs where nim='$nim'");
$hasil=mysql_num_rows($krssql);
if($hasil > 0 )
{
$mhssql = mysql_query("select * from mhs where nim='$nim'");
$hasilmhs=mysql_fetch_row($mhssql);
$transsql = mysql_query("select * from transkrip where nim='$nim'");
$hasiltrans=mysql_fetch_row($transsql);
echo"<table border=0 width=900>
	<tr><td align=center><strong><font size=+1> <u>TRANSKRIP AKADEMIK </font></strong> <font color=#006633> / <em>ACADEMIC TRANSCRIPT </u></font></td></tr>
		<tr><td align=center><font size=-3>$hasiltrans[1]</font></td></tr></table>";
echo"<table border=0>";
if ($hasilmhs[12]=='AKPER')
	{
	$prodi='KEPERAWATAN';
	}else{
	$prodi='KEBIDANAN';
	}
$tgl_trans = $hasiltrans[3];
$ftrans=TanggalIndo($tgl_trans);
//$ftrans= date("d-m-Y", strtotime($tgl_trans));
echo"<tr>
<td><strong><font size=-1>NIM/</font></strong><font color=#006633 size=-1><em>Student Registered Number</em></font></td>  <td width=350><strong><font size=-1>: $nim</td></strong></font>
<td><strong><font size=-1>Program Studi/</font></strong><font color=#006633 size=-1><em>Student Program</em></font></td>  <td><strong><font size=-1>: $prodi</td></strong></font>
</tr>";
echo"<tr>
<td><strong><font size=-1>Nama/</font></strong><font color=#006633 size=-1><em>Name</font></td> <td><strong><font size=-1>: $hasilmhs[1]</em></td></strong></font>
<td><strong><font size=-1>Tanggal Lulus/</font></strong><font color=#006633 size=-1><em>Graduate On</font></td> <td><strong><font size=-1>: $ftrans</em></td></strong></font>
</tr>";
echo"<tr><td><strong><font size=-1>Tempat Lahir/</font></strong><font color=#006633 size=-1><em>Place Of Birth</font></td> <td><strong><font size=-1>: $hasilmhs[5]</em></td></strong></font>
<td><strong><font size=-1>No Ijazah/</font></strong><font color=#006633 size=-1><em>Sertificate Number</font></td> <td><strong><font size=-1>: $hasiltrans[2]</em></td></strong></font>
</tr>";
				$tgl_asli = $hasilmhs[6];
				//$ftgl= date("d-m-Y", strtotime($tgl_asli));
				$ftgl=TanggalIndo($tgl_asli);
echo"<tr><td><strong><font size=-1>Tanggal Lahir/</font><font color=#006633 size=-2><em>Date Of Birth</font></td> <td><strong><font size=-1>: $ftgl</em></td></strong></font></tr>";
				if ($hasilmhs[8]=='L')
				{
				$sex='LAKI-LAKI';
				}else{
				$sex='PEREMPUAN';
				}
echo"<tr><td><strong><font size=-1>Jenis Kelamin/</font></strong><font color=#006633 size=-1><em>Sex</font></td> <td><strong><font size=-1>: $sex</em></td></strong></font></tr>";
}

?>
<table width="900" border="1" cellpadding="0" style="border-collapse:collapse;" > 
<tr><th width="20"><font size="-1">No</font></th>
 <th width="60"><font size="-1">Kode</font>
 <br><font color="#006633"size="-2"><em>Code</em></font></br></th>
 <th width="430">Mata Kuliah</th>
 <th width="430"><font color="#006633"><em>Title</em></font></th>
 <th width="40"><font size="-1">SKS </font>
 <br><font color="#006633" size="-2"><em>C,U</em></font></br></th>
 <th width="40"><font size="-1"> Nilai </font>
 <br><font color="#006633" size="-2"><em>Score</em></font></br></th>
 <th width="40"><font size="-1">Huruf</font>
   <font color="#006633" size="-2"><em>Mark</em></font></br></th>
 <th width="40"><font size="-1">Bobot</font>
   <font color="#006633" size="-2"><em>Point</em></font></br></th>
</tr>
<?php
include"connect.php";
$sqlkrs = mysql_query("SELECT * FROM krs, mtk WHERE nim='$nim'
 AND krs.kd_mtk = mtk.kd_mtk ORDER BY krs.semester ASC");
$warnaGenap = "#FFFF00";   // warna kuning
$warnaGanjil = "#FFFFFF";  // warna putih
$jumsks = 0;
$i = 1;
$totbot=0;
$counter = 1;
while($datakrs = mysql_fetch_array($sqlkrs)){
if ($counter % 2 == 0) $warna = $warnaGenap;
else $warna = $warnaGanjil;
 echo "<tr bgcolor='".$warna."'><td align=center><font size=-2>$i</font></td>";
 echo "<td align=center><font size=-2> $datakrs[kd_mtk]</font></td>";
 echo "<td><font size=-2>&nbsp $datakrs[nm_mtk]</font></td>";
 echo "<td><font color=#006633 size=-2><em>&nbsp $datakrs[en_mtk]</em></font></td>";
 echo "<td align=center><font size=-1>$datakrs[jsks]</font></td>";
 echo "<td align=center><font size=-1>$datakrs[nilai]</font></td>";

 if ($datakrs['nilai']>3.50)
 $lambang="A";
 else if ($datakrs['nilai']>2.75)
 $lambang="B";
 else if ($datakrs['nilai']>1.99)
 $lambang="C";
 else if ($datakrs['nilai']>0.99)
 $lambang="D";
 else
 $lambang="E";

 echo "<td align=center><font size=-1>$lambang</font></td>";
 $bobotnilai = $datakrs['jsks'] * $datakrs['nilai'];
 $fbobotnilai= number_format($bobotnilai,2,'.','');
 echo "<td align=center><font size=-1>$fbobotnilai</td></font></tr>";
 $counter++; // menambah counter

 $jumsks = $jumsks + $datakrs['jsks'];
 $totbot = $totbot + $bobotnilai;
 $ftotbot= number_format($totbot,2,'.','');
 $i++;
}

$ips = $totbot / $jumsks;
$fips= number_format($ips,2,'.','');
$ipk = $ips*60/100 + $hasiltrans[4]*40/100;
$fipk= number_format($ipk,2,'.','');

if ($fipk>3.50)
 $yud="Cum Laude";
 else if ($fipk>2.75)
 $yud="Sangat Memuaskan";
 else if ($fipk>1.99)
 $yud="Memuaskan";
 else if ($fipk>0.99)
 $yud="-";
 else
 $yud="";


if ($fipk>3.50)
 $yudi="Excellent";
 else if ($fipk>2.75)
 $yudi="Highly";
 else if ($fipk>1.99)
 $yudi="Safisfactory";
 else if ($fipk>0.99)
 $yudi="";
 else
 $yudi="";

?>
<tr>
  <td height="75" colspan="3" rowspan="6" valign="top"><font size="-2"> <br>  JUDUL KTI :</font>
    <font size="-2"><br>
   <? echo $hasiltrans[5]; ?></br>
    <font color="#006633"><em> <? echo $hasiltrans[6]; ?></em></font></font></td>
  <td colspan="2"><font size="-2">&nbsp JUMLAH SKS /</font><font color="#006633" size="-1"><em> Total C,U</em></font><br>        </td>
  <td colspan="3" align="right">  
    <div align="center"><font size="-1"><strong><? echo $jumsks; ?></strong></font></div></td>
  </tr>
<tr>
  <td colspan="2"><font size="-2">&nbsp JUMLAH BOBOT /</font><font color="#006633" size="-1"><em> Total Point</em></font></td>
  <td colspan="3" align="right"><div align="center"><font size="-1"><strong><? echo $ftotbot; ?></strong></font></div></td>
</tr>
<tr>
  <td colspan="2"><font size="-2">&nbsp INDEKS PRESTASI SEMESTER /</font><font color="#006633" size="-1"><em> Grade Point Average Semester</em></font></td>
  <td colspan="3" align="right"><div align="center"><font size="-1"><strong><? echo $fips; ?></strong></font></div></td>
</tr>
<tr>
  <td colspan="2"><font size="-2">&nbsp NILAI UAP /</font><font color="#006633" size="-1"><em> Final Examination</em></font></td>
  <td colspan="3" align="right"><div align="center"><font size="-1"><strong><? echo $hasiltrans[4]; ?></strong></font></div></td>
</tr>
<tr>
  <td colspan="2"><font size="-2">&nbsp INDEKS PRESTASI KOMULATIF /</font><font color="#006633" size="-1"><em> Grade Point Average</em></font></td>
  <td colspan="3" align="right"><div align="center"><font size="-1"><strong><? echo $fipk; ?></strong></font></div></td>
</tr>
<tr>
  <td colspan="2"><font size="-2">&nbsp YUDISIUM KELULUSAN /</font><font color="#006633" size="-1"><em> Level Of Proficiency</em></font></td>
  <td colspan="3" align="right"><div align="center"><font size="-2"><strong><? echo $yud; ?>/<font color="#006633"><em><? echo $yudi; ?></em></font></strong></font></div></td>
</tr>
</table>

<table border="0" width="900">
<tr>
<td width="230" height="167" valign="bottom"><div align="center"><font size="-1">Pembantu Direktur  Bidang Akademik
</font><br>
<font size="-1" color="#006633"><em>Vice Director For Academic Affairs ,</em></font><font color="#006633"></br>
</font><font color="#00FF66"></font>  </div>
  <br>
  <p align="center">&nbsp;</p>
  <div align="center"><u><font size="-1"><? echo " $setpu[1]"; ?></font></u> <font size="-1"><br>
    NIK.<? echo " $setpu[0]"; ?> </font></div></td>
<td width="376" align="center"><table width="110" height="143" border="1" align="right" style="border-collapse:collapse;">
  <tr>
    <td height="137">&nbsp;</td>
  </tr>
</table></td>


<td width="280" align="center" valign="bottom"><font size="-1">Bekasi ,<? echo " $tgl $bln $thn"; ?></font><br>
  <font size="-1">AKPER Bhakti Husada Cikarang <br>
Direktur,
  </font><br>
  <font size="-1" color="#006633"><em>Director,</em></font></br>
  <br>
<p>&nbsp;</p>
<u><font size="-1"><? echo " $pset[1]"; ?></font></u>
<font size="-1"><br>
NIK.<? echo " $pset[0]"; ?>
</font></td>
</tr>
</table>

<table width="325" border="1" style="border-collapse:collapse;">
  <tr>
    <td width="84"><div align="center"><font size="-3">IPK/<em><font color="#006633">GPA</font></em></font></div></td>
    <td width="75"><div align="center"><font size="-3">HURUF/<font color="#006633"><em>Mark</em></font></font></div></td>
    <td width="144"><div align="center"><font size="-3">YUDISIUM/<font color="#006633"><em>Proficiency</em></font></font></div></td>
  </tr>
  <tr>
    <td height="38">
      <div align="center"><font size="-3">3.51-4.00<br>
2.76-3.50<br>
2.00-2.75</font></div></td>
    <td><div align="center">
      <font size="-3">A<br>
       B<br>
C</font></div></td>
    <td><div align="center">
      <font size="-3">CUM LAUDE/<font color="#006633"><em>Excelent</em></font><br>
      SANGAT MEMUASKAN/<font color="#006633"><em>Highly</em></font><br>
      MEMUASKAN/<font color="#006633"><em>Safisfactory</em></font></font></div></td>
  </tr>
</table>

