From c11c129b3e1259354c8c31b57255bcdcc5327ba9 Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Sat, 19 Nov 2022 20:01:57 +0700 Subject: [PATCH] duplikat `get_data()` untuk pemanggilan config --- donjo-app/controllers/First.php | 24 ++++++++++++------------ donjo-app/models/First_m.php | 8 -------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/donjo-app/controllers/First.php b/donjo-app/controllers/First.php index bb3d9dc7c..6ac83f144 100644 --- a/donjo-app/controllers/First.php +++ b/donjo-app/controllers/First.php @@ -57,7 +57,7 @@ public function ganti() public function index($p = 1) { $data['p'] = $p; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['headline'] = $this->first_artikel_m->get_headline(); @@ -93,7 +93,7 @@ public function mandiri($p = 1, $m = 0) redirect('first'); } else { $data['p'] = $p; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['headline'] = $this->first_artikel_m->get_headline(); @@ -131,7 +131,7 @@ public function artikel($id = '', $p = 1) $id = explode('-', $id); $id = $id[0]; $data['p'] = $p; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['paging'] = $this->first_artikel_m->paging($p); $data['artikel'] = $this->first_artikel_m->list_artikel(0, $data['paging']->offset, $data['paging']->per_page); @@ -160,7 +160,7 @@ public function arsip($p = 1) $data['paging'] = $this->first_artikel_m->paging_arsip($p); $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['sosmed'] = $this->first_artikel_m->list_sosmed(); @@ -181,7 +181,7 @@ public function gallery($p = 1) { $data['p'] = $p; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); $data['paging'] = $this->first_artikel_m->paging($p); @@ -209,7 +209,7 @@ public function sub_gallery($gal = 0, $p = 1) { $data['p'] = $p; $data['gal'] = $gal; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['paging'] = $this->first_gallery_m->paging($p); $data['gallery'] = $this->first_gallery_m->gallery_show($data['paging']->offset, $data['paging']->per_page); @@ -264,7 +264,7 @@ public function statistik($stat = '', $tipe = 0) $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); $data['slide'] = $this->first_artikel_m->slide_show(); - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['stat'] = $this->first_penduduk_m->list_data($stat); @@ -284,7 +284,7 @@ public function data_analisis($stat = '', $sb = 0, $per = 0) { $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); $data['slide'] = $this->first_artikel_m->slide_show(); - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); @@ -311,7 +311,7 @@ public function wilayah() $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); $data['main'] = $this->first_penduduk_m->wilayah(); $data['heading'] = 'Populasi Per Wilayah'; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); @@ -333,7 +333,7 @@ public function statistik_k($tipex = 0) $data['tipe'] = 2; $data['tipex'] = $tipex; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['teks_berjalan'] = $this->first_artikel_m->get_teks_berjalan(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); @@ -352,7 +352,7 @@ public function statistik_k($tipex = 0) public function agenda($stat = 0) { - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['artikel'] = $this->first_artikel_m->agenda_show(); @@ -369,7 +369,7 @@ public function agenda($stat = 0) public function kategori($kat = 0, $p = 0) { $data['p'] = $p; - $data['desa'] = $this->first_m->get_data(); + $data['desa'] = $this->config_model->get_data(); $data['menu_atas'] = $this->first_menu_m->list_menu_atas(); $data['menu_kiri'] = $this->first_menu_m->list_menu_kiri(); $data['headline'] = null; diff --git a/donjo-app/models/First_m.php b/donjo-app/models/First_m.php index b48c6e0c4..8b1457403 100644 --- a/donjo-app/models/First_m.php +++ b/donjo-app/models/First_m.php @@ -2,14 +2,6 @@ class First_m extends CI_Model { - public function get_data() - { - $sql = 'SELECT * FROM config WHERE 1'; - $query = $this->db->query($sql); - - return $query->row_array(); - } - public function siteman() { $_SESSION['mandiri'] = -1;