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

class Attachment extends MY_Controller {

	function __construct()
	{
		parent::__construct();
		date_default_timezone_set('Asia/Jakarta');
		$this->load->model('attachment_model');
	}
	
	public function index()
	{
		$transnum_ref = $this->input->get('transnum_ref');

		$data = Array(
			'content' => 'attachment/main',
			'transnum_ref' => $transnum_ref
		);
		$this->load->view($data['content'],$data);
	}

	public function attachment_list()
	{
		$transnum_ref = $this->input->post('transnum_ref');

		$this->attachment_model->set_where(array('transNumRef'=>decode($transnum_ref),'attachmentType'=>1));
		$attachment_list = $this->attachment_model->get_list();

		$data = Array(
			'content' => 'attachment/list',
			'transnum_ref' => $transnum_ref,
			'attachment_list' => $attachment_list
		);
		$this->load->view($data['content'],$data);

	}

}