<?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/absensi/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 "ab01":
        if(strtoupper($_REQUEST['employee_code'])=="SELURUH") {
                $_REQUEST['employee_code']="%%";
        }
         $paramsx[]=array("name"=>"employee_code",
                          "value"=>$_REQUEST['employee_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_absensi",$paramsx);
    break;
  case "ab02":
        if(strtoupper($_REQUEST['employee_code'])=="SELURUH") {
                $_REQUEST['employee_code']="%%";
        }
         $paramsx[]=array("name"=>"employee_code",
                          "value"=>$_REQUEST['employee_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."report02_overtime",$paramsx);
    break;
}