From 5e94f90ac18dd62553396c2ece02b7d328ec1d4a Mon Sep 17 00:00:00 2001 From: Hafidz Fachrisyah Date: Tue, 21 Sep 2021 15:19:35 +0700 Subject: [PATCH] Public landing page done --- application/controllers/Bulanan.php | 219 +++++++++++ application/controllers/Dashboard.php | 10 + application/controllers/Kecamatan.php | 249 +++++++++++++ application/controllers/Kelurahan.php | 239 ++++++++++++ application/controllers/Produk.php | 38 ++ application/controllers/Tahunan.php | 271 ++++++++++++++ application/controllers/Umkm.php | 25 ++ application/models/ProdukModel.php | 11 +- application/models/UmkmModel.php | 2 +- application/views/bulanan.php | 474 ++++++++++++++++++++++++ application/views/dashboard.php | 364 +++++++----------- application/views/kecamatan.php | 425 +++++++++++++++++++++ application/views/kelurahan.php | 498 +++++++++++++++++++++++++ application/views/laporan.php | 514 ++++++++++++++++++++++++++ application/views/produk.php | 132 +++++++ application/views/umkm.php | 130 +++++++ db_umkm2_test.sql | 23 +- 17 files changed, 3385 insertions(+), 239 deletions(-) create mode 100644 application/controllers/Bulanan.php create mode 100644 application/controllers/Kecamatan.php create mode 100644 application/controllers/Kelurahan.php create mode 100644 application/controllers/Produk.php create mode 100644 application/controllers/Tahunan.php create mode 100644 application/controllers/Umkm.php create mode 100644 application/views/bulanan.php create mode 100644 application/views/kecamatan.php create mode 100644 application/views/kelurahan.php create mode 100644 application/views/laporan.php create mode 100644 application/views/produk.php create mode 100644 application/views/umkm.php diff --git a/application/controllers/Bulanan.php b/application/controllers/Bulanan.php new file mode 100644 index 0000000..ba63a5b --- /dev/null +++ b/application/controllers/Bulanan.php @@ -0,0 +1,219 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + + } + + public function index() + { + + //cek ada laporan tahunan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + $year = $this->LaporanModel->getLastYearLaporan()->tahun; + + //cek ada laporan bulanan atau tidak + $countlaporanbulan = $this->LaporanModel->getLaporanCountByYear($year); + if($countlaporanbulan>0){ + + $data['tahun'] = $year; + + if($this->input->post()){ + $post = $this->input->post(); + $month = $post['bulan']; + } else { + $month = $this->LaporanModel->getLastMonthLaporan($year)->bulan; + } + + + $data['bulan'] = $month; + + + $omset_jen1=0; + $omset_jen2=0; + $omset_jen3=0; + + $umkm_jen1=0; + $umkm_jen2=0; + $umkm_jen3=0; + + $umkm_jen1_ket1=0; + $umkm_jen1_ket2=0; + $umkm_jen1_ket3=0; + $umkm_jen2_ket1=0; + $umkm_jen2_ket2=0; + $umkm_jen2_ket3=0; + $umkm_jen3_ket1=0; + $umkm_jen3_ket2=0; + $umkm_jen3_ket3=0; + + $aset_jen1=0; + $aset_jen2=0; + $aset_jen3=0; + $naker_jen1_l=0; + $naker_jen1_p=0; + $naker_jen2_l=0; + $naker_jen2_p=0; + $naker_jen3_l=0; + $naker_jen3_p=0; + + $lap_kelurahan = $this->LaporanModel->getKelurahanByBulanAndYear($month,$year); + + foreach($lap_kelurahan as $kelurahan){ + $laporan = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($month,$year,$kelurahan->kelurahan); + $umkm_jen1= $umkm_jen1+$laporan->umkm_jen1_kat1+$laporan->umkm_jen1_kat2+$laporan->umkm_jen1_kat3; + $umkm_jen2= $umkm_jen2+$laporan->umkm_jen2_kat1+$laporan->umkm_jen2_kat2+$laporan->umkm_jen2_kat3; + $umkm_jen3= $umkm_jen3+$laporan->umkm_jen3_kat1+$laporan->umkm_jen3_kat2+$laporan->umkm_jen3_kat3; + $omset_jen1= $omset_jen1+$laporan->omset_jenis1; + $omset_jen2= $omset_jen2+$laporan->omset_jenis2; + $omset_jen3= $omset_jen3+$laporan->omset_jenis3; + $aset_jen1= $aset_jen1+$laporan->aset_jenis1; + $aset_jen2= $aset_jen2+$laporan->aset_jenis2; + $aset_jen3= $aset_jen3+$laporan->aset_jenis3; + $naker_jen1_l = $naker_jen1_l + $laporan->karyawan_jen1_l; + $naker_jen1_p = $naker_jen1_p + $laporan->karyawan_jen1_p; + $naker_jen2_l = $naker_jen2_l + $laporan->karyawan_jen2_l; + $naker_jen2_p = $naker_jen2_p + $laporan->karyawan_jen2_p; + $naker_jen3_l = $naker_jen3_l + $laporan->karyawan_jen3_l; + $naker_jen3_p = $naker_jen3_p + $laporan->karyawan_jen3_p; + + $umkm_jen1_ket1=$umkm_jen1_ket1+$laporan->umkm_jen1_kat1; + $umkm_jen1_ket2=$umkm_jen1_ket2+$laporan->umkm_jen1_kat2; + $umkm_jen1_ket3=$umkm_jen1_ket3+$laporan->umkm_jen1_kat3; + $umkm_jen2_ket1=$umkm_jen2_ket1+$laporan->umkm_jen2_kat1; + $umkm_jen2_ket2=$umkm_jen2_ket2+$laporan->umkm_jen2_kat2; + $umkm_jen2_ket3=$umkm_jen2_ket3+$laporan->umkm_jen2_kat3; + $umkm_jen3_ket1=$umkm_jen3_ket1+$laporan->umkm_jen3_kat1; + $umkm_jen3_ket2=$umkm_jen3_ket2+$laporan->umkm_jen3_kat2; + $umkm_jen3_ket3=$umkm_jen3_ket3+$laporan->umkm_jen3_kat3; + + } + + + + + $data['umkm_jen1_ket1']=$umkm_jen1_ket1; + $data['umkm_jen1_ket2']=$umkm_jen1_ket2; + $data['umkm_jen1_ket3']=$umkm_jen1_ket3; + $data['umkm_jen2_ket1']=$umkm_jen2_ket1; + $data['umkm_jen2_ket2']=$umkm_jen2_ket2; + $data['umkm_jen2_ket3']=$umkm_jen2_ket3; + $data['umkm_jen3_ket1']=$umkm_jen3_ket1; + $data['umkm_jen3_ket2']=$umkm_jen3_ket2; + $data['umkm_jen3_ket3']=$umkm_jen3_ket3; + + + $omset_bln_jen1= $omset_jen1; + $omset_bln_jen2= $omset_jen2; + $omset_bln_jen3= $omset_jen3; + + + + $data['umkm_jen1']=$umkm_jen1; + $data['umkm_jen2']=$umkm_jen2; + $data['umkm_jen3']=$umkm_jen3; + + $data['omset_bln_jen1'] = $omset_bln_jen1; + $data['omset_bln_jen2'] = $omset_bln_jen2; + $data['omset_bln_jen3'] = $omset_bln_jen3; + + $data['aset_jen1'] = $aset_jen1; + $data['aset_jen2'] = $aset_jen2; + $data['aset_jen3'] = $aset_jen3; + $data['naker_jen1_l'] = $naker_jen1_l; + $data['naker_jen1_p'] = $naker_jen1_p; + $data['naker_jen2_l'] = $naker_jen2_l; + $data['naker_jen2_p'] = $naker_jen2_p; + $data['naker_jen3_l'] = $naker_jen3_l; + $data['naker_jen3_p'] = $naker_jen3_p; + + //komulatif + $data['omset_1'] = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3; + $data['aset_1'] = $aset_jen1+$aset_jen2+$aset_jen3; + $data['umkm_1'] = $umkm_jen1+$umkm_jen2+$umkm_jen3; + $naker_1 = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l; + $data['naker_1'] = $naker_1+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p; + $data['mikro_1'] = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1; + $data['kecil_1'] = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2; + $data['menengah_1'] = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3; + + $data['msg'] = 'found'; + } + } else { + $data['msg'] = 'empty'; + } + + + + $data['user_logged'] = $this->session->userdata('user_logged'); + + $bulanlist = array( + array( + 'bulan'=>'1', + 'text'=>'Januari' + ), + array( + 'bulan'=>'2', + 'text'=>'Februari' + ), + array( + 'bulan'=>'3', + 'text'=>'Maret' + ), + array( + 'bulan'=>'4', + 'text'=>'April' + ), + array( + 'bulan'=>'5', + 'text'=>'Mei' + ), + array( + 'bulan'=>'6', + 'text'=>'Juni' + ), + array( + 'bulan'=>'7', + 'text'=>'Juli' + ), + array( + 'bulan'=>'8', + 'text'=>'Agustus' + ), + array( + 'bulan'=>'9', + 'text'=>'September' + ), + array( + 'bulan'=>'10', + 'text'=>'Oktober' + ), + array( + 'bulan'=>'11', + 'text'=>'November' + ), + array( + 'bulan'=>'12', + 'text'=>'Desember' + ) + ); + + $data['bulan_list']= $bulanlist; + + $this->load->view('bulanan',$data); + + } + + +} diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index f18fce8..cb017bc 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -16,6 +16,16 @@ class Dashboard extends CI_Controller { { $data['produk'] = $this->ProdukModel->getThree(); + $data['jumlah_umkm'] = $this->UmkmModel->getUmkmCount(); + $list_umkm = $this->UmkmModel->getUmkm(); + + $jumlah_karyawan=0; + foreach($list_umkm as $umkm){ + $jumlah_karyawan = $jumlah_karyawan + $umkm->karyawan_l + $umkm->karyawan_p; + } + + $data['jumlah_karyawan'] = $jumlah_karyawan; + $data['jumlah_produk'] = $this->ProdukModel->getProdukCount(); $data['umkm'] = $this->UmkmModel->getThree(); $data['user_logged'] = $this->session->userdata('user_logged'); $this->load->view('dashboard',$data); diff --git a/application/controllers/Kecamatan.php b/application/controllers/Kecamatan.php new file mode 100644 index 0000000..60279e9 --- /dev/null +++ b/application/controllers/Kecamatan.php @@ -0,0 +1,249 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + + } + + public function index() + { + + if($this->input->post()){ + $post = $this->input->post(); + $kecamatan = $post['kecamatan']; + } else { + $kecamatan = 'Magelang Selatan'; + } + + //cek ada laporan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + $year = $this->LaporanModel->getLastYearLaporan()->tahun; + } else { + redirect(site_url('admin/laporan'));die(); + } + + //cek ada laporan kecamatan atau tidak + $countlaporankec = $this->LaporanModel->getCountByTahunByKecamatan($year,$kecamatan); + if($countlaporankec>0){ + $data['msg'] = 'found'; + $listkel = $this->LaporanModel->getKelurahanByTahunAndKecamatan($year,$kecamatan); + foreach($listkel as $kel){ + $listlapkel = $this->LaporanModel->getLaporanByTahunAndKelurahan($year,$kel->kelurahan); + $lap[$kel->kelurahan]['kelurahan']=''; + $lap[$kel->kelurahan]['aset']=0; + $lap[$kel->kelurahan]['omset']=0; + $lap[$kel->kelurahan]['karyawan_jenis1']=0; + $lap[$kel->kelurahan]['karyawan_jenis2']=0; + $lap[$kel->kelurahan]['karyawan_jenis3']=0; + $lap[$kel->kelurahan]['omset_jenis1']=0; + $lap[$kel->kelurahan]['omset_jenis2']=0; + $lap[$kel->kelurahan]['omset_jenis3']=0; + $lap[$kel->kelurahan]['aset_jenis1']=0; + $lap[$kel->kelurahan]['aset_jenis2']=0; + $lap[$kel->kelurahan]['aset_jenis3']=0; + $lap[$kel->kelurahan]['karyawan_jen1_l']=0; + $lap[$kel->kelurahan]['karyawan_jen2_l']=0; + $lap[$kel->kelurahan]['karyawan_jen3_l']=0; + $lap[$kel->kelurahan]['karyawan_jen1_p']=0; + $lap[$kel->kelurahan]['karyawan_jen2_p']=0; + $lap[$kel->kelurahan]['karyawan_jen3_p']=0; + $lap[$kel->kelurahan]['umkm_jen1_kat1']=0; + $lap[$kel->kelurahan]['umkm_jen1_kat2']=0; + $lap[$kel->kelurahan]['umkm_jen1_kat3']=0; + $lap[$kel->kelurahan]['umkm_jen2_kat1']=0; + $lap[$kel->kelurahan]['umkm_jen2_kat2']=0; + $lap[$kel->kelurahan]['umkm_jen2_kat3']=0; + $lap[$kel->kelurahan]['umkm_jen3_kat1']=0; + $lap[$kel->kelurahan]['umkm_jen3_kat2']=0; + $lap[$kel->kelurahan]['umkm_jen3_kat3']=0; + foreach($listlapkel as $lapkel){ + $lap[$kel->kelurahan]['kelurahan']=$lapkel->kelurahan; + $lap[$lapkel->kelurahan]['aset']=$lapkel->aset; + $lap[$lapkel->kelurahan]['omset']=$lap[$lapkel->kelurahan]['omset']+$lapkel->omset; + $lap[$lapkel->kelurahan]['karyawan_jenis1']=$lapkel->karyawan_jenis1; + $lap[$lapkel->kelurahan]['karyawan_jenis2']=$lapkel->karyawan_jenis2; + $lap[$lapkel->kelurahan]['karyawan_jenis3']=$lapkel->karyawan_jenis3; + $lap[$lapkel->kelurahan]['omset_jenis1']=$lap[$lapkel->kelurahan]['omset_jenis1']+$lapkel->omset_jenis1; + $lap[$lapkel->kelurahan]['omset_jenis2']=$lap[$lapkel->kelurahan]['omset_jenis2']+$lapkel->omset_jenis2; + $lap[$lapkel->kelurahan]['omset_jenis3']=$lap[$lapkel->kelurahan]['omset_jenis3']+$lapkel->omset_jenis3; + $lap[$lapkel->kelurahan]['aset_jenis1']=$lapkel->aset_jenis1; + $lap[$lapkel->kelurahan]['aset_jenis2']=$lapkel->aset_jenis2; + $lap[$lapkel->kelurahan]['aset_jenis3']=$lapkel->aset_jenis3; + $lap[$lapkel->kelurahan]['karyawan_jen1_l']=$lapkel->karyawan_jen1_l; + $lap[$lapkel->kelurahan]['karyawan_jen2_l']=$lapkel->karyawan_jen2_l; + $lap[$lapkel->kelurahan]['karyawan_jen3_l']=$lapkel->karyawan_jen3_l; + $lap[$lapkel->kelurahan]['karyawan_jen1_p']=$lapkel->karyawan_jen1_p; + $lap[$lapkel->kelurahan]['karyawan_jen2_p']=$lapkel->karyawan_jen2_p; + $lap[$lapkel->kelurahan]['karyawan_jen3_p']=$lapkel->karyawan_jen3_p; + $lap[$lapkel->kelurahan]['umkm_jen1_kat1']=$lapkel->umkm_jen1_kat1; + $lap[$lapkel->kelurahan]['umkm_jen1_kat2']=$lapkel->umkm_jen1_kat2; + $lap[$lapkel->kelurahan]['umkm_jen1_kat3']=$lapkel->umkm_jen1_kat3; + $lap[$lapkel->kelurahan]['umkm_jen2_kat1']=$lapkel->umkm_jen2_kat1; + $lap[$lapkel->kelurahan]['umkm_jen2_kat2']=$lapkel->umkm_jen2_kat2; + $lap[$lapkel->kelurahan]['umkm_jen2_kat3']=$lapkel->umkm_jen2_kat3; + $lap[$lapkel->kelurahan]['umkm_jen3_kat1']=$lapkel->umkm_jen3_kat1; + $lap[$lapkel->kelurahan]['umkm_jen3_kat2']=$lapkel->umkm_jen3_kat2; + $lap[$lapkel->kelurahan]['umkm_jen3_kat3']=$lapkel->umkm_jen3_kat3; + if($lapkel->bulan==12){ + $lap[$lapkel->kelurahan]['omset'] = $lap[$lapkel->kelurahan]['omset']/12; + $lap[$lapkel->kelurahan]['omset_jenis1'] = $lap[$lapkel->kelurahan]['omset_jenis1']/12; + $lap[$lapkel->kelurahan]['omset_jenis2'] = $lap[$lapkel->kelurahan]['omset_jenis2']/12; + $lap[$lapkel->kelurahan]['omset_jenis3'] = $lap[$lapkel->kelurahan]['omset_jenis3']/12; + $lap[$lapkel->kelurahan]['umkm_jenis1'] = $lap[$lapkel->kelurahan]['umkm_jen1_kat1']+$lap[$lapkel->kelurahan]['umkm_jen1_kat2']+$lap[$lapkel->kelurahan]['umkm_jen1_kat3']; + $lap[$lapkel->kelurahan]['umkm_jenis2'] = $lap[$lapkel->kelurahan]['umkm_jen2_kat1']+$lap[$lapkel->kelurahan]['umkm_jen2_kat2']+$lap[$lapkel->kelurahan]['umkm_jen2_kat3']; + $lap[$lapkel->kelurahan]['umkm_jenis3'] = $lap[$lapkel->kelurahan]['umkm_jen3_kat1']+$lap[$lapkel->kelurahan]['umkm_jen3_kat2']+$lap[$lapkel->kelurahan]['umkm_jen3_kat3']; + } + } + } + + $aset=0; + $omset=0; + $karyawan_jenis1=0; + $karyawan_jenis2=0; + $karyawan_jenis3=0; + $omset_jenis1=0; + $omset_jenis2=0; + $omset_jenis3=0; + $aset_jenis1=0; + $aset_jenis2=0; + $aset_jenis3=0; + $karyawan_jen1_l=0; + $karyawan_jen2_l=0; + $karyawan_jen3_l=0; + $karyawan_jen1_p=0; + $karyawan_jen2_p=0; + $karyawan_jen3_p=0; + $umkm_jen1_kat1=0; + $umkm_jen1_kat2=0; + $umkm_jen1_kat3=0; + $umkm_jen2_kat1=0; + $umkm_jen2_kat2=0; + $umkm_jen2_kat3=0; + $umkm_jen3_kat1=0; + $umkm_jen3_kat2=0; + $umkm_jen3_kat3=0; + $umkm_jenis1=0; + $umkm_jenis2=0; + $umkm_jenis3=0; + + foreach($lap as $laporan){ + $aset=$aset+$laporan['aset']; + $omset=$omset+$laporan['omset']; + $karyawan_jenis1=$karyawan_jenis1+$laporan['karyawan_jenis1']; + $karyawan_jenis2=$karyawan_jenis2+$laporan['karyawan_jenis2']; + $karyawan_jenis3=$karyawan_jenis3+$laporan['karyawan_jenis3']; + $omset_jenis1=$omset_jenis1+$laporan['omset_jenis1']; + $omset_jenis2=$omset_jenis2+$laporan['omset_jenis2']; + $omset_jenis3=$omset_jenis3+$laporan['omset_jenis3']; + $aset_jenis1=$aset_jenis1+$laporan['aset_jenis1']; + $aset_jenis2=$aset_jenis2+$laporan['aset_jenis2']; + $aset_jenis3=$aset_jenis3+$laporan['aset_jenis3']; + $karyawan_jen1_l=$karyawan_jen1_l+$laporan['karyawan_jen1_l']; + $karyawan_jen2_l=$karyawan_jen2_l+$laporan['karyawan_jen2_l']; + $karyawan_jen3_l=$karyawan_jen3_l+$laporan['karyawan_jen3_l']; + $karyawan_jen1_p=$karyawan_jen1_p+$laporan['karyawan_jen1_p']; + $karyawan_jen2_p=$karyawan_jen2_p+$laporan['karyawan_jen2_p']; + $karyawan_jen3_p=$karyawan_jen3_p+$laporan['karyawan_jen3_p']; + $umkm_jen1_kat1=$umkm_jen1_kat1+$laporan['umkm_jen1_kat1']; + $umkm_jen1_kat2=$umkm_jen1_kat2+$laporan['umkm_jen1_kat2']; + $umkm_jen1_kat3=$umkm_jen1_kat3+$laporan['umkm_jen1_kat3']; + $umkm_jen2_kat1=$umkm_jen2_kat1+$laporan['umkm_jen2_kat1']; + $umkm_jen2_kat2=$umkm_jen2_kat2+$laporan['umkm_jen2_kat2']; + $umkm_jen2_kat3=$umkm_jen2_kat3+$laporan['umkm_jen2_kat3']; + $umkm_jen3_kat1=$umkm_jen3_kat1+$laporan['umkm_jen3_kat1']; + $umkm_jen3_kat2=$umkm_jen3_kat2+$laporan['umkm_jen3_kat2']; + $umkm_jen3_kat3=$umkm_jen3_kat3+$laporan['umkm_jen3_kat3']; + $umkm_jenis1=$umkm_jenis1+$laporan['umkm_jenis1']; + $umkm_jenis2=$umkm_jenis2+$laporan['umkm_jenis2']; + $umkm_jenis3=$umkm_jenis3+$laporan['umkm_jenis3']; + + $umkm = $umkm_jen1_kat1+$umkm_jen1_kat2+$umkm_jen1_kat3+$umkm_jen2_kat1+$umkm_jen2_kat2+$umkm_jen2_kat3+$umkm_jen3_kat1+$umkm_jen3_kat2+$umkm_jen3_kat3; + $karyawan = $karyawan_jenis1+$karyawan_jenis2+$karyawan_jenis3; + $umkm_kat1 = $umkm_jen1_kat1+$umkm_jen1_kat1+$umkm_jen1_kat1; + $umkm_kat2 = $umkm_jen1_kat2+$umkm_jen1_kat2+$umkm_jen1_kat2; + $umkm_kat3 = $umkm_jen1_kat3+$umkm_jen1_kat3+$umkm_jen1_kat3; + } + + $data['listlaporan']=$lap; + $data['aset']=$aset; + $data['omset']=$omset; + $data['karyawan_jenis1']=$karyawan_jenis1; + $data['karyawan_jenis2']=$karyawan_jenis2; + $data['karyawan_jenis3']=$karyawan_jenis3; + $data['omset_jenis1']=$omset_jenis1; + $data['omset_jenis2']=$omset_jenis2; + $data['omset_jenis3']=$omset_jenis3; + $data['aset_jenis1']=$aset_jenis1; + $data['aset_jenis2']=$aset_jenis2; + $data['aset_jenis3']=$aset_jenis3; + $data['karyawan_jen1_l']=$karyawan_jen1_l; + $data['karyawan_jen2_l']=$karyawan_jen2_l; + $data['karyawan_jen3_l']=$karyawan_jen3_l; + $data['karyawan_jen1_p']=$karyawan_jen1_p; + $data['karyawan_jen2_p']=$karyawan_jen2_p; + $data['karyawan_jen3_p']=$karyawan_jen3_p; + $data['umkm_jen1_kat1']=$umkm_jen1_kat1; + $data['umkm_jen1_kat2']=$umkm_jen1_kat2; + $data['umkm_jen1_kat3']=$umkm_jen1_kat3; + $data['umkm_jen2_kat1']=$umkm_jen2_kat1; + $data['umkm_jen2_kat2']=$umkm_jen2_kat2; + $data['umkm_jen2_kat3']=$umkm_jen2_kat3; + $data['umkm_jen3_kat1']=$umkm_jen3_kat1; + $data['umkm_jen3_kat2']=$umkm_jen3_kat2; + $data['umkm_jen3_kat3']=$umkm_jen3_kat3; + $data['umkm_jenis1']=$umkm_jenis1; + $data['umkm_jenis2']=$umkm_jenis2; + $data['umkm_jenis3']=$umkm_jenis3; + + $data['umkm']= $umkm; + $data['karyawan']= $karyawan; + $data['umkm_kat1']= $umkm_kat1; + $data['umkm_kat2']= $umkm_kat2; + $data['umkm_kat3']= $umkm_kat3; + + + + } else { + $data['msg'] = 'empty'; + } + + + + $data['user_logged'] = $this->session->userdata('user_logged'); + + $kecamatanlist = array( + array( + 'id'=>'1', + 'kecamatan'=>'Magelang Selatan' + ), + array( + 'id'=>'2', + 'kecamatan'=>'Magelang Tengah' + ), + array( + 'id'=>'3', + 'kecamatan'=>'Magelang Utara' + ) + ); + + $data['kecamatan_list']= $kecamatanlist; + $data['kecamatan'] = $kecamatan; + $data['tahun'] = $year; + + $this->load->view('kecamatan',$data); + + } + + +} diff --git a/application/controllers/Kelurahan.php b/application/controllers/Kelurahan.php new file mode 100644 index 0000000..6d87a32 --- /dev/null +++ b/application/controllers/Kelurahan.php @@ -0,0 +1,239 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + $this->load->model("KelurahanModel"); + $this->load->model("AbsensiModel"); + $this->load->model("UmkmModel"); + + + } + + public function index() + { + + if($this->input->post()){ + $post = $this->input->post(); + $kelurahan = $post['kelurahan']; + } else { + $kelurahan = 'Rejowinangun Selatan'; + } + + //cek ada laporan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + $year = $this->LaporanModel->getLastYearLaporan()->tahun; + } else { + redirect(site_url('admin/laporan'));die(); + } + + //cek ada laporan kelurahan atau tidak + $countlaporankel = $this->LaporanModel->getCountByTahunByKelurahan($year,$kelurahan); + if($countlaporankel>0){ + $data['msg'] = 'found'; + $listlapkel = $this->LaporanModel->getLaporanByTahunAndKelurahan($year,$kelurahan); + $lap[$kelurahan]['kelurahan']=''; + $lap[$kelurahan]['aset']=0; + $lap[$kelurahan]['omset']=0; + $lap[$kelurahan]['karyawan_jenis1']=0; + $lap[$kelurahan]['karyawan_jenis2']=0; + $lap[$kelurahan]['karyawan_jenis3']=0; + $lap[$kelurahan]['omset_jenis1']=0; + $lap[$kelurahan]['omset_jenis2']=0; + $lap[$kelurahan]['omset_jenis3']=0; + $lap[$kelurahan]['aset_jenis1']=0; + $lap[$kelurahan]['aset_jenis2']=0; + $lap[$kelurahan]['aset_jenis3']=0; + $lap[$kelurahan]['karyawan_jen1_l']=0; + $lap[$kelurahan]['karyawan_jen2_l']=0; + $lap[$kelurahan]['karyawan_jen3_l']=0; + $lap[$kelurahan]['karyawan_jen1_p']=0; + $lap[$kelurahan]['karyawan_jen2_p']=0; + $lap[$kelurahan]['karyawan_jen3_p']=0; + $lap[$kelurahan]['umkm_jen1_kat1']=0; + $lap[$kelurahan]['umkm_jen1_kat2']=0; + $lap[$kelurahan]['umkm_jen1_kat3']=0; + $lap[$kelurahan]['umkm_jen2_kat1']=0; + $lap[$kelurahan]['umkm_jen2_kat2']=0; + $lap[$kelurahan]['umkm_jen2_kat3']=0; + $lap[$kelurahan]['umkm_jen3_kat1']=0; + $lap[$kelurahan]['umkm_jen3_kat2']=0; + $lap[$kelurahan]['umkm_jen3_kat3']=0; + foreach($listlapkel as $lapkel){ + $lap[$kelurahan]['kelurahan']=$lapkel->kelurahan; + $lap[$lapkel->kelurahan]['aset']=$lapkel->aset; + $lap[$lapkel->kelurahan]['omset']=$lap[$lapkel->kelurahan]['omset']+$lapkel->omset; + $lap[$lapkel->kelurahan]['karyawan_jenis1']=$lapkel->karyawan_jenis1; + $lap[$lapkel->kelurahan]['karyawan_jenis2']=$lapkel->karyawan_jenis2; + $lap[$lapkel->kelurahan]['karyawan_jenis3']=$lapkel->karyawan_jenis3; + $lap[$lapkel->kelurahan]['omset_jenis1']=$lap[$lapkel->kelurahan]['omset_jenis1']+$lapkel->omset_jenis1; + $lap[$lapkel->kelurahan]['omset_jenis2']=$lap[$lapkel->kelurahan]['omset_jenis2']+$lapkel->omset_jenis2; + $lap[$lapkel->kelurahan]['omset_jenis3']=$lap[$lapkel->kelurahan]['omset_jenis3']+$lapkel->omset_jenis3; + $lap[$lapkel->kelurahan]['aset_jenis1']=$lapkel->aset_jenis1; + $lap[$lapkel->kelurahan]['aset_jenis2']=$lapkel->aset_jenis2; + $lap[$lapkel->kelurahan]['aset_jenis3']=$lapkel->aset_jenis3; + $lap[$lapkel->kelurahan]['karyawan_jen1_l']=$lapkel->karyawan_jen1_l; + $lap[$lapkel->kelurahan]['karyawan_jen2_l']=$lapkel->karyawan_jen2_l; + $lap[$lapkel->kelurahan]['karyawan_jen3_l']=$lapkel->karyawan_jen3_l; + $lap[$lapkel->kelurahan]['karyawan_jen1_p']=$lapkel->karyawan_jen1_p; + $lap[$lapkel->kelurahan]['karyawan_jen2_p']=$lapkel->karyawan_jen2_p; + $lap[$lapkel->kelurahan]['karyawan_jen3_p']=$lapkel->karyawan_jen3_p; + $lap[$lapkel->kelurahan]['umkm_jen1_kat1']=$lapkel->umkm_jen1_kat1; + $lap[$lapkel->kelurahan]['umkm_jen1_kat2']=$lapkel->umkm_jen1_kat2; + $lap[$lapkel->kelurahan]['umkm_jen1_kat3']=$lapkel->umkm_jen1_kat3; + $lap[$lapkel->kelurahan]['umkm_jen2_kat1']=$lapkel->umkm_jen2_kat1; + $lap[$lapkel->kelurahan]['umkm_jen2_kat2']=$lapkel->umkm_jen2_kat2; + $lap[$lapkel->kelurahan]['umkm_jen2_kat3']=$lapkel->umkm_jen2_kat3; + $lap[$lapkel->kelurahan]['umkm_jen3_kat1']=$lapkel->umkm_jen3_kat1; + $lap[$lapkel->kelurahan]['umkm_jen3_kat2']=$lapkel->umkm_jen3_kat2; + $lap[$lapkel->kelurahan]['umkm_jen3_kat3']=$lapkel->umkm_jen3_kat3; + if($lapkel->bulan==12){ + $lap[$lapkel->kelurahan]['omset'] = $lap[$lapkel->kelurahan]['omset']/12; + $lap[$lapkel->kelurahan]['omset_jenis1'] = $lap[$lapkel->kelurahan]['omset_jenis1']/12; + $lap[$lapkel->kelurahan]['omset_jenis2'] = $lap[$lapkel->kelurahan]['omset_jenis2']/12; + $lap[$lapkel->kelurahan]['omset_jenis3'] = $lap[$lapkel->kelurahan]['omset_jenis3']/12; + $lap[$lapkel->kelurahan]['umkm_jenis1'] = $lap[$lapkel->kelurahan]['umkm_jen1_kat1']+$lap[$lapkel->kelurahan]['umkm_jen1_kat2']+$lap[$lapkel->kelurahan]['umkm_jen1_kat3']; + $lap[$lapkel->kelurahan]['umkm_jenis2'] = $lap[$lapkel->kelurahan]['umkm_jen2_kat1']+$lap[$lapkel->kelurahan]['umkm_jen2_kat2']+$lap[$lapkel->kelurahan]['umkm_jen2_kat3']; + $lap[$lapkel->kelurahan]['umkm_jenis3'] = $lap[$lapkel->kelurahan]['umkm_jen3_kat1']+$lap[$lapkel->kelurahan]['umkm_jen3_kat2']+$lap[$lapkel->kelurahan]['umkm_jen3_kat3']; + } + } + + + $aset=0; + $omset=0; + $karyawan_jenis1=0; + $karyawan_jenis2=0; + $karyawan_jenis3=0; + $omset_jenis1=0; + $omset_jenis2=0; + $omset_jenis3=0; + $aset_jenis1=0; + $aset_jenis2=0; + $aset_jenis3=0; + $karyawan_jen1_l=0; + $karyawan_jen2_l=0; + $karyawan_jen3_l=0; + $karyawan_jen1_p=0; + $karyawan_jen2_p=0; + $karyawan_jen3_p=0; + $umkm_jen1_kat1=0; + $umkm_jen1_kat2=0; + $umkm_jen1_kat3=0; + $umkm_jen2_kat1=0; + $umkm_jen2_kat2=0; + $umkm_jen2_kat3=0; + $umkm_jen3_kat1=0; + $umkm_jen3_kat2=0; + $umkm_jen3_kat3=0; + $umkm_jenis1=0; + $umkm_jenis2=0; + $umkm_jenis3=0; + + foreach($lap as $laporan){ + $aset=$aset+$laporan['aset']; + $omset=$omset+$laporan['omset']; + $karyawan_jenis1=$karyawan_jenis1+$laporan['karyawan_jenis1']; + $karyawan_jenis2=$karyawan_jenis2+$laporan['karyawan_jenis2']; + $karyawan_jenis3=$karyawan_jenis3+$laporan['karyawan_jenis3']; + $omset_jenis1=$omset_jenis1+$laporan['omset_jenis1']; + $omset_jenis2=$omset_jenis2+$laporan['omset_jenis2']; + $omset_jenis3=$omset_jenis3+$laporan['omset_jenis3']; + $aset_jenis1=$aset_jenis1+$laporan['aset_jenis1']; + $aset_jenis2=$aset_jenis2+$laporan['aset_jenis2']; + $aset_jenis3=$aset_jenis3+$laporan['aset_jenis3']; + $karyawan_jen1_l=$karyawan_jen1_l+$laporan['karyawan_jen1_l']; + $karyawan_jen2_l=$karyawan_jen2_l+$laporan['karyawan_jen2_l']; + $karyawan_jen3_l=$karyawan_jen3_l+$laporan['karyawan_jen3_l']; + $karyawan_jen1_p=$karyawan_jen1_p+$laporan['karyawan_jen1_p']; + $karyawan_jen2_p=$karyawan_jen2_p+$laporan['karyawan_jen2_p']; + $karyawan_jen3_p=$karyawan_jen3_p+$laporan['karyawan_jen3_p']; + $umkm_jen1_kat1=$umkm_jen1_kat1+$laporan['umkm_jen1_kat1']; + $umkm_jen1_kat2=$umkm_jen1_kat2+$laporan['umkm_jen1_kat2']; + $umkm_jen1_kat3=$umkm_jen1_kat3+$laporan['umkm_jen1_kat3']; + $umkm_jen2_kat1=$umkm_jen2_kat1+$laporan['umkm_jen2_kat1']; + $umkm_jen2_kat2=$umkm_jen2_kat2+$laporan['umkm_jen2_kat2']; + $umkm_jen2_kat3=$umkm_jen2_kat3+$laporan['umkm_jen2_kat3']; + $umkm_jen3_kat1=$umkm_jen3_kat1+$laporan['umkm_jen3_kat1']; + $umkm_jen3_kat2=$umkm_jen3_kat2+$laporan['umkm_jen3_kat2']; + $umkm_jen3_kat3=$umkm_jen3_kat3+$laporan['umkm_jen3_kat3']; + $umkm_jenis1=$umkm_jenis1+$laporan['umkm_jenis1']; + $umkm_jenis2=$umkm_jenis2+$laporan['umkm_jenis2']; + $umkm_jenis3=$umkm_jenis3+$laporan['umkm_jenis3']; + + $umkm = $umkm_jen1_kat1+$umkm_jen1_kat2+$umkm_jen1_kat3+$umkm_jen2_kat1+$umkm_jen2_kat2+$umkm_jen2_kat3+$umkm_jen3_kat1+$umkm_jen3_kat2+$umkm_jen3_kat3; + $karyawan = $karyawan_jenis1+$karyawan_jenis2+$karyawan_jenis3; + $umkm_kat1 = $umkm_jen1_kat1+$umkm_jen1_kat1+$umkm_jen1_kat1; + $umkm_kat2 = $umkm_jen1_kat2+$umkm_jen1_kat2+$umkm_jen1_kat2; + $umkm_kat3 = $umkm_jen1_kat3+$umkm_jen1_kat3+$umkm_jen1_kat3; + } + + $data['listlaporan']=$lap; + $data['aset']=$aset; + $data['omset']=$omset; + $data['karyawan_jenis1']=$karyawan_jenis1; + $data['karyawan_jenis2']=$karyawan_jenis2; + $data['karyawan_jenis3']=$karyawan_jenis3; + $data['omset_jenis1']=$omset_jenis1; + $data['omset_jenis2']=$omset_jenis2; + $data['omset_jenis3']=$omset_jenis3; + $data['aset_jenis1']=$aset_jenis1; + $data['aset_jenis2']=$aset_jenis2; + $data['aset_jenis3']=$aset_jenis3; + $data['karyawan_jen1_l']=$karyawan_jen1_l; + $data['karyawan_jen2_l']=$karyawan_jen2_l; + $data['karyawan_jen3_l']=$karyawan_jen3_l; + $data['karyawan_jen1_p']=$karyawan_jen1_p; + $data['karyawan_jen2_p']=$karyawan_jen2_p; + $data['karyawan_jen3_p']=$karyawan_jen3_p; + $data['umkm_jen1_kat1']=$umkm_jen1_kat1; + $data['umkm_jen1_kat2']=$umkm_jen1_kat2; + $data['umkm_jen1_kat3']=$umkm_jen1_kat3; + $data['umkm_jen2_kat1']=$umkm_jen2_kat1; + $data['umkm_jen2_kat2']=$umkm_jen2_kat2; + $data['umkm_jen2_kat3']=$umkm_jen2_kat3; + $data['umkm_jen3_kat1']=$umkm_jen3_kat1; + $data['umkm_jen3_kat2']=$umkm_jen3_kat2; + $data['umkm_jen3_kat3']=$umkm_jen3_kat3; + $data['umkm_jenis1']=$umkm_jenis1; + $data['umkm_jenis2']=$umkm_jenis2; + $data['umkm_jenis3']=$umkm_jenis3; + + $data['umkm']= $umkm; + $data['karyawan']= $karyawan; + $data['umkm_kat1']= $umkm_kat1; + $data['umkm_kat2']= $umkm_kat2; + $data['umkm_kat3']= $umkm_kat3; + + + + } else { + $data['msg'] = 'empty'; + } + + + + $data['user_logged'] = $this->session->userdata('user_logged'); + + $kelurahanlist = $this->KelurahanModel->getKelurahan(); + $umkmlist = $this->AbsensiModel->getDesemberAbsensiByYearAndByKelurahan($year,$kelurahan); + //var_dump($umkmlist);die(); + $data['umkmlist'] = $umkmlist; + $data['kelurahan_list']= $kelurahanlist; + $data['kelurahan'] = $kelurahan; + $data['tahun'] = $year; + + $this->load->view('kelurahan',$data); + + } + + +} diff --git a/application/controllers/Produk.php b/application/controllers/Produk.php new file mode 100644 index 0000000..abde4eb --- /dev/null +++ b/application/controllers/Produk.php @@ -0,0 +1,38 @@ +load->model("UserModel"); + $this->load->model("ProdukModel"); + $this->load->model("UmkmModel"); + + } + + public function index() + { + $data['listproduk'] = $this->ProdukModel->getProduk(); + $data['user_logged'] = $this->session->userdata('user_logged'); + $this->load->view('produk',$data); + + } + + public function getdata() + { + + + + $listproduk['data'] = $this->ProdukModel->getProduk(); + $json = json_encode($listproduk); + echo $json; + + + } + + + + +} diff --git a/application/controllers/Tahunan.php b/application/controllers/Tahunan.php new file mode 100644 index 0000000..3aa455a --- /dev/null +++ b/application/controllers/Tahunan.php @@ -0,0 +1,271 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + + } + + public function index() + { + + //cek ada laporan tahunan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + $year = $this->LaporanModel->getLastYearLaporan()->tahun; + $data['tahun'] = $year; + $lap_bulan = $this->LaporanModel->getBulanLaporanByYear($year); + + $omset_jen1=0; + $omset_jen2=0; + $omset_jen3=0; + + + + foreach($lap_bulan as $bulan){ + $umkm_jen1=0; + $umkm_jen2=0; + $umkm_jen3=0; + + $umkm_jen1_ket1=0; + $umkm_jen1_ket2=0; + $umkm_jen1_ket3=0; + $umkm_jen2_ket1=0; + $umkm_jen2_ket2=0; + $umkm_jen2_ket3=0; + $umkm_jen3_ket1=0; + $umkm_jen3_ket2=0; + $umkm_jen3_ket3=0; + + $aset_jen1=0; + $aset_jen2=0; + $aset_jen3=0; + $naker_jen1_l=0; + $naker_jen1_p=0; + $naker_jen2_l=0; + $naker_jen2_p=0; + $naker_jen3_l=0; + $naker_jen3_p=0; + $lap_kelurahan = $this->LaporanModel->getKelurahanByBulanAndYear($bulan->bulan,$year); + + foreach($lap_kelurahan as $kelurahan){ + $laporan = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($bulan->bulan,$year,$kelurahan->kelurahan); + $umkm_jen1= $umkm_jen1+$laporan->umkm_jen1_kat1+$laporan->umkm_jen1_kat2+$laporan->umkm_jen1_kat3; + $umkm_jen2= $umkm_jen2+$laporan->umkm_jen2_kat1+$laporan->umkm_jen2_kat2+$laporan->umkm_jen2_kat3; + $umkm_jen3= $umkm_jen3+$laporan->umkm_jen3_kat1+$laporan->umkm_jen3_kat2+$laporan->umkm_jen3_kat3; + $omset_jen1= $omset_jen1+$laporan->omset_jenis1; + $omset_jen2= $omset_jen2+$laporan->omset_jenis2; + $omset_jen3= $omset_jen3+$laporan->omset_jenis3; + $aset_jen1= $aset_jen1+$laporan->aset_jenis1; + $aset_jen2= $aset_jen2+$laporan->aset_jenis2; + $aset_jen3= $aset_jen3+$laporan->aset_jenis3; + $naker_jen1_l = $naker_jen1_l + $laporan->karyawan_jen1_l; + $naker_jen1_p = $naker_jen1_p + $laporan->karyawan_jen1_p; + $naker_jen2_l = $naker_jen2_l + $laporan->karyawan_jen2_l; + $naker_jen2_p = $naker_jen2_p + $laporan->karyawan_jen2_p; + $naker_jen3_l = $naker_jen3_l + $laporan->karyawan_jen3_l; + $naker_jen3_p = $naker_jen3_p + $laporan->karyawan_jen3_p; + + $umkm_jen1_ket1=$umkm_jen1_ket1+$laporan->umkm_jen1_kat1; + $umkm_jen1_ket2=$umkm_jen1_ket2+$laporan->umkm_jen1_kat2; + $umkm_jen1_ket3=$umkm_jen1_ket3+$laporan->umkm_jen1_kat3; + $umkm_jen2_ket1=$umkm_jen2_ket1+$laporan->umkm_jen2_kat1; + $umkm_jen2_ket2=$umkm_jen2_ket2+$laporan->umkm_jen2_kat2; + $umkm_jen2_ket3=$umkm_jen2_ket3+$laporan->umkm_jen2_kat3; + $umkm_jen3_ket1=$umkm_jen3_ket1+$laporan->umkm_jen3_kat1; + $umkm_jen3_ket2=$umkm_jen3_ket2+$laporan->umkm_jen3_kat2; + $umkm_jen3_ket3=$umkm_jen3_ket3+$laporan->umkm_jen3_kat3; + + } + + + } + + $data['umkm_jen1_ket1']=$umkm_jen1_ket1; + $data['umkm_jen1_ket2']=$umkm_jen1_ket2; + $data['umkm_jen1_ket3']=$umkm_jen1_ket3; + $data['umkm_jen2_ket1']=$umkm_jen2_ket1; + $data['umkm_jen2_ket2']=$umkm_jen2_ket2; + $data['umkm_jen2_ket3']=$umkm_jen2_ket3; + $data['umkm_jen3_ket1']=$umkm_jen3_ket1; + $data['umkm_jen3_ket2']=$umkm_jen3_ket2; + $data['umkm_jen3_ket3']=$umkm_jen3_ket3; + + + $omset_bln_jen1= $omset_jen1/12; + $omset_bln_jen2= $omset_jen2/12; + $omset_bln_jen3= $omset_jen3/12; + + + + $data['umkm_jen1']=$umkm_jen1; + $data['umkm_jen2']=$umkm_jen2; + $data['umkm_jen3']=$umkm_jen3; + + $data['omset_bln_jen1'] = $omset_bln_jen1; + $data['omset_bln_jen2'] = $omset_bln_jen2; + $data['omset_bln_jen3'] = $omset_bln_jen3; + + $data['aset_jen1'] = $aset_jen1; + $data['aset_jen2'] = $aset_jen2; + $data['aset_jen3'] = $aset_jen3; + $data['naker_jen1_l'] = $naker_jen1_l; + $data['naker_jen1_p'] = $naker_jen1_p; + $data['naker_jen2_l'] = $naker_jen2_l; + $data['naker_jen2_p'] = $naker_jen2_p; + $data['naker_jen3_l'] = $naker_jen3_l; + $data['naker_jen3_p'] = $naker_jen3_p; + + //komulatif + $data['omset_1'] = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3; + $data['aset_1'] = $aset_jen1+$aset_jen2+$aset_jen3; + $data['umkm_1'] = $umkm_jen1+$umkm_jen2+$umkm_jen3; + $naker_1 = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l; + $data['naker_1'] = $naker_1+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p; + $data['mikro_1'] = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1; + $data['kecil_1'] = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2; + $data['menengah_1'] = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3; + + + //cek ada laporan tahun sebelumnya atau tidak + $countlaporanbefore = $this->LaporanModel->getLaporanBeforeCount(); + if($countlaporanbefore>0){ + $yearbefore = $this->LaporanModel->getLastYearLaporanBefore()->tahun; + $data['tahun_0'] = $yearbefore; + + $lap_bulan_0 = $this->LaporanModel->getBulanLaporanByYear($yearbefore); + + $omset_jen1_0=0; + $omset_jen2_0=0; + $omset_jen3_0=0; + + + + foreach($lap_bulan_0 as $bulan_0){ + $umkm_jen1_0=0; + $umkm_jen2_0=0; + $umkm_jen3_0=0; + + $umkm_jen1_ket1_0=0; + $umkm_jen1_ket2_0=0; + $umkm_jen1_ket3_0=0; + $umkm_jen2_ket1_0=0; + $umkm_jen2_ket2_0=0; + $umkm_jen2_ket3_0=0; + $umkm_jen3_ket1_0=0; + $umkm_jen3_ket2_0=0; + $umkm_jen3_ket3_0=0; + + $aset_jen1_0=0; + $aset_jen2_0=0; + $aset_jen3_0=0; + $naker_jen1_l_0=0; + $naker_jen1_p_0=0; + $naker_jen2_l_0=0; + $naker_jen2_p_0=0; + $naker_jen3_l_0=0; + $naker_jen3_p_0=0; + $lap_kelurahan_0 = $this->LaporanModel->getKelurahanByBulanAndYear($bulan_0->bulan,$yearbefore); + + foreach($lap_kelurahan_0 as $kelurahan_0){ + $laporan_0 = $this->LaporanModel->getLaporanByBulanByYearByKelurahan($bulan_0->bulan,$yearbefore,$kelurahan_0->kelurahan); + $umkm_jen1_0= $umkm_jen1_0+$laporan_0->umkm_jen1_kat1+$laporan_0->umkm_jen1_kat2+$laporan_0->umkm_jen1_kat3; + $umkm_jen2_0= $umkm_jen2_0+$laporan_0->umkm_jen2_kat1+$laporan_0->umkm_jen2_kat2+$laporan_0->umkm_jen2_kat3; + $umkm_jen3_0= $umkm_jen3_0+$laporan_0->umkm_jen3_kat1+$laporan_0->umkm_jen3_kat2+$laporan_0->umkm_jen3_kat3; + $omset_jen1_0= $omset_jen1_0+$laporan_0->omset_jenis1; + $omset_jen2_0= $omset_jen2_0+$laporan_0->omset_jenis2; + $omset_jen3_0= $omset_jen3_0+$laporan_0->omset_jenis3; + $aset_jen1_0= $aset_jen1_0+$laporan_0->aset_jenis1; + $aset_jen2_0= $aset_jen2_0+$laporan_0->aset_jenis2; + $aset_jen3_0= $aset_jen3_0+$laporan_0->aset_jenis3; + $naker_jen1_l_0 = $naker_jen1_l_0 + $laporan_0->karyawan_jen1_l; + $naker_jen1_p_0 = $naker_jen1_p_0 + $laporan_0->karyawan_jen1_p; + $naker_jen2_l_0 = $naker_jen2_l_0 + $laporan_0->karyawan_jen2_l; + $naker_jen2_p_0 = $naker_jen2_p_0 + $laporan_0->karyawan_jen2_p; + $naker_jen3_l_0 = $naker_jen3_l_0 + $laporan_0->karyawan_jen3_l; + $naker_jen3_p_0 = $naker_jen3_p_0 + $laporan_0->karyawan_jen3_p; + + $umkm_jen1_ket1_0=$umkm_jen1_ket1_0+$laporan_0->umkm_jen1_kat1; + $umkm_jen1_ket2_0=$umkm_jen1_ket2_0+$laporan_0->umkm_jen1_kat2; + $umkm_jen1_ket3_0=$umkm_jen1_ket3_0+$laporan_0->umkm_jen1_kat3; + $umkm_jen2_ket1_0=$umkm_jen2_ket1_0+$laporan_0->umkm_jen2_kat1; + $umkm_jen2_ket2_0=$umkm_jen2_ket2_0+$laporan_0->umkm_jen2_kat2; + $umkm_jen2_ket3_0=$umkm_jen2_ket3_0+$laporan_0->umkm_jen2_kat3; + $umkm_jen3_ket1_0=$umkm_jen3_ket1_0+$laporan_0->umkm_jen3_kat1; + $umkm_jen3_ket2_0=$umkm_jen3_ket2_0+$laporan_0->umkm_jen3_kat2; + $umkm_jen3_ket3_0=$umkm_jen3_ket3_0+$laporan_0->umkm_jen3_kat3; + + } + + + } + + $data['umkm_jen1_ket1_0']=$umkm_jen1_ket1_0; + $data['umkm_jen1_ket2_0']=$umkm_jen1_ket2_0; + $data['umkm_jen1_ket3_0']=$umkm_jen1_ket3_0; + $data['umkm_jen2_ket1_0']=$umkm_jen2_ket1_0; + $data['umkm_jen2_ket2_0']=$umkm_jen2_ket2_0; + $data['umkm_jen2_ket3_0']=$umkm_jen2_ket3_0; + $data['umkm_jen3_ket1_0']=$umkm_jen3_ket1_0; + $data['umkm_jen3_ket2_0']=$umkm_jen3_ket2_0; + $data['umkm_jen3_ket3_0']=$umkm_jen3_ket3_0; + + + $omset_bln_jen1_0= $omset_jen1_0/12; + $omset_bln_jen2_0= $omset_jen2_0/12; + $omset_bln_jen3_0= $omset_jen3_0/12; + + + + $data['umkm_jen1_0']=$umkm_jen1_0; + $data['umkm_jen2_0']=$umkm_jen2_0; + $data['umkm_jen3_0']=$umkm_jen3_0; + + $data['omset_bln_jen1_0'] = $omset_bln_jen1_0; + $data['omset_bln_jen2_0'] = $omset_bln_jen2_0; + $data['omset_bln_jen3_0'] = $omset_bln_jen3_0; + $data['aset_jen1_0'] = $aset_jen1_0; + $data['aset_jen2_0'] = $aset_jen2_0; + $data['aset_jen3_0'] = $aset_jen3_0; + $data['naker_jen1_l_0'] = $naker_jen1_l_0; + $data['naker_jen1_p_0'] = $naker_jen1_p_0; + $data['naker_jen2_l_0'] = $naker_jen2_l_0; + $data['naker_jen2_p_0'] = $naker_jen2_p_0; + $data['naker_jen3_l_0'] = $naker_jen3_l_0; + $data['naker_jen3_p_0'] = $naker_jen3_p_0; + + //komulatif + $data['omset_0'] = $omset_bln_jen1_0+$omset_bln_jen2_0+$omset_bln_jen3_0; + $data['aset_0'] = $aset_jen1_0+$aset_jen2_0+$aset_jen3_0; + $data['umkm_0'] = $umkm_jen1_0+$umkm_jen2_0+$umkm_jen3_0; + $naker_0 = $naker_jen1_l_0+$naker_jen2_l_0+$naker_jen3_l_0; + $data['naker_0'] = $naker_0+$naker_jen1_p_0+$naker_jen2_p_0+$naker_jen3_p_0; + $data['mikro_0'] = $umkm_jen1_ket1_0+$umkm_jen2_ket1_0+$umkm_jen3_ket1_0; + $data['kecil_0'] = $umkm_jen1_ket2_0+$umkm_jen2_ket2_0+$umkm_jen3_ket2_0; + $data['menengah_0'] = $umkm_jen1_ket3_0+$umkm_jen2_ket3_0+$umkm_jen3_ket3_0; + + + + } + + $data['msg'] = 'found'; + } else { + $data['msg'] = 'empty'; + } + + + $this->load->view('laporan',$data); + + } + + +} diff --git a/application/controllers/Umkm.php b/application/controllers/Umkm.php new file mode 100644 index 0000000..8e73274 --- /dev/null +++ b/application/controllers/Umkm.php @@ -0,0 +1,25 @@ +load->model("UserModel"); + $this->load->model("ProdukModel"); + $this->load->model("UmkmModel"); + + } + + public function index() + { + $data['listumkm'] = $this->UmkmModel->getUmkm(); + $data['user_logged'] = $this->session->userdata('user_logged'); + $this->load->view('umkm',$data); + + } + + + +} diff --git a/application/models/ProdukModel.php b/application/models/ProdukModel.php index eda4b80..45906d0 100644 --- a/application/models/ProdukModel.php +++ b/application/models/ProdukModel.php @@ -25,10 +25,19 @@ class ProdukModel extends CI_Model $this->db->where('id_produk', $id_produk); return $produk = $this->db->get($this->_table)->row(); } + + public function getProduk(){ + $this->db->join('tb_umkm','tb_umkm.id_umkm = tb_produk.id_umkm'); + return $produk = $this->db->get($this->_table)->result(); + } + + public function getProdukCount(){ + return $produk = count($this->db->get($this->_table)->result()); + } public function getThree(){ $this->db->order_by('id_produk', 'DESC'); - $this->db->limit('3'); + $this->db->limit('6'); return $produk = $this->db->get($this->_table)->result(); } diff --git a/application/models/UmkmModel.php b/application/models/UmkmModel.php index cc81dd0..ba5345a 100644 --- a/application/models/UmkmModel.php +++ b/application/models/UmkmModel.php @@ -79,7 +79,7 @@ class UmkmModel extends CI_Model public function getThree(){ $this->db->order_by('id_umkm', 'DESC'); - $this->db->limit('3'); + $this->db->limit('4'); return $umkm = $this->db->get($this->_table)->result(); } diff --git a/application/views/bulanan.php b/application/views/bulanan.php new file mode 100644 index 0000000..a27d55f --- /dev/null +++ b/application/views/bulanan.php @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + +
+
+
+
+
Laporan
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
Data UMKM Kota Magelang Bulan
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jumlah UMKMOmset/Bulan
PJIPJI
TotalTotal
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AsetJumlah Naker
PJI
PJILPLPLP
TotalTotal
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Klasifikasi
PJI
MKMNMKMNMKMN
MikroKecilMenengah
+
+
+ + +
+
+ +
+ + +
+ +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/dashboard.php b/application/views/dashboard.php index d5c87df..a5b6937 100644 --- a/application/views/dashboard.php +++ b/application/views/dashboard.php @@ -8,243 +8,151 @@ + + - - - Portal Data UMKM Kota Magelang + Aplikasi UMKM + - -
- - -
+ + + +
+
+
+
+
PORTAL UMKM
+
+ +
+
+
Data Terkini
+
+
+
+
+
+
+

UMKM AKTIF

+
+
+
+
+
+
+
+

TENAGA KERJA

+
+
+
+
+
+
+
+

PRODUK

+
+
+
+
+
+ +
+ +
+
+

UMKM

+
+
+
+ +
+
+ Card image cap +
+
nama ?>
+

deskripsi ?>

+
+
+
+ + +
+ +
+ +
+
+

PRODUK

+
+
+
+ +
+
+ Card image cap +
+
produk ?>
+

deskripsi ?>

+
+
+
+ + +
+ -
- +
- -
-
-

PRODUK UMKM

-
- -
- Generic placeholder image -

produk ?>

-

View details »

-
- - - - -
- -
- - - - - -
- -
-
-

nama ?>

-

deskripsi ?>

-
-
- Generic placeholder image -
-
- - - -
- -
-
-

nama ?>

-

deskripsi ?>

-
-
- Generic placeholder image -
-
- - - - - -
- -
-
- -
+
@@ -254,8 +162,10 @@ + + - + diff --git a/application/views/kecamatan.php b/application/views/kecamatan.php new file mode 100644 index 0000000..a229ef2 --- /dev/null +++ b/application/views/kecamatan.php @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + +
+
+
+
+
Laporan
+
+
+ +
+
+
+
+ + +
+
+
+ + + +
+
+
+
+
Data UMKM Kota Magelang Kecamatan
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NokelurahanJml UmkmOmset/BulanAsetJml NakerKlasifikasi
PJIPJI
PJIPJIPJILPLPLPMKMNMKMNMKMN
Total
 
TotalJml UmkmOmset/BlnAsetNakerMikroKecilMenengah
+
+ +
+ +
+ + + +
+
+ +
+ + +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/kelurahan.php b/application/views/kelurahan.php new file mode 100644 index 0000000..5ec67ba --- /dev/null +++ b/application/views/kelurahan.php @@ -0,0 +1,498 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + +
+
+
+
+
Laporan
+
+
+ +
+
+
+
+ + +
+
+
+ + + +
+
+
+
+
Data UMKM Kota Magelang Kelurahan
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NokelurahanJml UmkmOmset/BulanAsetJml NakerKlasifikasi
PJIPJI
PJIPJIPJILPLPLPMKMNMKMNMKMN
Total
 
TotalJml UmkmOmset/BlnAsetNakerMikroKecilMenengah
+
+ + +
+ +
+ +
+
+
+
+
Daftar UMKM Tahun
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + UmkmModel->getUmkmsById($umkm->id_umkm); + $jenis = $this->JenisModel->getJenisById($umkm->id_jenis); + $kategori = $this->KategoriModel->getKategoriById($umkm->id_kategori); + $listomset = $this->AbsensiModel->getAbsensiByTahunAndUmkmId($umkm->tahun,$umkm->id_umkm); + $ttl_omset=0; + foreach($listomset as $oms){ + $ttl_omset = $ttl_omset+$oms->omset; + } + $r_omset = $ttl_omset/12; + ?> + + + + + + + + + + + + + + + + + +
NoNama UMKMPemilikKelurahanAlamatTelpDeskripsiJenisOmset/BulanAsetNakerSkala Usaha
LP
nama?>nama?>kelurahan ?>alamat ?>telp ?>deskripsi ?>jenis ?>aset) ?>karyawan_l ?>karyawan_p ?>kategori ?>
+
+ + +
+ +
+ + + +
+
+ +
+ + +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/laporan.php b/application/views/laporan.php new file mode 100644 index 0000000..c0ae5c6 --- /dev/null +++ b/application/views/laporan.php @@ -0,0 +1,514 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + +
+
+
+
+
Laporan
+
+
+
+ + +
+
+
Monografi Kota Magelang Tahun
+
+ +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
AsetOmset
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jml UMKMTenaga KerjaMikroKecilMenengah
+
+
+ +
+ +
+
+ + + + +
+
+
+
+
Data UMKM Kota Magelang Tahun
+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jumlah UMKMOmset/Bulan
PJIPJI
TotalTotal
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AsetJumlah Naker
PJI
PJILPLPLP
TotalTotal
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Klasifikasi
PJI
MKMNMKMNMKMN
MikroKecilMenengah
+
+
+ + +
+
+ +
+ + +
+ +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/produk.php b/application/views/produk.php new file mode 100644 index 0000000..865b7a4 --- /dev/null +++ b/application/views/produk.php @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + +
+
+
+
+
PORTAL UMKM
+
+
+
+

