MINI
C:
/
Users
/
Administrator
/
Downloads
/
monitoring
/
application
/
models
/
Upload File:
files >> C:/Users/Administrator/Downloads/monitoring/application/models/Statistik_model.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Statistik_model extends CI_Model { public function __construct() { parent::__construct(); $this->load->database(); } public function get_stt_jml_pddk_kec() { //$this->db->from('STT_PIAK'); $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, (SUM(DAK_LK)+SUM(DAK_PR)) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $query = $this->db->get('STT_PIAK'); return $query->result(); } public function get_stt_jml_pddk_kel() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, NO_KEL as NO_KEL, (SUM(DAK_LK)+SUM(DAK_PR)) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->group_by('NO_KEL'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $this->db->order_by('NO_KEL'); $query = $this->db->get('STT_PIAK'); return $query->result(); } public function get_stt_wjb_ktp_kec() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, (SUM(WKTP_LK)+SUM(WKTP_PR)) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $query = $this->db->get('STT_PIAK'); return $query->result(); } public function get_stt_wjb_ktp_kel() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, NO_KEL as NO_KEL, (SUM(WKTP_LK)+SUM(WKTP_PR)) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->group_by('NO_KEL'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $this->db->order_by('NO_KEL'); $query = $this->db->get('STT_PIAK'); return $query->result(); } public function get_stt_blm_rekam_kec() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, SUM(REG) AS REG, SUM(UNREG) AS UNREG, SUM(LAINNYA) AS LAINNYA', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $query = $this->db->get('STT_DEMOGRAPHICS'); return $query->result(); } public function get_stt_prr_kec() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, SUM(PRR) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $query = $this->db->get('STT_DEMOGRAPHICS'); return $query->result(); } public function get_stt_prr_kel() { $this->db->select('NO_PROP AS NO_PROP, NO_KAB AS NO_KAB, NO_KEC as NO_KEC, NO_KEL as NO_KEL, SUM(PRR) AS JML', FALSE); $this->db->group_by('NO_PROP'); $this->db->group_by('NO_KAB'); $this->db->group_by('NO_KEC'); $this->db->group_by('NO_KEL'); $this->db->order_by('NO_PROP'); $this->db->order_by('NO_KAB'); $this->db->order_by('NO_KEC'); $this->db->order_by('NO_KEL'); $this->db->order_by('NO_KEC'); $this->db->order_by('NO_KEL'); $query = $this->db->get('STT_DEMOGRAPHICS'); return $query->result(); } public function get_stt_piak() { $this->db->from('STT_PIAK'); $query = $this->db->get(); return $query->result(); } public function get_stt_demographics() { $this->db->from('STT_DEMOGRAPHICS'); $query = $this->db->get(); return $query->result(); } public function get_stt_prr() { $this->db->from('STT_DEMOGRAPHICS'); $this->db->where('CURRENT_STATUS_CODE', 'PRINT_READY_RECORD'); $query = $this->db->get(); return $query->num_rows(); } public function get_stt_curr_stat_code() { $this->db->select('CURRENT_STATUS_CODE as CURRENT_STATUS_CODE, COUNT(*) AS JML', FALSE); $this->db->where('CURRENT_STATUS_CODE IS NOT NULL', NULL, FALSE); $this->db->group_by('CURRENT_STATUS_CODE'); $this->db->order_by('CURRENT_STATUS_CODE'); $query = $this->db->get('STT_DEMOGRAPHICS'); return $query->result(); } public function get_stt_cetak_ktpel_tgl($thn, $bln) { $this->db->select('BLN, TGL, SUM(JML) AS JML', FALSE); $this->db->where('THN', $thn); $this->db->where('BLN', $bln); $this->db->group_by('BLN'); $this->db->group_by('TGL'); $this->db->order_by('BLN'); $this->db->order_by('TGL'); $query = $this->db->get('STT_PIAK_CETAK_KTPEL'); return $query->result(); } public function get_stt_cetak_suket_tgl($thn, $bln) { $this->db->select('BLN, TGL, SUM(JML) AS JML', FALSE); $this->db->where('THN', $thn); $this->db->where('BLN', $bln); $this->db->group_by('BLN'); $this->db->group_by('TGL'); $this->db->order_by('BLN'); $this->db->order_by('TGL'); $query = $this->db->get('STT_PIAK_CETAK_SUKET'); return $query->result(); } public function get_stt_cetak_ktpel_bln() { $this->db->select('BLN as BLN, SUM(JML) AS JML', FALSE); $this->db->where('THN', '2017'); $this->db->group_by('BLN'); $this->db->order_by('BLN'); $query = $this->db->get('STT_PIAK_CETAK_KTPEL'); return $query->result(); } public function get_stt_cetak_suket_bln() { $this->db->select('BLN as BLN, SUM(JML) AS JML', FALSE); $this->db->where('THN', '2017'); $this->db->group_by('BLN'); $this->db->order_by('BLN'); $query = $this->db->get('STT_PIAK_CETAK_SUKET'); return $query->result(); } public function get_memiliki() { $this->db->from('biodata_wni'); $this->db->where('AKTA_LHR',2); $this->db->group_by('KODE_KEC'); $this->db->order_by('KODE_KEC'); $query = $this->db->get(); return $query->num_rows(); } public function get_tidak_memiliki() { $this->db->from('biodata_wni'); $this->db->where('AKTA_LHR',1); $this->db->group_by('KODE_KEC'); $this->db->order_by('KODE_KEC'); $query = $this->db->get(); return $query->num_rows(); } public function kec() { $this->db->from('biodata_wni'); $this->db->group_by('KODE_KEC'); $this->db->order_by('KODE_KEC'); $query = $this->db->get(); return $query->num_rows(); } public function get_kec($noprop, $nokab) { $this->db->from('SETUP_KEC'); $this->db->where('NO_PROP', $noprop); $this->db->where('NO_KAB', $nokab); $this->db->order_by('NO_KEC'); $query = $this->db->get(); return $query->result(); } public function get_kel($noprop, $nokab) { $this->db->from('SETUP_KEL'); $this->db->where('NO_PROP', $noprop); $this->db->where('NO_KAB', $nokab); $this->db->order_by('NO_KEC'); $this->db->order_by('NO_KEL'); $query = $this->db->get(); return $query->result(); } public function get_stk_blangko() { $this->db->from('STK_BLK'); $query = $this->db->get(); return $query->row(); } public function get_cetak() { $this->db->from('STT_PIAK_BLK_KTPEL'); $query = $this->db->get(); return $query->row(); } } ?>
Copyright ©2021 || Defacer Indonesia