From 1f7c4932a9f349ed060a58ea7c026ef5b8dee542 Mon Sep 17 00:00:00 2001 From: Arif Priadi <145224165+arifpriadi@users.noreply.github.com> Date: Mon, 2 Oct 2023 22:20:13 +0800 Subject: [PATCH] (#477) Hapus duplikat function `bulan()` --- donjo-app/Controllers/Laporan.php | 4 +- donjo-app/Helpers/donjolib_helper.php | 63 +------------------- donjo-app/Models/Laporan_bulanan_model.php | 43 ------------- donjo-app/Models/Laporan_perubahan_model.php | 43 ------------- 4 files changed, 3 insertions(+), 150 deletions(-) diff --git a/donjo-app/Controllers/Laporan.php b/donjo-app/Controllers/Laporan.php index d57724f8e..142f3f4d3 100644 --- a/donjo-app/Controllers/Laporan.php +++ b/donjo-app/Controllers/Laporan.php @@ -75,7 +75,7 @@ public function cetak($lap = 0) $data['config'] = $config->get_data(true); $data['bulan'] = $_SESSION['bulanku']; $data['tahun'] = $_SESSION['tahunku']; - $data['bln'] = $this->laporan_bulanan_model->bulan($data['bulan']); + $data['bln'] = getBulan($data['bulan']); $data['penduduk_awal'] = $this->laporan_bulanan_model->penduduk_awal(); $data['penduduk_akhir'] = $this->laporan_bulanan_model->penduduk_akhir(); $data['kelahiran'] = $this->laporan_bulanan_model->kelahiran(); @@ -94,7 +94,7 @@ public function excel($lap = 0) $data['config'] = $config->get_data(true); $data['bulan'] = $_SESSION['bulanku']; $data['tahun'] = $_SESSION['tahunku']; - $data['bln'] = $this->laporan_bulanan_model->bulan($data['bulan']); + $data['bln'] = getBulan($data['bulan']); $data['penduduk_awal'] = $this->laporan_bulanan_model->penduduk_awal(); $data['penduduk_akhir'] = $this->laporan_bulanan_model->penduduk_akhir(); $data['kelahiran'] = $this->laporan_bulanan_model->kelahiran(); diff --git a/donjo-app/Helpers/donjolib_helper.php b/donjo-app/Helpers/donjolib_helper.php index d2d5827c7..7872e6eff 100644 --- a/donjo-app/Helpers/donjolib_helper.php +++ b/donjo-app/Helpers/donjolib_helper.php @@ -146,7 +146,6 @@ function Rpt($str = 0) function Parse_Data($data, $p1, $p2) { $data = ' ' . $data; - $hasil = ''; $awal = strpos($data, (string) $p1); $akhir = strpos(strstr($data, (string) $p1), (string) $p2); @@ -229,66 +228,6 @@ function ununderscore($str) { return str_replace('_', ' ', $str); } -function bulan($bln) -{ - $nm = ''; - - switch ($bln) { - case '1': - $nm = 'Januari'; - break; - - case '2': - $nm = 'Februari'; - break; - - case '3': - $nm = 'Maret'; - break; - - case '4': - $nm = 'April'; - break; - - case '5': - $nm = 'Mei'; - break; - - case '6': - $nm = 'Juni'; - break; - - case '7': - $nm = 'Juli'; - break; - - case '8': - $nm = 'Agustus'; - break; - - case '9': - $nm = 'September'; - break; - - case '10': - $nm = 'Oktober'; - break; - - case '11': - $nm = 'November'; - break; - - case '12': - $nm = 'Desember'; - break; - - default: - $nm = ''; - break; - } - - return $nm; -} function tgl_indo2($tgl) { @@ -412,7 +351,7 @@ function mandiri_timer() } function mandiri_timeout() { - if (! isset($_SESSION['mandiri_timeout'])) { + if (!isset($_SESSION['mandiri_timeout'])) { $_SESSION['mandiri_timeout'] = time() - 1; } diff --git a/donjo-app/Models/Laporan_bulanan_model.php b/donjo-app/Models/Laporan_bulanan_model.php index 324a89971..0aa06fbf5 100644 --- a/donjo-app/Models/Laporan_bulanan_model.php +++ b/donjo-app/Models/Laporan_bulanan_model.php @@ -91,49 +91,6 @@ public function tahun_sql() } } - public function bulan($bulan) - { - switch ($bulan) { - case 1: $bulan = 'Januari'; - break; - - case 2: $bulan = 'Februari'; - break; - - case 3: $bulan = 'Maret'; - break; - - case 4: $bulan = 'April'; - break; - - case 5: $bulan = 'Mei'; - break; - - case 6: $bulan = 'Juni'; - break; - - case 7: $bulan = 'Juli'; - break; - - case 8: $bulan = 'Agustus'; - break; - - case 9: $bulan = 'September'; - break; - - case 10: $bulan = 'Oktober'; - break; - - case 11: $bulan = 'November'; - break; - - case 12: $bulan = 'Desember'; - break; - } - - return $bulan; - } - public function paging($lap = 0, $p = 1, $o = 0) { $paging = new Paging(); diff --git a/donjo-app/Models/Laporan_perubahan_model.php b/donjo-app/Models/Laporan_perubahan_model.php index 88e6cb910..8fd875bf7 100644 --- a/donjo-app/Models/Laporan_perubahan_model.php +++ b/donjo-app/Models/Laporan_perubahan_model.php @@ -4,49 +4,6 @@ class Laporan_perubahan_model extends Model { - public function bulan($bulan) - { - switch ($bulan) { - case 1: $bulan = 'Januari'; - break; - - case 2: $bulan = 'Februari'; - break; - - case 3: $bulan = 'Maret'; - break; - - case 4: $bulan = 'April'; - break; - - case 5: $bulan = 'Mei'; - break; - - case 6: $bulan = 'Juni'; - break; - - case 7: $bulan = 'Juli'; - break; - - case 8: $bulan = 'Agustus'; - break; - - case 9: $bulan = 'September'; - break; - - case 10: $bulan = 'Oktober'; - break; - - case 11: $bulan = 'November'; - break; - - case 12: $bulan = 'Desember'; - break; - } - - return $bulan; - } - public function list_data() { $sql = "SELECT x.dusun,