<?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";

$dir="report/akunting/print/";
$paramsx=array();

switch ($_REQUEST['form']) {

    case "jurnalumum":
        $ssql="select ftjournal_no from txgeneral_journal_hdr where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftjournal_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

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

        break;

    case "penyusutanasset":

        $ssql="SELECT `fttrans_code` FROM `txdepriciation_hdr` WHERE `fnid` ='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"pno_trans",
                          "value"=>$r["fttrans_code"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

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

        break;
    
    /* tidak digunakan saat ini
    case "suratjalanoutsource":
        $ssql="select ftdo_no  from txdelivery_order_hdr_outsource where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftdo_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

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

   break;
   case "stockmasukoutsource":
        $ssql="select ftstock_in_return_no  from txstock_in_return_hdr_outsource where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftstock_in_return_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

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

   break;

   case "perhitunganinsentivesubcontraktor":
        $ssql="select ftfaktur_no  from txfaktur_gabungan_outsource_hdr where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftfaktur_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");

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

   break; */

    


}
