<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Area_modal
 *
 * @author user
 */
class Area_modal extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function exit_area($id) {
        $this->db->select();
        $this->db->from('area');
        $this->db->where('id', $id);
        $query = $this->db->get();
        $farmer = $query->first_row('array');
        return $farmer;
    }

    public function add_area($data) {
        $this->db->insert('area', $data);
    }

    public function edit_area($id, $data) {
        $this->db->where('id', $id);
        $this->db->update('area', $data);
    }

    public function delete_area($data) {
        $this->db->delete('area', $data);
    }
    
    public function get_area_list() {
        $this->db->select();
        $this->db->from('area');
        $query = $this->db->get();
        return $query->result();
    }

}
