<?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_rab9 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and september='1' and perkiraan='$var'";
$rab9 = mysql_query($query_rab9, $sistem) or die(mysql_error());
$row_rab9 = mysql_fetch_assoc($rab9);
$totalRows_rab9 = mysql_num_rows($rab9);

mysql_select_db($database_sistem, $sistem);
$query_saldosep = "SELECT sum($hitung)as nomin FROM $tb where bulan='September' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldosep = mysql_query($query_saldosep, $sistem) or die(mysql_error());
$row_saldosep = mysql_fetch_assoc($saldosep);
$totalRows_saldosep = mysql_num_rows($saldosep);
?>
