Add Laporan Bulanan, Laporan By Kelurahan, laporan By Kecamatan, and Fix Some Bugs
This commit is contained in:
@@ -18,6 +18,18 @@ class LaporanModel extends CI_Model
|
||||
return $laporan = count($this->db->get($this->_table)->result());
|
||||
}
|
||||
|
||||
public function getCountByTahunByKelurahan($tahun,$kelurahan){
|
||||
$this->db->where('tahun',$tahun);
|
||||
$this->db->where('kelurahan',$kelurahan);
|
||||
return $laporan = count($this->db->get($this->_table)->result());
|
||||
}
|
||||
|
||||
public function getCountByTahunByKecamatan($tahun,$kecamatan){
|
||||
$this->db->where('tahun',$tahun);
|
||||
$this->db->where('kecamatan',$kecamatan);
|
||||
return $laporan = count($this->db->get($this->_table)->result());
|
||||
}
|
||||
|
||||
public function getLaporanByBulanByYearByKelurahan($bulan,$year,$kelurahan){
|
||||
$this->db->where('tahun',$year);
|
||||
$this->db->where('bulan',$bulan);
|
||||
@@ -48,6 +60,31 @@ class LaporanModel extends CI_Model
|
||||
return $laporan =$this->db->get($this->_table)->row();
|
||||
}
|
||||
|
||||
public function getLaporanByTahunAndKelurahan($tahun,$kelurahan){
|
||||
$this->db->where('tahun',$tahun);
|
||||
$this->db->where('kelurahan',$kelurahan);
|
||||
$this->db->order_by('bulan','ASC');
|
||||
return $laporan =$this->db->get($this->_table)->result();
|
||||
}
|
||||
|
||||
public function getKelurahanByTahunAndKecamatan($tahun,$kecamatan){
|
||||
$this->db->select('kelurahan');
|
||||
$this->db->distinct('kelurahan');
|
||||
$this->db->where('tahun',$tahun);
|
||||
$this->db->where('kecamatan',$kecamatan);
|
||||
$this->db->order_by('kelurahan','ASC');
|
||||
return $laporan =$this->db->get($this->_table)->result();
|
||||
}
|
||||
|
||||
public function getLastMonthLaporan($tahun){
|
||||
$this->db->select('bulan');
|
||||
$this->db->where('tahun',$tahun);
|
||||
$this->db->distinct('bulan');
|
||||
$this->db->order_by('bulan','DESC');
|
||||
$this->db->limit(1);
|
||||
return $laporan =$this->db->get($this->_table)->row();
|
||||
}
|
||||
|
||||
public function getBulanLaporanByYear($tahun){
|
||||
$this->db->select('bulan');
|
||||
$this->db->where('tahun',$tahun);
|
||||
|
||||
Reference in New Issue
Block a user