<?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_rab8 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and agustus='1' and perkiraan='$var'";
$rab8 = mysql_query($query_rab8, $sistem) or die(mysql_error());
$row_rab8 = mysql_fetch_assoc($rab8);
$totalRows_rab8 = mysql_num_rows($rab8);

mysql_select_db($database_sistem, $sistem);
$query_saldoag = "SELECT sum($hitung)as nomin FROM $tb where bulan='Agustus' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldoag = mysql_query($query_saldoag, $sistem) or die(mysql_error());
$row_saldoag = mysql_fetch_assoc($saldoag);
$totalRows_saldoag = mysql_num_rows($saldoag);
?>
