<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Stockroom_movement extends MY_Controller {

	function __construct()
	{
		parent::__construct();
		date_default_timezone_set('Asia/Jakarta');
		// $this->load->model('hauling_model');
		$this->bc->set_title('Stockroom Movement');
		$this->bc->add('Stockroom',base_url().'hauling');
		$this->bc->add('Movement',base_url().'hauling/stockroom_movement');
	}
	
	public function index()
	{
		$data = array(
			'content' => 'movement/main'
		);
		$this->load->view('tpl',$data);
	}

    public function load_table()
	{		
        $table_types = $this->input->post('t_ch_type_periode')?:"monthtodate";

        if ($table_types == "monthtodate"){
            $content = 'movement/detail_mtd';
        }
        if ($table_types == "lastmonth"){
            $content = 'movement/detail_lastmonth';
        }
        if ($table_types == "yeartodate"){
            $content = 'movement/detail_ytd';
        }
        if ($table_types == "lastyear"){
            $content = 'movement/detail_lastyear';
        }
        if ($table_types == "custom"){
            $content = 'movement/detail_custom';
        }
        
		$data = array(
			'content' => $content,
		);
		$this->load->view($data['content'], $data);
	}
	

}