<?php
        session_cache_expire(1440);
        session_start();
        session_name("insys");
        include "include/config.php";
        include "include/functions.php";
        include "include/fifo.php";
        include "include/save_fifo.php";
        include "include/save_log_stock.php";
        include "include/process_general_ledger.php";
        include "class/UctVw.php";
     
	$form = $_REQUEST[form];	
        
	$objAxpDB = new UctVw();
     $objAxpDB->LookupMagicQuotes(True);
	$objAxpDB->strModule("inventory_sparepart");
      if($_SESSION['usernameApprove']) {
                $_SESSION['username']= $_SESSION['usernameApprove'];
         }
    
         //Process
        $file1="modules_process/inventory_sparepart/master/{$form}.php";
        $file2="modules_process/inventory_sparepart/transaksi/{$form}.php";
        $file3="modules_process/inventory_sparepart/laporan/{$form}.php";
        

         if(file_exists($file1)||file_exists($file2)||file_exists($file3)) {
             if(file_exists($file1) ) {
                  include $file1;
             }
             else if(file_exists($file2) ) {
                   include $file2;
             }
             else if(file_exists($file3) ) {
                   include $file3;
             }       
         }
         
        //Menu
        $file1="modules_menu/inventory_sparepart/master/{$form}.php";
        $file2="modules_menu/inventory_sparepart/transaksi/{$form}.php";
        $file3="modules_menu/inventory_sparepart/laporan/{$form}.php";
        
        
         if(file_exists($file1)||file_exists($file2)||file_exists($file3)) {
             if(file_exists($file1) ) {
                  include $file1;
             }
             else if(file_exists($file2) ) {
                   include $file2;
             }
             else if(file_exists($file3) ) {
                   include $file3;
             }
             
         }
         else {
            if($_REQUEST['p']==1) {
//                 $objAxpDB->headerData();
                   $objAxpDB->menuData("inventory_sparepart");
//                $objAxpDB->footerData();
            }
            else {
                 $objAxpDB->headerData();
                #  $objAxpDB->menuData("inventory_bahan_baku");
                 $objAxpDB->footerData();
            }
          
         }
        
       
        // -----------------------------------------
            $_SESSION['usernameApprove']="";
        $_SESSION['username']= $_SESSION['usernameTemp'];