<?php

if($bulan=='Januari'){
	$bulannya='Desember';
	$tahunnya=$tahun-1;
}
elseif($bulan=='Februari'){
	$bulannya='Januari';
	$tahunnya=$tahun;
}
elseif($bulan=='Maret'){
	$bulannya='Februari';
	$tahunnya=$tahun;
}
elseif($bulan=='April'){
	$bulannya='Maret';
	$tahunnya=$tahun;
}
elseif($bulan=='Mei'){
	$bulannya='April';
	$tahunnya=$tahun;
}
elseif($bulan=='Juni'){
	$bulannya='Mei';
	$tahunnya=$tahun;
}
elseif($bulan=='Juli'){
	$bulannya='Juni';
	$tahunnya=$tahun;
}
elseif($bulan=='Agustus'){
	$bulannya='Juli';
	$tahunnya=$tahun;
}
elseif($bulan=='September'){
	$bulannya='Agustus';
	$tahunnya=$tahun;
}
elseif($bulan=='Oktober'){
	$bulannya='September';
	$tahunnya=$tahun;
}
elseif($bulan=='November'){
	$bulannya='Oktober';
	$tahunnya=$tahun;
}
elseif($bulan=='Desember'){
	$bulannya='November';
	$tahunnya=$tahun;
}
if($_GET['module']=='kas_unit'){
	mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_GET[kodenya]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_GET[kodenya]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);

}
elseif($_GET['module']=='akb_unit'){
	mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_GET[kodenya]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_GET[kodenya]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);

}
elseif($_GET['module']=='labarug_unit'){
	mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_GET[kodenya]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_GET[kodenya]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);

}
elseif($_GET['module']=='bank_unit'){
	mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_GET[kodenya]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_GET[kodenya]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);

}
elseif($_GET['module']=='neraca_unit'){
	mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_GET[kodenya]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_GET[kodenya]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);

}
else{
mysql_select_db($database_sistem, $sistem);
$query_saldo_awal = "SELECT * FROM saldo_tb where bulan='$bulannya' and tahun='$tahunnya' and kode_unit='$_SESSION[kode]'";
$saldo_awal = mysql_query($query_saldo_awal, $sistem) or die(mysql_error());
$row_saldo_awal = mysql_fetch_assoc($saldo_awal);
$totalRows_saldo_awal = mysql_num_rows($saldo_awal);

mysql_select_db($database_sistem, $sistem);
$query_saldo_akhir = "SELECT * FROM saldo_tb where bulan='$bulan' and tahun='$tahun' and kode_unit='$_SESSION[kode]'";
$saldo_akhir = mysql_query($query_saldo_akhir, $sistem) or die(mysql_error());
$row_saldo_akhir = mysql_fetch_assoc($saldo_akhir);
$totalRows_saldo_akhir = mysql_num_rows($saldo_akhir);
}
?>
<?php 
//module report
if ($_GET['module']=='Report'){
	include 'module/_report/bb_kas.php';
}
else if($_GET['module']=='unit'){
	include 'module/_report/laporan_unit.php';
}
else if($_GET['module']=='kas'){
	include 'module/_report/bb_kas.php';
}
else if($_GET['module']=='kas_unit'){
	include 'module/_report/bb_kas_pus.php';
}
else if($_GET['module']=='bank'){
	include 'module/_report/index_bb_bank.php';
}
else if($_GET['module']=='bank_unit'){
	include 'module/_report/bank_unit.php';
}
else if($_GET['module']=='bb_bank'){
	include 'module/_report/bb_bank.php';
}
else if($_GET['module']=='deposito'){
	include 'module/_report/index_bb_depo.php';
}
else if($_GET['module']=='bb_depo'){
	include 'module/_report/bb_depo.php';
}
else if($_GET['module']=='index_pdp'){
	include 'module/_report/index_bb_pdp.php';
}
else if($_GET['module']=='rnc_pdp'){
	include 'module/_report/rincian_pdp.php';
}
else if($_GET['module']=='index_pnl'){
	include 'module/_report/index_bb_pnl.php';
}
else if($_GET['module']=='rnc_pnl'){
	include 'module/_report/rincian_pnl.php';
}
else if($_GET['module']=='bb_akun'){
	include 'module/_report/bb_pdp_akun.php';
}
else if($_GET['module']=='bb_perkir'){
	include 'module/_report/bb_pdp_perkir.php';
}
else if($_GET['module']=='bb_akun_pnl'){
	include 'module/_report/bb_pnl_akun.php';
}
else if($_GET['module']=='bb_perkir_pnl'){
	include 'module/_report/bb_pnl_perkir.php';
}
else if($_GET['module']=='aktiva'){
	include 'module/_report/index_bb_aktiva.php';
}
else if($_GET['module']=='index_hutang'){
	include 'module/_report/index_bb_hutang.php';
}
else if($_GET['module']=='bb_hutang_perkir'){
	include 'module/_report/bb_hutang.php';
}
else if($_GET['module']=='bb_hutang'){
	include 'module/_report/bb_hutang_akun.php';
}
else if($_GET['module']=='bb_aktiva_perkir'){
	include 'module/_report/bb_aktiva.php';
}
else if($_GET['module']=='bb_aktiva'){
	include 'module/_report/bb_aktiva_akun.php';
}
else if($_GET['module']=='ekuitas'){
	include 'module/_report/bb_ekuitas.php';
}
else if($_GET['module']=='akb'){
	include 'module/_report/AKB.php';
}
else if($_GET['module']=='akb_unit'){
	include 'module/_report/akb_unit.php';
}
else if($_GET['module']=='piutang'){
	include 'module/_report/bb_piutang.php';
}
else if($_GET['module']=='persediaan'){
	include 'module/_report/bb_persediaan.php';
}
else if($_GET['module']=='bdd'){
	include 'module/_report/bb_bdd.php';
}
else if($_GET['module']=='print'){
	include 'module/_printout/frame.php';
}
else if($_GET['module']=='la_rug'){
	include 'module/_report/laba_rugi.php';
}
else if($_GET['module']=='labarug_unit'){
	include 'module/_report/labarug_unit.php';
}
else if($_GET['module']=='neraca'){
	include 'module/_report/neraca.php';
}
else if($_GET['module']=='neraca_unit'){
	include 'module/_report/neraca_unit.php';
}
else if($_GET['module']=='investasi'){
	include 'module/_report/bb_inves.php';
}
else if($_GET['module']=='konsolidasi'){
	include 'module/_report/konsolidasi.php';
}
else if($_GET['module']=='realisasi'){
	include 'module/_report/realisasi_rab.php';
}
else if($_GET['module']=='bbpdp_perkir_konsol'){
	include 'module/_report/bb_pdp_perkir_konsol.php';
}
else if($_GET['module']=='bbpdp_akun_konsol'){
	include 'module/_report/bb_pdp_akun_konsol.php';
}
else if($_GET['module']=='bbpnl_perkir_konsol'){
	include 'module/_report/bb_pnl_perkir_konsol.php';
}
else if($_GET['module']=='bbpnl_akun_konsol'){
	include 'module/_report/bbpnl_akun_konsol.php';
}
else if($_GET['module']=='kas_konsol'){
	include 'module/_report/bb_kas_konsol.php';
}
else if($_GET['module']=='bank_konsol'){
	include 'module/_report/bb_bank_konsol.php';
}
else if($_GET['module']=='depo_konsol'){
	include 'module/_report/bb_depo_konsol.php';
}
else if($_GET['module']=='bb_akun_konsol'){
	include 'module/_report/bb_konsolidasi.php';
}
else if($_GET['module']=='bb_akun_konsol2'){
	include 'module/_report/bb_konsolidasi_kanan.php';
}
else if($_GET['module']=='bb_akun_konsol3'){
	include 'module/_report/bb_konsolidasi2.php';
}
else{
	echo "-";
}
?>