<?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_rab1 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and januari='1' and perkiraan='$var'";
$rab1 = mysql_query($query_rab1, $sistem) or die(mysql_error());
$row_rab1 = mysql_fetch_assoc($rab1);
$totalRows_rab1 = mysql_num_rows($rab1);

mysql_select_db($database_sistem, $sistem);
$query_saldojan = "SELECT sum($hitung)as nomin FROM $tb where bulan='Januari' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldojan = mysql_query($query_saldojan, $sistem) or die(mysql_error());
$row_saldojan = mysql_fetch_assoc($saldojan);
$totalRows_saldojan = mysql_num_rows($saldojan);
?>
