<?php
/**
 * This Model Deals with database operation for super admin basic setup
 * @author Himel Nag Rana
 * @version PWC 1.2
 */
class Basic_Setup_model extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
	}

	/**
	 * This method fetches basic setup for Super Admin
	 */
	function getAdminBasicSetup($admin_user_id)
	{
		$this->db->select('*');
		$this->db->from('tbl_admin_basic_setup');
		$this->db->where('admin_user_id',$admin_user_id);

		$resource = $this->db->get();
		$result = $resource->row();

		return $result;
	}

	/**
	 * This method saves basic setup for Super Admin
	 */
	function saveAdminBasicSetup($data)
	{
		if($data['admin_basic_setup_row_id'])
		{
			$this->db->where('admin_basic_setup_row_id',$data['admin_basic_setup_row_id']);
			$this->db->where('admin_user_id',$data['admin_user_id']);
			$this->db->update('tbl_admin_basic_setup', $data);
		}
		else
		{
			$this->db->insert('tbl_admin_basic_setup',$data);
		}
	}
}
?>