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

switch ($_REQUEST['form']) {
    case "spp":
        $ssql="select ftspp_no from txspp_hdr where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);
        
        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftspp_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        $revisi=RetRstField($ssql);
        show_report($dir."crprint01_spp",$paramsx);
   break;
   case "estimasi":
        $ssql="select ftestimation_no from txestimation_hdr where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftestimation_no"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        $revisi=RetRstField($ssql);
        show_report($dir."crprint02_estimasi",$paramsx);
   break;
 case "bom":
        $ssql="select ftitem_code from tlstock_hdr_setengah_jadi where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);

        $paramsx[]=array("name"=>"trans_no",
                          "value"=>$r["ftitem_code"],
                          "type"=>"string");
         $paramsx[]=array("name"=>"username",
                          "value"=>$_SESSION['username'],
                          "type"=>"string");
        $revisi=RetRstField($ssql);
        show_report($dir."crprint03_bom",$paramsx);
   break;
   
   
}