Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function _get_datatables_query_rtlh()
- {
- $anggaran_id = $this->uri->segment(4);
- $no_kec = $this->uri->segment(5);
- $no_kel = $this->uri->segment(6);
- $this->db->select('rtlh_no_urut, rtlh_post, penduduk_nik, penduduk_nama, penduduk_alamat,
- penduduk_rt, penduduk_rw, nama_kec, nama_kel, rtlh_budget, rtlh_pbdt, rtlh_status,
- rtlh_prioritas');
- $this->db->from('v_rtlh');
- $this->db->where('anggaran_id', $anggaran_id);
- $this->db->where('no_kec', $no_kec);
- $this->db->where('no_kel', $no_kel);
- $this->db->where('rtlh_step', 4);
- $this->db->where_not_in('penduduk_nik', 'SELECT penduduk_nik FROM rtlh_pokmas_anggota');
- // $this->db->get('v_rtlh')->result();
- // $sql = 'SELECT rtlh_no_urut, rtlh_post, penduduk_nik, penduduk_nama, penduduk_alamat,
- // penduduk_rt, penduduk_rw, nama_kec, nama_kel, rtlh_budget, rtlh_pbdt, rtlh_status,
- // rtlh_prioritas FROM v_rtlh
- // WHERE anggaran_id = '.$anggaran_id.' AND no_kec='.$no_kec.' AND no_kel='.$no_kel.' AND rtlh_step=4
- // AND penduduk_nik NOT IN (SELECT penduduk_nik FROM rtlh_pokmas_anggota)';
- // $this->db->query($sql)->result();
- $i = 0;
- foreach ($this->column_search3 as $item) {
- if ($_POST['search']['value']) {
- if ($i === 0) {
- $this->db->group_start();
- $this->db->like($item, $_POST['search']['value']);
- } else {
- $this->db->or_like($item, $_POST['search']['value']);
- }
- if (count($this->column_search3) - 1 == $i) {
- $this->db->group_end();
- }
- }
- $i++;
- }
- if (isset($_POST['order'])) {
- $this->db->order_by($this->column_order3[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);
- } else if (isset($this->order3)) {
- $order = $this->order3;
- $this->db->order_by(key($order), $order[key($order)]);
- }
- }
- public function get_datatables_rtlh()
- {
- $this->_get_datatables_query_rtlh();
- if ($_POST['length'] != -1) {
- $this->db->limit($_POST['length'], $_POST['start']);
- }
- $query = $this->db->get();
- return $query->result();
- }
- public function count_filtered_rtlh()
- {
- $this->_get_datatables_query_rtlh();
- $query = $this->db->get();
- return $query->num_rows();
- }
- public function count_all_rtlh()
- {
- $anggaran_id = $this->uri->segment(4);
- $no_kec = $this->uri->segment(5);
- $no_kel = $this->uri->segment(6);
- $this->db->from($this->table3);
- $this->db->where('anggaran_id', $anggaran_id);
- $this->db->where('no_kec', $no_kec);
- $this->db->where('no_kel', $no_kel);
- $this->db->where('rtlh_step', 4); // RAB
- return $this->db->count_all_results();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement