<?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/inventory/report/";
$paramsx=array();

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

// innitialize parameters
if(strtoupper($_REQUEST['ftitem_code'])=="") 
    $_REQUEST['ftitem_code']="SELURUH";

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

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

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

/*
if(strtoupper($_REQUEST['ftitem_code'])=="SELURUH") 
    $_REQUEST['ftitem_code']="%";

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

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

if(strtoupper($_REQUEST['ftlocation'])=="SELURUH") 
    $_REQUEST['ftlocation']="%";
*/

// call parameter and report
switch ($code) {
    case "i00":
        
        $paramsx[]=array("name"=>"ftitem_code",
                       "value"=>$_REQUEST['ftitem_code'],
                       "type"=>"string");
        $paramsx[]=array("name"=>"ftstock_group",
                       "value"=>$_REQUEST['ftstock_group'],
                       "type"=>"string");
        $paramsx[]=array("name"=>"username",
                    "value"=>$_SESSION['username'],
                    "type"=>"string");
        show_report($dir."report00_data_barang",$paramsx);
        break;
        
    case "i00_1":
        $paramsx[]=array("name"=>"stock_type",
                         "value"=>"inv",
                         "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        show_report($dir."report20_stock_awal",$paramsx);
        break;
    
    case "i01":         
        $paramsx[]=array("name"=>"stock_group",
                          "value"=>$_REQUEST['ftstock_group'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"item_code",
                        "value"=>$_REQUEST['ftitem_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."report01_per-stock_group",$paramsx);
        break;
    
    case "i05":         
        $paramsx[]=array("name"=>"warehouse",
                          "value"=>$_REQUEST['ftwarehouse'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"location",
                          "value"=>$_REQUEST['ftlocation'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"item",
                          "value"=>$_REQUEST['ftitem_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."report07_kartu_stock",$paramsx);
        break;
    
    case "i06":         
        $paramsx[]=array("name"=>"ftlocation_from",
                          "value"=>$_REQUEST['ftlocation_from'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"ftlocation_to",
                          "value"=>$_REQUEST['ftlocation_to'],
                          "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."report08_mutasi",$paramsx);
        break;
    case "i07":         
         $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."report09_penyesuaian",$paramsx);
     break;
    case "i08":
        if($_REQUEST['warehouse']=="SELURUH") {
            $warehouse="%%";
        }
        else {
            $warehouse=$_REQUEST['warehouse'];
        }

         $paramsx[]=array("name"=>"warehouse",
                          "value"=>$warehouse,
                          "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_per_gudang",$paramsx);
        break;
        
    case "i09":   
        /* if($_REQUEST['ftlocation']=="SELURUH") {
            $location="%%";
        }
        else {
            $location=$_REQUEST['location'];
        }

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

        $paramsx[]=array("name"=>"fnwarehouse_type",
                         "value"=>$_REQUEST['fnwarehouse_type'],
                         "type"=>"string");
        $paramsx[]=array("name"=>"ftwarehouse",
                         "value"=>$_REQUEST['ftwarehouse'],
                         "type"=>"string");
        $paramsx[]=array("name"=>"ftlocation",
                         "value"=>$_REQUEST['ftlocation'],
                         "type"=>"string");
        $paramsx[]=array("name"=>"ftitem_code",
                         "value"=>$_REQUEST['ftitem_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_per_lokasi",$paramsx);
        break;
        
    case "i10":
        if($_REQUEST['stock']=="") 
               $_REQUEST['stock']="SELURUH";
       
        $paramsx[]=array("name"=>"stock",
                        "value"=>$_REQUEST['stock'],
                        "type"=>"string");
        $paramsx[]=array("name"=>"username",
                        "value"=>$_SESSION['username'],
                        "type"=>"string");

        show_report($dir."report06_minim_level",$paramsx);

        break;
    case "i11":
        $paramsx[]=array("name"=>"pftcategory_code",
                          "value"=>$_REQUEST['ftcategory_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"pftitem_code",
                          "value"=>$_REQUEST['ftitem_code'],
                          "type"=>"string");                                                
        $paramsx[]=array("name"=>"pftlocation_code",
                          "value"=>$_REQUEST['ftlocation_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."report11_stock_keluar",$paramsx);

    break;
     case "i11_2":                                                        
        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$_REQUEST['customer_code'],
                          "type"=>"string");
       $paramsx[]=array("name"=>"ftstock_category_code",
                          "value"=>$_REQUEST['ftstock_category_code'],
                          "type"=>"string");
           $paramsx[]=array("name"=>"ftdelivery_method",
                          "value"=>$_REQUEST['ftdelivery_method'],
                          "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."report11_stock_keluar_DO_per_Customer_per_category",$paramsx);

    break;
    case "i12":
        $paramsx[]=array("name"=>"pftcategory_code",
                          "value"=>$_REQUEST['ftcategory_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"pftitem_code",
                          "value"=>$_REQUEST['ftitem_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"pftlocation_code",
                          "value"=>$_REQUEST['ftlocation_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."report12_stock_masuk",$paramsx);

    break;

      case "i13":
        $paramsx[]=array("name"=>"subgroup_code",
                          "value"=>$_REQUEST['subgroup_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."report13_stock_keluar_DO_per_stock_group",$paramsx);

    break;
       case "i14":
        $paramsx[]=array("name"=>"area_code",
                          "value"=>$_REQUEST['area_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) ;die("m");
        show_report($dir."report14_stock_keluar_DO_per_stock_group_perwilayah",$paramsx);
        break;
       case "i15":
        $paramsx[]=array("name"=>"customer_code",
                          "value"=>$_REQUEST['customer_code'],
                          "type"=>"string");
          $paramsx[]=array("name"=>"subgroup_code",
                          "value"=>$_REQUEST['subgroup_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);die("m");
        show_report($dir."report15_stock_keluar_DO_per_stock_group_percustomer",$paramsx);
       break;
case "i16":
      
         $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);die("m");
        show_report($dir."report16_stock_keluar_sj_return",$paramsx);

    break;

case "i17":

       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"=>"customer_name",
                          "value"=>base64_decode($_REQUEST['hidden_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");
        # pr($paramsx);die("m");
        show_report($dir."report17_customer",$paramsx);
    break;
case "i18":

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

        $paramsx[]=array("name"=>"subgroup",
                          "value"=>$subgroup,
                          "type"=>"string");
        $paramsx[]=array("name"=>"subgroup_name",
                          "value"=>base64_decode($_REQUEST['hidden_subgroup_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);die("m");
        show_report($dir."report18_per_subgroup",$paramsx);
    break;
	case "i19":

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

        $paramsx[]=array("name"=>"subgroup",
                          "value"=>$subgroup,
                          "type"=>"string");
        $paramsx[]=array("name"=>"subgroup_name",
                          "value"=>base64_decode($_REQUEST['hidden_subgroup_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."report19_stock_in_per_subgroup",$paramsx);
    break;
    case "i20":
        if($_REQUEST['supplier_code']=="SELURUH") {
           $supplier="%%";
       }
       else {
           $supplier=$_REQUEST['supplier_code'];
       }

        $paramsx[]=array("name"=>"category_code",
                          "value"=>$_REQUEST['fncategory_code'],
                          "type"=>"integer");
        $paramsx[]=array("name"=>"supplier_code",
                          "value"=>$supplier,
                          "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."report_01_stock_masuk_category",$paramsx);
    break;	
    case "i21":
        if(strtolower($_REQUEST['group_code']) == "seluruh")
          $group_code="'%%'";
        else
          $group_code=$_REQUEST['group_code'];

        $paramsx[]=array("name"=>"group_code",
                          "value"=>$group_code,
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
//         pr($paramsx);die("m");
        show_report($dir."report16_persediaan_subgroup",$paramsx);		
    break;
    case "i22":
        if($_REQUEST['ftassembly_no']=="SELURUH") {
            $ftassembly_no="%%";
        }
        else {
            $ftassembly_no=$_REQUEST['ftassembly_no'];
        }
        
        if($_REQUEST['ftitem_code']=="SELURUH") {
            $ftitem_code="%%";
        }
        else {
            $ftitem_code=$_REQUEST['ftitem_code'];
        }

        $paramsx[]=array("name"=>"ftassembly_no",
                          "value"=>$ftassembly_no,
                          "type"=>"string");
        $paramsx[]=array("name"=>"ftitem_code",
                          "value"=>$ftitem_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."report21_assembly",$paramsx);
    break;
    case "i23":
        if($_REQUEST['ftdisassembly_no']=="SELURUH") {
            $ftdisassembly_no="%%";
        }
        else {
            $ftdisassembly_no=$_REQUEST['ftdisassembly_no'];
        }
        
        if($_REQUEST['ftitem_code']=="SELURUH") {
            $ftitem_code="%%";
        }
        else {
            $ftitem_code=$_REQUEST['ftitem_code'];
        }

        $paramsx[]=array("name"=>"ftdisassembly_no",
                          "value"=>$ftdisassembly_no,
                          "type"=>"string");
        $paramsx[]=array("name"=>"ftitem_code",
                          "value"=>$ftitem_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."report22_disassembly",$paramsx);
        break;
        
    case "i24":   
        if($_REQUEST['ftitem_code']=="SELURUH") {
            $ftitem_code="%";
        }
        else {
            $ftitem_code= $_REQUEST['ftitem_code'] . "%";
        }

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

        $paramsx[]=array("name"=>"ftitem_code",
                         "value"=>$ftitem_code,
                         "type"=>"string");
        $paramsx[]=array("name"=>"ftlocation_code",
                         "value"=>$ftlocation_code,
                         "type"=>"string");
        $paramsx[]=array("name"=>"date_from",
                         "value"=>Cdate($_REQUEST['date_end'])." 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."report24_rekap_per_lokasi",$paramsx);
        break;

    case "i25":   
        if ($_REQUEST['ftitem_name']=="") {
            $ftitem_name="SELURUH";
        }
        else {
            $ftitem_name= $_REQUEST['ftitem_name'] . "%";
        }

        $paramsx[]=array("name"=>"item_name",
                         "value"=>$ftitem_name,
                         "type"=>"string");
        $paramsx[]=array("name"=>"location",
                         "value"=>$_REQUEST['ftlocation'],
                         "type"=>"string");
        $paramsx[]=array("name"=>"username",
                         "value"=>$_SESSION['username'],
                         "type"=>"string");
       
        show_report($dir."report25_worksheet_opname",$paramsx);
        break;

    case "i26":   
        if ($_REQUEST['ftitem_name']=="") {
            $ftitem_name="SELURUH";
        }
        else {
            $ftitem_name= $_REQUEST['ftitem_name'] . "%";
        }

        $paramsx[]=array("name"=>"item_name",
                         "value"=>$ftitem_name,
                         "type"=>"string");
        $paramsx[]=array("name"=>"location",
                         "value"=>$_REQUEST['ftlocation'],
                         "type"=>"string");
        $paramsx[]=array("name"=>"username",
                         "value"=>$_SESSION['username'],
                         "type"=>"string");
       
        show_report($dir."report26_worksheet_opname_qty",$paramsx);
        break;
    
    case "i28":
        if(strtoupper($_REQUEST['supplier_code'])=="") 
            $_REQUEST['supplier_code']="SELURUH";
        
        if(strtoupper($_REQUEST['ftitem_code'])=="") 
            $_REQUEST['ftitem_code']="SELURUH";

        if(strtoupper($_REQUEST['ftpo_no'])=="") { 
            $_REQUEST['ftpo_no']="SELURUH";
        } else {
            $_REQUEST['ftpo_no']="%{$_REQUEST['ftpo_no']}%";
        }
            
        $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"=>"item_code",
                          "value"=>$_REQUEST['ftitem_code'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"ftpo_no",
                          "value"=>$_REQUEST['ftpo_no'],
                          "type"=>"string");
        $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
                          
        show_report($dir."report28_penerimaan_barang",$paramsx);
        break;
            
    /* Not Using
    case "i02":         
         $paramsx[]=array("name"=>"stock_subgroup",
                          "value"=>$_REQUEST['stock_subgroup'],
                          "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."report02_per_substock_group",$paramsx);
        break;
    case "i02_2":
         $paramsx[]=array("name"=>"stock_group",
                          "value"=>$_REQUEST['stock_group'],
                          "type"=>"string");
         $paramsx[]=array("name"=>"date_from",
                          "value"=>Cdate($_REQUEST['date_end'])." 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."report02_per_substock_group_tanpa_masuk_keluar",$paramsx);
        break;
    case "i03":         
        $paramsx[]=array("name"=>"stock",
                        "value"=>$_REQUEST['ftitem_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."report03_per_item_barang",$paramsx);
        break;  
     
    */    
}