<?php
session_cache_expire(1440);
session_start();
session_name("insys");
include "include/config.php";
include "include/functions.php";
//include "class/template_class.php";
include "include/report_generator.php";
//foreach ($_REQUEST as $key1 => $value1) {
//  $_REQUEST[$key1]=str_replace('_|_','/',$_REQUEST[$key1]);
//}

$dir="report/keuangan/report/";
$dir_sub=_REPORT_PATH."/report/keuangan/report/";
$paramsx=array();

$ssql="select * from tlreport where fnid='{$_REQUEST['id']}'";
$rs=mysql_query($ssql);
$r=mysql_fetch_assoc($rs);
$code=$r['ftreport_code'];
//$code=$_REQUEST['code'];

if(strtoupper($_REQUEST['customer_code'])=="") 
    $_REQUEST['customer_code']="SELURUH"; 

if(strtoupper($_REQUEST['supplier_code'])=="") 
    $_REQUEST['supplier_code']="SELURUH"; 

if(strtoupper($_REQUEST['sales_code'])=="") 
    $_REQUEST['sales_code']="SELURUH"; 

if(strtoupper($_REQUEST['ftcoa_code'])=="") 
    $_REQUEST['ftcoa_code']="SELURUH"; 

switch ($code) {
    case "f05":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['ftcoa_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report11_kas_masuk_keluar",$paramsx);
        break;
        
    case "f06":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['ftcoa_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report12_bank_masuk_keluar",$paramsx);        
        break;
      
    case "f07":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	       $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report13_credit_memo",$paramsx);

        break;
    case "f08":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	       $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report14_debit_memo",$paramsx);

       break;
       
    case "f09":
        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$_REQUEST['customer_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	      $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report15_penerimaan_piutang",$paramsx);
        break;

    case "f10":
        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$_REQUEST['supplier_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	       $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report16_pembayaran_hutang",$paramsx);
       break;

    case "f11":
        if($_REQUEST['customer_code']=='SELURUH') {
            $customer_code="%%";
        }
        else {
            $customer_code=$_REQUEST['customer_code'] ;
        }

        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$customer_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	      $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report17_ar_aging",$paramsx);
        break;

    case "f12":
        if($_REQUEST['customer_code']=='SELURUH') {
            $customer_code="%%";
        }
        else {
            $customer_code=$_REQUEST['customer_code'] ;
        }

        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$customer_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	      $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report18_ar_aging_rekap",$paramsx);
        break;

    case "f13":
        if($_REQUEST['supplier_code']=='SELURUH') {
            $supplier_code="%%";
        }
        else {
            $supplier_code=$_REQUEST['supplier_code'] ;
        }

        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$supplier_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report19_ap_aging",$paramsx);
        break;
    case "f14":
        if($_REQUEST['supplier_code']=='SELURUH') {
            $supplier_code="%%";
        }
        else {
            $supplier_code=$_REQUEST['supplier_code'] ;
        }

        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$supplier_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report20_ap_aging_rekap",$paramsx);
        break;
    
    case "f20":

        if(strtoupper($_REQUEST['customer_code'])=="SELURUH") {
                $_REQUEST['customer_code']="%";
        }

        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$_REQUEST['customer_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        
        show_report($dir."report04_kartu_piutang",$paramsx);
       break;

   case "f21":

        if(strtoupper($_REQUEST['supplier_code'])=="SELURUH") {
                $_REQUEST['supplier_code']="%";
        }

        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$_REQUEST['supplier_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report05_kartu_hutang",$paramsx);
        break;
 
    case "f35":
        
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report42_saldo_awal_hutang",$paramsx);
        break;
    case "f36":
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report43_saldo_awal_pIutang",$paramsx);
        break;

    case "f48":          
        if(strtoupper($_REQUEST['customer_code'])=="SELURUH") 
            $_REQUEST['customer_code']="";

        $paramsx[]=array("name"=>"customer_code",
                      "value"=>$_REQUEST['customer_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"currency_code",
                      "value"=>$_REQUEST['currency_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                      "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                      "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"username",
                      "value"=>$_SESSION['username'],
                      "type"=>"string");
        show_report($dir."report48_summary_piutang",$paramsx);
        break;
        
    case "f49":          
        if(strtoupper($_REQUEST['supplier_code'])=="SELURUH") 
            $_REQUEST['supplier_code']="";

        $paramsx[]=array("name"=>"supplier_code",
                      "value"=>$_REQUEST['supplier_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"currency_code",
                      "value"=>$_REQUEST['currency_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                      "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                      "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"username",
                      "value"=>$_SESSION['username'],
                      "type"=>"string");
        show_report($dir."report49_summary_hutang",$paramsx);
        break;
        
    case "f50":          
        if(strtoupper($_REQUEST['customer_code'])=="SELURUH") 
            $_REQUEST['customer_code']="";

        $paramsx[]=array("name"=>"customer_code",
                      "value"=>$_REQUEST['customer_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"status_giro",
                      "value"=>$_REQUEST['status_giro'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                      "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                      "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"username",
                      "value"=>$_SESSION['username'],
                      "type"=>"string");
        show_report($dir."report50_piutang_giro_mundur",$paramsx);
        break;
        
    case "f51":          
        if(strtoupper($_REQUEST['supplier_code'])=="SELURUH") 
            $_REQUEST['supplier_code']="";

        $paramsx[]=array("name"=>"supplier_code",
                      "value"=>$_REQUEST['supplier_code'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"status_giro",
                      "value"=>$_REQUEST['status_giro'],
                      "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                      "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                      "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                      "type"=>"date");
        $paramsx[]=array("name"=>"username",
                      "value"=>$_SESSION['username'],
                      "type"=>"string");
        show_report($dir."report51_hutang_giro_mundur",$paramsx);
        break;
           
    case "f52":
        if($_REQUEST['customer_code']=='SELURUH') {
            $customer_code="%%";
        }
        else {
            $customer_code=$_REQUEST['customer_code'] ;
        }
        
        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$customer_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"sales_code",
                          "value"=>$_REQUEST['sales_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	      $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report52_ar_aging_rekap_bulanan",$paramsx);
        break;


        case "f53":
        if($_REQUEST['customer_code']=='SELURUH') {
            $customer_code="";
        }
        else {
            $customer_code=$_REQUEST['customer_code'] ;
        }
        
        
        
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end'])." 23:59:59",
                          "type"=>"date");
        $paramsx[]=array("name"=>"branch_code",
                          "value"=>$_REQUEST['branch_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$customer_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report53_ar_outstanding_Piutang",$paramsx);
        break;

        case "f54":
        if($_REQUEST['supplier_code']=='SELURUH') {
            $supplier_code="";
        }
        else {
            $supplier_code=$_REQUEST['supplier_code'] ;
        }
        
        
        
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end'])." 23:59:59",
                          "type"=>"date");
        $paramsx[]=array("name"=>"branch_code",
                          "value"=>$_REQUEST['branch_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$supplier_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report54_ap_outstanding_Hutang",$paramsx);
        break;

        
    /* Tidak digunakan saat ini
    case "f01":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	 $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report07_kas_masuk",$paramsx);
    break;
    case "f02":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	 $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report08_kas_keluar",$paramsx);
    break;
   case "f03":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	 $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report09_bank_masuk",$paramsx);
    break;
    case "f04":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	 $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report10_bank_keluar",$paramsx);
    break;
    case "f05_1":

         $paramsx[]=array("name"=>"journal1",
                          "value"=>$_REQUEST['journal1'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"journal2",
                           "value"=>$_REQUEST['journal2'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report09_bank_masuk_order_by_no_journal",$paramsx);
          break;
        case "f05_2":

         $paramsx[]=array("name"=>"journal1",
                          "value"=>$_REQUEST['journal1'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"journal2",
                           "value"=>$_REQUEST['journal2'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report10_bank_keluar_order_by_no_journal",$paramsx);
          break;
        case "f06_1":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report12_bank_masuk_keluar_order_by_tgl_transaksi_new",$paramsx);
          break;
     case "f06_2":

         $paramsx[]=array("name"=>"trans1",
                          "value"=>$_REQUEST['trans1'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"trans2",
                           "value"=>$_REQUEST['trans2'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report12_bank_masuk_keluar_order_by_tgl_no_voucher_new",$paramsx);
          break;
      case "f06_3":

         $paramsx[]=array("name"=>"desc",
                          "value"=>"%{$_REQUEST['desc']}%",
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report12_bank_masuk_keluar_order_by_desc",$paramsx);
          break;
       case "f05_3":

         $paramsx[]=array("name"=>"journal1",
                          "value"=>$_REQUEST['journal1'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"journal2",
                           "value"=>$_REQUEST['journal2'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report09_bank_masuk_ar_order_by_no_journal",$paramsx);
          break;
        case "f05_4":

        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report09_bank_masuk_ar_order_by_tgl_cairl",$paramsx);
          break;  
    case "f15":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report21_cash_flow",$paramsx);
       break;
    case "f16":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report22_proyeksi_biaya",$paramsx);
        break;
    case "f17":
         $paramsx[]=array("name"=>"journal1",
                          "value"=>$_REQUEST['journal1'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"journal2",
                           "value"=>$_REQUEST['journal2'],
                          "type"=>"string");
               $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

        show_report($dir."report01_bank_transaksi_order_by_no_jurnal",$paramsx);
         break;
     case "f17_1":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
          $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	                 
					   
		$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report01_bank_transaksi_order_by_fdcair",$paramsx);

    break;
     case "f17_2":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
          $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	                  
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report01_bank_transaksi_order_by_fdtrans_date",$paramsx);

    break;
    case "f18":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
          $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report02_bank_recap_order_by_tgl_cair",$paramsx);
     break;
       case "f18_1":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
          $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report02_bank_recap_order_by_tgl_transaksi",$paramsx);
     break;
   case "f19":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report03_kasbank_transaksi_per_coa",$paramsx);
      break;  
    case "f22":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report06_rekap_piutang_dagang_bulanan",$paramsx);
         break;
     case "f23":
          $paramsx[]=array("name"=>"customer_code",
                          "value"=>$_REQUEST['customer_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
          show_report($dir."report23_soa_piutang",$paramsx);
          break;
     case "f24":
          $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$_REQUEST['supplier_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
          show_report($dir."report24_soa_hutang",$paramsx);
         break;
     case "f25":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report25_pembayaran_hutang2",$paramsx);
         break;
     case "f25_1":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report25_pembayaran_hutang2_import_order_by_tgl_cair",$paramsx);
         break;
     case "f25_2":
          $paramsx[]=array("name"=>"journal1",
                          "value"=>$_REQUEST['journal1'],
                          "type"=>"string");
          $paramsx[]=array("name"=>"journal2",
                           "value"=>$_REQUEST['journal2'],
                          "type"=>"string");
         
		  $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report25_pembayaran_hutang2_import_order_by_no_journal",$paramsx);
         break;
      case "f26":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report26_proyeksi_hutang_per_tgl_transaksi",$paramsx);
          break;
     case "f27":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report27_proyeksi_hutang_per_tgl_jatuhtempo",$paramsx);
        break;
       case "f28":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report28_agenda_giro",$paramsx);
        break;
		  case "f28_1":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
		#pr($paramsx);
        show_report($dir."report30_agenda_giro_PV",$paramsx);
        break;
		  case "f28_2":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
		$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report31_agenda_giro_AP",$paramsx);
        break;
      case "f29":
            $paramsx[]=array("name"=>"date_from",
                              "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                              "type"=>"date");
             $paramsx[]=array("name"=>"date_end",
                              "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                              "type"=>"date");
			$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
						  
    //        pr($paramsx);
            show_report($dir."report29_informasi_tanda_terima",$paramsx);
            break;
      case "f30":
        $paramsx[]=array("name"=>"coa_code",
                          "value"=>$_REQUEST['coa_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
		                  
			$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
						  
//        pr($paramsx);
        show_report($dir."report32_biaya_tranfer_CV",$paramsx);
        break;
        
        case "f31":
        if($_REQUEST['customer_type']=='SELURUH') {
            $customer_type="%%";
            $customer_type_name="SELURUH";
        }
        else {
            $ssql="SELECT  ftcustomer_type_name 
                    FROM tlcustomer_type
                    WHERE ftcustomer_type_code='{$_REQUEST['customer_type']}'";
                                                                                                                                    
            $customer_type=$_REQUEST['customer_type'] ;
            $customer_type_name=RetRstField($ssql);
        }
        
        $paramsx[]=array("name"=>"customer_type_code",
                          "value"=>$customer_type,
                          "type"=>"string");
         $paramsx[]=array("name"=>"customer_type_name",
                           "value"=>$customer_type_name,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");		                 
		$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report33_sisa_piutang",$paramsx);
        break;
        
         case "f32":
        if($_REQUEST['customer_type']=='SELURUH') {
            $customer_type="%%";
            $customer_type_name="SELURUH";
        }
        else {
            $ssql="SELECT  ftcustomer_type_name
                    FROM tlcustomer_type
                    WHERE ftcustomer_type_code='{$_REQUEST['customer_type']}'";

            $customer_type=$_REQUEST['customer_type'] ;
            $customer_type_name=RetRstField($ssql);
        }

        $paramsx[]=array("name"=>"customer_type_code",
                          "value"=>$customer_type,
                          "type"=>"string");
         $paramsx[]=array("name"=>"customer_type_name",
                           "value"=>$customer_type_name,
                          "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
		$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//        pr($paramsx);
        show_report($dir."report34_penerimaan_piutang",$paramsx);
        break;
        case "f33":
            
            if($_REQUEST['supplier_code']=='SELURUH') {
                $supplier_code="%%";              
            }
            else {              
                $supplier_code=$_REQUEST['supplier_code'] ;               
            }
        
         $paramsx[]=array("name"=>"supplier_code",
                  "value"=>$supplier_code,
                  "type"=>"string");
                      
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
			$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//			pr($paramsx);
        show_report($dir."report35_pembayaran_hutang",$paramsx);
         break;

        case "f34":

            if($_REQUEST['supplier_code']=='SELURUH') {
                $supplier_code="%%";
            }
            else {
                $supplier_code=$_REQUEST['supplier_code'] ;
            }

         $paramsx[]=array("name"=>"supplier_code",
                  "value"=>$supplier_code,
                  "type"=>"string");

        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
        	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report36_pembayaran_hutang_no_tanda_terima",$paramsx);
         break; 
     case "f36":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
        show_report($dir."report38_bank_masuk_batal",$paramsx);
          break;
    case "f37":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
        show_report($dir."report39_bank_keluar_batal",$paramsx);
          break;
               case "f38":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
        show_report($dir."report40_bank_masuk_ar_batal",$paramsx);
          break;

     case "f39":
        $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"date_end",
                          "value"=>Cdate($_REQUEST['date_end']). " 00:00:00",
                          "type"=>"date");
	$paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report41_pembayaran_hutang2_import_order_by_tgl_cair_batal",$paramsx);
         break; 
      
    */
}