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

class Designation_Model extends CI_Model {
	public function insert(){
		$data=array("designation"=>$_POST['designation'],
		            "inserted_SI"=>$this->session->userdata('id'),
                       "inserted_by"=>$this->session->userdata('name'),
                       "inserted_DT"=>date('Y-m-d H:i:s')
					
				);
		$this->db->insert('mst_designation',$data);
	}

	public function fetch_data()
	{
	  $this->db->select('*'); 
	  $this->db->where('deleted_DT',NULL);
  	  $this->db->from('mst_designation');
  	   $this->db->order_by('id','DESC');
 	 $query = $this->db->get();
  	return $query->result();	
	}

	public function display_designation_recordsById($id)
	{
		$query=$this->db->query("select * from mst_designation where id='".$id."'");
		return $query->result();
	}

	public function update($id)
	{
		
		$data=array("designation"=>$_POST['designation'],
					   "modify_SI"=>$this->session->userdata('id'),
                   	 "modify_by"=>$this->session->userdata('username'),
                    "modify_DT"=>date('Y-m-d H:i:s'));
       				 $c=$this->db->where('id',$id)->update('mst_designation',$data);  

	}


	

	
}
