<?php

class Notice_model extends CI_Model{


    	function __consturct(){
    	   parent::__construct();
    	
    	}
    public function GetNotice(){
        $sql = "SELECT * FROM `notice` ORDER BY `notice`.`date` DESC;";
        $query = $this->db->query($sql);
        $result = $query->result();
        return $result; 
        }

        public function notice_delete($notice_id){
            $this->db->delete('notice',array('id'=> $notice_id));
        }
    public function Published_Notice($data){
        $this->db->insert('notice',$data);
    }
    public function GetNoticelimit(){
        $this->db->order_by('date', 'DESC');
		$query = $this->db->get('notice');
		$result =$query->result();
        return $result;        
    }
    public function get_allenotice($id){
        $sql = "SELECT * FROM `notice` WHERE `id`='$id'";
        $query = $this->db->query($sql);
        $result = $query->row();
        return $result; 
    }
    public function Update_notice_Info($id,$data){
		$this->db->where('id', $id);
		$this->db->update('notice',$data);         
    }
          
}
?>