<?php
class Landingmain_Model extends CI_Model{
        
        function insert($arr)
        {
                
                $this->db->insert('landing_main', $arr);
                return $this->db->insert_id();
                
        }
        
        function update($id, $arr)
        {
        
                $this->db->where('id', $id);
                $this->db->update('landing_main', $arr);
        
        }
        
        function get()
        {       

                    $this->db->select('*');
                    $this->db->order_by("displayorder","asc");
                    $this->db->from('landing_main');
                    $query=$this->db->get();

                return $query->result();
        }
        
        function get_id($id){
                $this->db->where('id', $id);
                $query = $this->db->get('landing_main');
                return $query->result();
        }
        
        function get_lang($lang)
        {
                
                $this->db->where('lang', $lang);
                $query = $this->db->get('landing_main');
                return $query->result();
                
        }
        
        function delete($id)
        {
                $this->db->where('id', $id);
                $this->db->delete('landing_main');
        }
        
}

?>