<?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_rab3 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and maret='1' and perkiraan='$var'";
$rab3 = mysql_query($query_rab3, $sistem) or die(mysql_error());
$row_rab3 = mysql_fetch_assoc($rab3);
$totalRows_rab3 = mysql_num_rows($rab3);

mysql_select_db($database_sistem, $sistem);
$query_saldomar = "SELECT sum($hitung)as nomin FROM $tb where bulan='Maret' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldomar = mysql_query($query_saldomar, $sistem) or die(mysql_error());
$row_saldomar = mysql_fetch_assoc($saldomar);
$totalRows_saldomar = mysql_num_rows($saldomar);
?>
