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

class Manage_reminder extends CI_Controller {
	function redir_perkara_list(){
		$this->setParams();
		redirect('main');
	}

	function redir_perkara_task_list(){
		$this->setParams();
		redirect('perkara_task_list');
	}

	function redir_perkara_tab_dashboard_list(){
		$this->setParams();
		redirect('perkara_tab_dashboard_list');
	}
	
	function redir_perkara_tab_status_list(){
		$this->setParams();
		redirect('perkara_tab_status_list');
	}

	

	function setParams(){
		$segment = $this->uri->segment_array();
		$this->nativesession->set_flash_session('security', TRUE);
		$this->nativesession->set_flash_session('segment', $segment);
		$this->nativesession->set_flash_session('function', $this->uri->segment(2));
		$this->nativesession->set_flash_session('url_requested', base_url(uri_string()));
		
		if($this->uri->segment(2)=='sort'){
			$this->nativesession->set_flash_session('col', $this->uri->segment(3));
			$this->nativesession->set_flash_session('enc', $this->uri->segment(4));
			$this->nativesession->set_flash_session('keyword', rawurldecode($this->uri->segment(5)));
		}elseif($this->uri->segment(2)=='type'){
			$this->nativesession->set_flash_session('enc', $this->uri->segment(3));
		}elseif($this->uri->segment(2)=='page'){
			$this->nativesession->set_flash_session('page', $this->uri->segment(3));
			$this->nativesession->set_flash_session('enc', $this->uri->segment(4));
			$tmp = explode("=", $this->uri->segment(5));
			if($tmp>0 AND $tmp[0]=="col"){
				$this->nativesession->set_flash_session('col', $tmp[1]);
				$this->nativesession->set_flash_session('keyword','');
			}else{
				$this->nativesession->set_flash_session('keyword', rawurldecode($this->uri->segment(5)));
				$this->nativesession->set_flash_session('col', $this->uri->segment(6));
			}
		}elseif($this->uri->segment(2)=='search'){
			if($this->input->post('search')){
				$this->nativesession->set_flash_session('keyword', $this->input->post('search'));
			}else{
				$this->nativesession->set_flash_session('keyword', rawurldecode($this->uri->segment(3)));
			}
			if($this->input->post('enc')){
				$this->nativesession->set_flash_session('enc', $this->input->post('enc'));
			}else{
				$this->nativesession->set_flash_session('enc', $this->uri->segment(4));
			}
			$this->nativesession->set_flash_session('page', '');
		}elseif($this->uri->segment(2)=='search_detail'){
			$this->parsePostValue();
		}else{
			$this->nativesession->set_flash_session('enc', $this->uri->segment(3));
		}
	}

}

?>