<?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_rab7 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and juli='1' and perkiraan='$var'";
$rab7 = mysql_query($query_rab7, $sistem) or die(mysql_error());
$row_rab7 = mysql_fetch_assoc($rab7);
$totalRows_rab7 = mysql_num_rows($rab7);

mysql_select_db($database_sistem, $sistem);
$query_saldojul = "SELECT sum($hitung)as nomin FROM $tb where bulan='Juli' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldojul = mysql_query($query_saldojul, $sistem) or die(mysql_error());
$row_saldojul = mysql_fetch_assoc($saldojul);
$totalRows_saldojul = mysql_num_rows($saldojul);
?>
