<?php
if($jenis=="Pendapatan"){
	$var="$row_rab[perkiraan]";
	$tb="pdp_tb";
	$hitung="debet";
}else{
$var="$row_rabpnl[perkiraan]";
$tb="pnl_tb";
$hitung="kredit";
}

mysql_select_db($database_sistem, $sistem);
$query_rab4 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and april='1' and perkiraan='$var'";
$rab4 = mysql_query($query_rab4, $sistem) or die(mysql_error());
$row_rab4 = mysql_fetch_assoc($rab4);
$totalRows_rab4 = mysql_num_rows($rab4);

mysql_select_db($database_sistem, $sistem);
$query_saldoap = "SELECT sum($hitung)as nomin FROM $tb where bulan='April' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldoap = mysql_query($query_saldoap, $sistem) or die(mysql_error());
$row_saldoap = mysql_fetch_assoc($saldoap);
$totalRows_saldoap = mysql_num_rows($saldoap);
?>
