33 lines
715 B
PHP
33 lines
715 B
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class ModelDataDesa extends CI_Model
|
|
{
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
//Codeigniter : Write Less Do More
|
|
}
|
|
|
|
public function get_data()
|
|
{
|
|
return $this->db->get_where("desa")->result();
|
|
}
|
|
|
|
public function get_data_edit($id)
|
|
{
|
|
return $this->db->get_where("desa", array("id_desa" => $id))->row_array();
|
|
}
|
|
|
|
public function count_desa()
|
|
{
|
|
return $this->db->count_all("desa");
|
|
}
|
|
|
|
public function get_desa_bynama($nama_desa)
|
|
{
|
|
return $this->db->get_where("desa", array("nama_desa" => $nama_desa))->row_array();
|
|
}
|
|
|
|
} |