Skip to content

Commit

Permalink
(#264) gunakan get_data() langsung dari config_model
Browse files Browse the repository at this point in the history
  • Loading branch information
totoprayogo1916 authored Nov 19, 2022
1 parent 32a059b commit 0a9f27e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
24 changes: 12 additions & 12 deletions donjo-app/controllers/First.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions donjo-app/models/First_m.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a9f27e

Please sign in to comment.