<?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_rab12 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and desember='1' and perkiraan='$var'";
$rab12 = mysql_query($query_rab12, $sistem) or die(mysql_error());
$row_rab12 = mysql_fetch_assoc($rab12);
$totalRows_rab12 = mysql_num_rows($rab12);

mysql_select_db($database_sistem, $sistem);
$query_saldodes = "SELECT sum($hitung)as nomin FROM $tb where bulan='Desember' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldodes = mysql_query($query_saldodes, $sistem) or die(mysql_error());
$row_saldodes = mysql_fetch_assoc($saldodes);
$totalRows_saldodes = mysql_num_rows($saldodes);
?>
