<?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/produksi/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'];


switch ($code) {

     case "produksi02":
         $paramsx[]=array("name"=>"pdate_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"pdate_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_history_pending_delivery_schedule",$paramsx);
 
    break;
     case "produksi03":
         $paramsx[]=array("name"=>"pdate_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"pdate_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_history_pending_delivery_schedule",$paramsx);

    break;
     case "produksi04":
         $paramsx[]=array("name"=>"pdate_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."crreport04_hasil_produksi",$paramsx);

    break;
     case "produksi05":
         $paramsx[]=array("name"=>"pdate_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."crreport05_produksivitas_operator",$paramsx);

    break;
     case "produksi06":
         $paramsx[]=array("name"=>"pdate_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."crreport06_reject_produksi_per_dept",$paramsx);

    break;
     case "produksi06_1":
         $paramsx[]=array("name"=>"pdate_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."crreport06_reject_produksi_per_line",$paramsx);

    break;
     case "produksi07":
         $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."crreport07_hasil_giling",$paramsx);

    break;
     case "produksi08":
         $paramsx[]=array("name"=>"pdate_from",
                          "value"=>Cdate($_REQUEST['date_from'])." 00:00:00",
                          "type"=>"date");
         $paramsx[]=array("name"=>"pdate_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_history_pending_delivery_schedule",$paramsx);

    break;
	
}