<?php
include "connect.php";
include "rp.php";
include "indo.php";
$nim=$_POST['nim'];
$kd_byr =$_POST['kd_byr'];
$tgl_byr =$_POST['tgl_byr'];
$ta =$_POST['ta'];

echo"<table>";

$idset="BENDAHARA";
	$cset="select * from staf where jabatan='$idset'";
	$hset=mysql_query($cset);
	$pset=mysql_fetch_row($hset);

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

$sqljns=mysql_query("select * from jns_byr where kd_byr='$kd_byr'");
$datajns=mysql_fetch_row($sqljns);

//$sqldt=mysql_query("select * from dt_byr where kd_byr='$kd_byr'");
//$datadt=mysql_num_rows($sqldt);

$sqltgl=mysql_query("select * from tb_byr where kd_byr='$kd_byr' and nim='$nim' and tgl_byr='$tgl_byr'");
$datatgl=mysql_fetch_row($sqltgl);

$sqljum=mysql_query("select sum(jum_byr) from tb_byr where kd_byr='$kd_byr' and nim='$nim'");
$datajum=mysql_fetch_row($sqljum);

$sisa= $datajns[3]-$datajum[0];
$fsisa=rp($sisa);
$fjum=rp($datajns[3]);
$ftgl2=TanggalIndo($datajns[4]);
$fbyr=rp($datajum[0]);
$ftgl=rp($datatgl[4]);
$ftgl1=TanggalIndo($datatgl[1]);

?>
<table width="920" border="1" align="left">
  <tr>
    <th colspan="5"  bgcolor="#FFFFCC"><a href=fbyr.php>KWITANSI PEMBAYARAN KULIAH </a></td>
  </tr>
    <tr>
    <td  widtd="107"><div align="left">      No.Kwitansi</td>
    <td colspan="4"  widtd="107"><? echo $datatgl[0]; ?>      </td>
  </tr>
  <tr>
    <td  widtd="107"><div align="left">NIM</td>
    <td colspan="4"  widtd="107"><? echo $datamhs[0]; ?>      </td>
  </tr>
  <tr>
    <td ><div align="left">NAMA</div></td>
    <td colspan="4" ><? echo $datamhs[1]; ?></td>
  </tr>
  <tr>
    <td ><div align="left">TINGKAT</div></td>
    <td colspan="4" ><? echo $datamhs[2]; ?> <? echo $datamhs[3]; ?> </td>
  </tr>
  <tr>
    <td height="26" ><div align="left">SEMESTER</div></td>
    <td height="26" colspan="4" ><? echo $datamhs[4]; ?></td>
  </tr>
  <tr>
    <td ><div align="left">ANGKATAN</div></td>
    <td colspan="4" ><? echo $datamhs[14]; ?></td>
  </tr>
  <tr>
    <td >TA</td>
    <td colspan="4" ><? echo $ta; ?></td>
  </tr>
  <tr>
    <td colspan="5" >&nbsp;</td>
  </tr>
  <tr>
    <td width="154" >TANGGAL</td>
    <td width="381" >PEMBAYARAN</td>
    <td width="118" >JUMLAH BYR </td>
    <td width="132" >TOTAL SDH BYR </td>
    <td width="101" >SISA BYR </td>
  </tr>
  <tr>
    <td height="23" ><div align="center"><? echo $ftgl1; ?></div></td>
    <td height="23" ><? echo $datajns[1]; ?> ( <? echo $fjum; ?> )</td>
    <td height="23"  align="right"><? echo $ftgl; ?></td>
    <td height="23"  align="right"><? echo $fbyr; ?></td>
    <td height="23"  align="right"><? echo $fsisa; ?></td>
  </tr>
</table>



<table width="917" border="0">
  <tr>
    <td width="684"><font size="-2"><em><strong>JATUH TEMPO : <? echo $ftgl2; ?></strong></font></td>
    <td width="217"><div align="center">Bendahara</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
	
    <td><div align="center"><u><? echo " $pset[1]"; ?></u></div></td>
  </tr>
</table>
