<?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_rab5 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and mei='1' and perkiraan='$var'";
$rab5 = mysql_query($query_rab5, $sistem) or die(mysql_error());
$row_rab5 = mysql_fetch_assoc($rab5);
$totalRows_rab5 = mysql_num_rows($rab5);

mysql_select_db($database_sistem, $sistem);
$query_saldomei = "SELECT sum($hitung)as nomin FROM $tb where bulan='Mei' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldomei = mysql_query($query_saldomei, $sistem) or die(mysql_error());
$row_saldomei = mysql_fetch_assoc($saldomei);
$totalRows_saldomei = mysql_num_rows($saldomei);
?>
