<?php  
    $objAxpDB->ViewName("Daftar laporan produksi");
    $objAxpDB->ViewSQL("SELECT fnid, ftreport_code,  ftreport_name FROM tlreport WHERE ftreport_group = 'produksi' order by ftreport_code");
    $objAxpDB->ViewCaption("ID, Kode Laporan, Nama laporan");
    
    $objAxpDB->FormName(" laporan produksi");
    $objAxpDB->FormSQL("SELECT ftreport_name
                      FROM tlreport");
    $objAxpDB->FormCaption("Nama laporan");
    $objAxpDB->FormPosition("TL");
     $objAxpDB->lengt_object=false;
    if($_REQUEST['id']) {
        $ssql="select * from tlreport where fnid='{$_REQUEST['id']}'";
        $rs=mysql_query($ssql);
        $r=mysql_fetch_assoc($rs);
        $code=$r['ftreport_code'];
        $report_name=" :: ".$r['ftreport_name'];
        switch ($code) {
          case "produksi02":
              $objAxpDB->FormSQL("SELECT  
                            CONVERT(null,date) as date_from, 
                            CONVERT(null,date) as date_end 
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, TL");
          break;
          case "produksi03":
             $objAxpDB->FormSQL("SELECT 
                            CONVERT(null,date) as date_from,
                            CONVERT(null,date) as date_end
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, TL");
          break;
           case "produksi04":
              $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From ");
            $objAxpDB->FormPosition("TL");
          break;
          case "produksi05":
             $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from 
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From ");
            $objAxpDB->FormPosition("TL ");
          break;
           case "produksi06":
              $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from,
                            CONVERT(null,date) as date_end
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, HD");
          break;
           case "produksi06_1":
              $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from,
                            CONVERT(null,date) as date_end
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, HD");
          break;
          case "produksi07":
             $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from,
                            CONVERT(null,date) as date_end
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, HD");
          break;
           case "produksi08":
              $objAxpDB->FormSQL("SELECT
                            CONVERT(null,date) as date_from,
                            CONVERT(null,date) as date_end
                            FROM tlreport");
            $objAxpDB->FormCaption(" Date From,Date End");
            $objAxpDB->FormPosition("TL, TL");
          break;
         
        }
    }
    
   
     
    $objAxpDB->Process();
    if(!$_REQUEST['id']) {       
        $objAxpDB->WriteHtmlTable();
    }
    else {
         $objAxpDB->FormName("laporan produksi".$report_name);
         $objAxpDB->ButtonShow("generate_report,print_report");
        $objAxpDB->reportData();
    }
    
?>
