<?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_rab6 = "SELECT sum(nominal)as rab FROM rab_tb where kode='$_SESSION[kode]' and thn_ajuan='$_SESSION[tahun]' and juni='1' and perkiraan='$var'";
$rab6 = mysql_query($query_rab6, $sistem) or die(mysql_error());
$row_rab6 = mysql_fetch_assoc($rab6);
$totalRows_rab6 = mysql_num_rows($rab6);

mysql_select_db($database_sistem, $sistem);
$query_saldojun = "SELECT sum($hitung)as nomin FROM $tb where bulan='Juni' and tahun='$tahun' and kode_unit='$_SESSION[kode]' and no_perkiraan='$var'";
$saldojun = mysql_query($query_saldojun, $sistem) or die(mysql_error());
$row_saldojun = mysql_fetch_assoc($saldojun);
$totalRows_saldojun = mysql_num_rows($saldojun);
?>