PRODUK

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
FotoProdukDeskripsiUMKMKontak
produk ?>deskripsi ?>nama ?>telp ?>
+
+ + +
+ + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/umkm.php b/application/views/umkm.php new file mode 100644 index 0000000..90e3b7a --- /dev/null +++ b/application/views/umkm.php @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + +
+
+
+
+
PORTAL UMKM
+
+
+
+

UMKM

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
FotoNamaDeskripsiKontak
nama ?>deskripsi ?>telp ?>
+
+ + +
+ + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/db_umkm2_test.sql b/db_umkm2_test.sql index dc785b2..0e9fb98 100644 --- a/db_umkm2_test.sql +++ b/db_umkm2_test.sql @@ -1,11 +1,11 @@ -- phpMyAdmin SQL Dump --- version 5.1.1 +-- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Sep 19, 2021 at 02:23 PM --- Server version: 10.4.21-MariaDB --- PHP Version: 7.4.23 +-- Generation Time: Sep 21, 2021 at 10:17 AM +-- Server version: 10.4.16-MariaDB +-- PHP Version: 7.4.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; @@ -444,7 +444,10 @@ CREATE TABLE `tb_produk` ( -- INSERT INTO `tb_produk` (`id_produk`, `foto_produk`, `id_umkm`, `produk`, `deskripsi`) VALUES -(11, '11.png', 14, 'Aplikasi Dashboard UMKM', 'Aplikasi untuk pendataan UMKM'); +(11, '11.png', 14, 'Aplikasi Dashboard UMKM', 'Aplikasi untuk pendataan UMKM'), +(12, '12.jpg', 1, 'Kursi Rotan', 'Kursi Rotan Kuat dan Indah'), +(13, '13.jpg', 1, 'Meja Rotan', 'Meja Minimalis'), +(15, '15.jpg', 1, 'Hiasan Rotan', 'Ornamen Interior Rotan'); -- -------------------------------------------------------- @@ -476,10 +479,10 @@ CREATE TABLE `tb_umkm` ( INSERT INTO `tb_umkm` (`id_umkm`, `id_pemilik`, `nama`, `id_kategori`, `kecamatan`, `kelurahan`, `alamat`, `telp`, `id_jenis`, `omset_awal`, `aset_awal`, `karyawan_l`, `karyawan_p`, `deskripsi`, `foto_umkm`) VALUES (1, '2', 'Meubel Rotan', 1, 'Magelang Utara', 'Kramat Utara', 'Jl. Jeruk Purut, Kupatan, Kramat Utara, Magelang', '08121212121', 1, 0, 100000000, 20, 8, 'Sedia berbagai furnitur dan Meubel', '1.jpg'), -(2, '2', 'Percetakan Jaya Muya', 1, 'Magelang Selatan', 'Tidar Selatan', 'Kiringan III, Tidar Selatan, Kota Magelang', '0811111111', 2, 0, 30000000, 30, 12, 'Jasa Reklame, Baliho, Banner dan Printing Sepanduk', 'umkm.png'), -(3, '2', 'Frozen Food Magelang', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Tanon, Jl. Singosari, Rejowinangun Selatan, Magelang', '08121212121', 2, 0, 5000000, 5, 8, 'Reseller Produk makanan beku : Sosis, Daging, Tempura, Nuget, dll', 'umkm.png'), -(4, '6', 'Putih Abu Workshop', 1, 'Magelang Tengah', 'Cacaban', 'Cacaban Tengah', '+6233333923', 3, 0, 10000000, 3, 6, 'Souvenir Nikah Karakter', 'umkm.png'), -(14, '16', 'Mage Soft', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Rejowinangun Selatan, Magelang Selatan', '081228868280', 3, 156000000, 10000000, 1, 0, 'Software Developer', 'umkm.png'); +(2, '2', 'Percetakan Jaya Muya', 1, 'Magelang Selatan', 'Tidar Selatan', 'Kiringan III, Tidar Selatan, Kota Magelang', '0811111111', 2, 0, 30000000, 30, 12, 'Jasa Reklame, Baliho, Banner dan Printing Sepanduk', '2.jpg'), +(3, '2', 'Frozen Food Magelang', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Tanon, Jl. Singosari, Rejowinangun Selatan, Magelang', '08121212121', 2, 0, 5000000, 5, 8, 'Reseller Produk makanan beku : Sosis, Daging, Tempura, Nuget, dll', '3.jpg'), +(4, '6', 'Putih Abu Workshop', 1, 'Magelang Tengah', 'Cacaban', 'Cacaban Tengah', '+6233333923', 3, 0, 10000000, 3, 6, 'Souvenir Nikah Karakter', '4.jpg'), +(14, '16', 'Mage Soft', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Rejowinangun Selatan, Magelang Selatan', '081228868280', 3, 156000000, 10000000, 1, 0, 'Software Developer', '14.jpg'); -- -------------------------------------------------------- @@ -630,7 +633,7 @@ ALTER TABLE `tb_laporan` -- AUTO_INCREMENT for table `tb_produk` -- ALTER TABLE `tb_produk` - MODIFY `id_produk` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; + MODIFY `id_produk` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `tb_umkm`