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

ini_set('max_execution_time', 600);
ini_set('memory_limit', '1024M');

class Default_setting extends CI_Controller  { 

	public function __construct()
    {
        parent::__construct();
        $this->load->database();
        $this->load->library('session');
        $this->load->helper("file");
        $this->load->library('zip');
	}

	public function index()
	{
		$listview = $this->input->get('_listval');
		$logged_id = $this->session->userdata('userid');
		
		$this->db->where('setting_user_id',$logged_id);
		$info = $this->db->get('default_setting');

		if($info->num_rows())
		{
			$data = array(
				"setting_view"=>$listview,
			);
			$this->db->update('default_setting',$data);
		}
		else
		{
			$data = array(
				"setting_user_id"=>$logged_id,
				"setting_view"=>$listview,
			);
			$this->db->insert('default_setting',$data);
		}
	}
}

?>