<?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/tracking/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 "p01": //laporan outstanding mingguan
          $paramsx[]=array("name"=>"pfntrans_type",
                      "value"=>$_REQUEST['pfntrans_type'],
                      "type"=>"string");
          if(($_REQUEST['pfntrans_type']=="seluruh")||(strtolower($_REQUEST['pfntrans_type'])=="seluruh")) {
              $pfntrans_type="SELURUH";
              $pfntrans_type_1="SELURUH";
          }
          else {
              $pfntrans_type=$_REQUEST['pfntrans_type'];
               $ssql="SELECT  fttrans_status_name
                        FROM tstransaction_status WHERE fntrans_group_code = 16";              
               $pfntrans_type_1=RetRstField($ssql);
          }

           $paramsx[]=array("name"=>"pfntrans_type",
                      "value"=>$pfntrans_type,
                      "type"=>"string");
            $paramsx[]=array("name"=>"pfntrans_type_1",
                      "value"=>$pfntrans_type_1,
                      "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_om",$paramsx);
    break;
}