<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Setting extends MY_Controller{
	public function index(){
		$data['setting'] = $this->fm->get_setting();
		
		$this->load->view($this->router->fetch_class()."/index", $data);
	}
	
	public function update(){
		$this->load->model("setting_model");
		$post = $this->input->post();
		
		//To prevent loss---
		$this->fm->keep_all_page_filter();
		//------------------
		
		if($this->setting_model->save($post)){
			$this->session->set_flashdata('success', "Update Successful!");
		}
		else{
			$this->session->set_flashdata('error', "Update Failed!");
		}
		
		redirect(base_url($this->router->fetch_class()));
	}
}