diff --git a/application/config/routes.php b/application/config/routes.php index aaea762..cdf45f7 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -49,6 +49,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | Examples: my-controller/index -> my_controller/index | my-controller/my-method -> my_controller/my_method */ + $route['default_controller'] = 'Login'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; +$route['admin'] = 'admin/Dashboard'; +$route['user'] = 'user/Dashboard'; diff --git a/application/controllers/admin/LapbulPdf.php b/application/controllers/admin/LapbulPdf.php new file mode 100644 index 0000000..8be5253 --- /dev/null +++ b/application/controllers/admin/LapbulPdf.php @@ -0,0 +1,169 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + if($this->input->get()){ + $get = $this->input->get(); + $month = $get['bulan']; + $year = $get['tahun']; + } else { + redirect(site_url('admin/laporanbulanan')); + die(); + } + //cek ada laporan tahunan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + + //cek ada laporan bulanan atau tidak + $countlaporanbulan = $this->LaporanModel->getLaporanCountByYear($year); + if($countlaporanbulan>0){ + + $data['tahun'] = $year; + $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'); + + $this->load->view('admin/lapbulpdf',$data); + + } + + +} diff --git a/application/controllers/admin/LapbulXls.php b/application/controllers/admin/LapbulXls.php new file mode 100644 index 0000000..3f89b94 --- /dev/null +++ b/application/controllers/admin/LapbulXls.php @@ -0,0 +1,169 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + if($this->input->get()){ + $get = $this->input->get(); + $month = $get['bulan']; + $year = $get['tahun']; + } else { + redirect(site_url('admin/laporanbulanan')); + die(); + } + //cek ada laporan tahunan atau tidak + $countlaporan = $this->LaporanModel->getLaporanCount(); + if($countlaporan>0){ + + //cek ada laporan bulanan atau tidak + $countlaporanbulan = $this->LaporanModel->getLaporanCountByYear($year); + if($countlaporanbulan>0){ + + $data['tahun'] = $year; + $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'); + + $this->load->view('admin/lapbulxls',$data); + + } + + +} diff --git a/application/controllers/admin/LapkecPdf.php b/application/controllers/admin/LapkecPdf.php new file mode 100644 index 0000000..2018e78 --- /dev/null +++ b/application/controllers/admin/LapkecPdf.php @@ -0,0 +1,239 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + + if($this->input->get()){ + $get = $this->input->get(); + $kecamatan = $get['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'); + + $data['kecamatan'] = $kecamatan; + $data['tahun'] = $year; + + $this->load->view('admin/lapkecpdf',$data); + + } + + +} diff --git a/application/controllers/admin/LapkecXls.php b/application/controllers/admin/LapkecXls.php new file mode 100644 index 0000000..ac8de82 --- /dev/null +++ b/application/controllers/admin/LapkecXls.php @@ -0,0 +1,239 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + + if($this->input->get()){ + $get = $this->input->get(); + $kecamatan = $get['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'); + + $data['kecamatan'] = $kecamatan; + $data['tahun'] = $year; + + $this->load->view('admin/lapkecxls',$data); + + } + + +} diff --git a/application/controllers/admin/LapkelPdf.php b/application/controllers/admin/LapkelPdf.php new file mode 100644 index 0000000..a3afe89 --- /dev/null +++ b/application/controllers/admin/LapkelPdf.php @@ -0,0 +1,245 @@ +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"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + + if($this->input->get()){ + $get = $this->input->get(); + $kelurahan = $get['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'); + + + $umkmlist = $this->AbsensiModel->getDesemberAbsensiByYearAndByKelurahan($year,$kelurahan); + //var_dump($umkmlist);die(); + $data['umkmlist'] = $umkmlist; + + $data['kelurahan'] = $kelurahan; + $data['tahun'] = $year; + + $this->load->view('admin/lapkelpdf',$data); + + } + + +} diff --git a/application/controllers/admin/LapkelXls.php b/application/controllers/admin/LapkelXls.php new file mode 100644 index 0000000..b820052 --- /dev/null +++ b/application/controllers/admin/LapkelXls.php @@ -0,0 +1,245 @@ +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"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + public function index() + { + + if($this->input->get()){ + $get = $this->input->get(); + $kelurahan = $get['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'); + + + $umkmlist = $this->AbsensiModel->getDesemberAbsensiByYearAndByKelurahan($year,$kelurahan); + //var_dump($umkmlist);die(); + $data['umkmlist'] = $umkmlist; + + $data['kelurahan'] = $kelurahan; + $data['tahun'] = $year; + + $this->load->view('admin/lapkelxls',$data); + + } + + +} diff --git a/application/controllers/admin/LaporanBulanan.php b/application/controllers/admin/LaporanBulanan.php new file mode 100644 index 0000000..95157d1 --- /dev/null +++ b/application/controllers/admin/LaporanBulanan.php @@ -0,0 +1,225 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + 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('admin/laporanbulanan',$data); + + } + + +} diff --git a/application/controllers/admin/LaporanKecamatan.php b/application/controllers/admin/LaporanKecamatan.php new file mode 100644 index 0000000..b78ce17 --- /dev/null +++ b/application/controllers/admin/LaporanKecamatan.php @@ -0,0 +1,255 @@ +load->model("UserModel"); + $this->load->model("LaporanModel"); + $this->load->model("KategoriModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + 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('admin/laporankecamatan',$data); + + } + + +} diff --git a/application/controllers/admin/LaporanKelurahan.php b/application/controllers/admin/LaporanKelurahan.php new file mode 100644 index 0000000..7eec4ba --- /dev/null +++ b/application/controllers/admin/LaporanKelurahan.php @@ -0,0 +1,245 @@ +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"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + + } + + 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('admin/laporankelurahan',$data); + + } + + +} diff --git a/application/models/AbsensiModel.php b/application/models/AbsensiModel.php index 084b0b6..66eb1aa 100644 --- a/application/models/AbsensiModel.php +++ b/application/models/AbsensiModel.php @@ -75,6 +75,15 @@ class AbsensiModel extends CI_Model return $this->db->update($this->_table, $this, array('id_absensi' => $id_absensi)); } + public function getDesemberAbsensiByYearAndByKelurahan($tahun,$kelurahan){ + $this->db->join('tb_user','tb_user.id_user = tb_absensi.id_pemilik'); + $this->db->where('bulan', 12); + $this->db->where('tahun', $tahun); + $this->db->where('tb_absensi.kelurahan', $kelurahan); + //$this->db->limit(1); + return $absensi = $this->db->get($this->_table)->result(); + } + public function getLastMonthAbsensi($bulan,$tahun){ $bulan = $bulan-1; $this->db->where('bulan', $bulan); diff --git a/application/models/LaporanModel.php b/application/models/LaporanModel.php index 8730529..9f6e25f 100644 --- a/application/models/LaporanModel.php +++ b/application/models/LaporanModel.php @@ -18,6 +18,18 @@ class LaporanModel extends CI_Model return $laporan = count($this->db->get($this->_table)->result()); } + public function getCountByTahunByKelurahan($tahun,$kelurahan){ + $this->db->where('tahun',$tahun); + $this->db->where('kelurahan',$kelurahan); + return $laporan = count($this->db->get($this->_table)->result()); + } + + public function getCountByTahunByKecamatan($tahun,$kecamatan){ + $this->db->where('tahun',$tahun); + $this->db->where('kecamatan',$kecamatan); + return $laporan = count($this->db->get($this->_table)->result()); + } + public function getLaporanByBulanByYearByKelurahan($bulan,$year,$kelurahan){ $this->db->where('tahun',$year); $this->db->where('bulan',$bulan); @@ -48,6 +60,31 @@ class LaporanModel extends CI_Model return $laporan =$this->db->get($this->_table)->row(); } + public function getLaporanByTahunAndKelurahan($tahun,$kelurahan){ + $this->db->where('tahun',$tahun); + $this->db->where('kelurahan',$kelurahan); + $this->db->order_by('bulan','ASC'); + return $laporan =$this->db->get($this->_table)->result(); + } + + public function getKelurahanByTahunAndKecamatan($tahun,$kecamatan){ + $this->db->select('kelurahan'); + $this->db->distinct('kelurahan'); + $this->db->where('tahun',$tahun); + $this->db->where('kecamatan',$kecamatan); + $this->db->order_by('kelurahan','ASC'); + return $laporan =$this->db->get($this->_table)->result(); + } + + public function getLastMonthLaporan($tahun){ + $this->db->select('bulan'); + $this->db->where('tahun',$tahun); + $this->db->distinct('bulan'); + $this->db->order_by('bulan','DESC'); + $this->db->limit(1); + return $laporan =$this->db->get($this->_table)->row(); + } + public function getBulanLaporanByYear($tahun){ $this->db->select('bulan'); $this->db->where('tahun',$tahun); diff --git a/application/views/admin/lapbulpdf.php b/application/views/admin/lapbulpdf.php new file mode 100644 index 0000000..4954908 --- /dev/null +++ b/application/views/admin/lapbulpdf.php @@ -0,0 +1,251 @@ + + + + + + + + + + +Aplikasi UMKM + + + + +
 
+
+ REKAP DATA UMKM BULAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jumlah UMKMOmset/BulanAsetJumlah NakerKlasifikasi
PJIPJIPJIPJIPJI
LPLPLPMKKMNMKKMNMKKMN
TotalTotalTotalTotalMikroKecilMenengah
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + + + \ No newline at end of file diff --git a/application/views/admin/lapbulxls.php b/application/views/admin/lapbulxls.php new file mode 100644 index 0000000..9b4308e --- /dev/null +++ b/application/views/admin/lapbulxls.php @@ -0,0 +1,237 @@ + + + + + + + + + + + +Aplikasi UMKM + + + + + +
 
+
+ REKAP DATA UMKM BULAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Jumlah UMKMOmset/BulanAsetJumlah NakerKlasifikasi
PJIPJIPJIPJIPJI
LPLPLPMKKMNMKKMNMKKMN
TotalTotalTotalTotalMikroKecilMenengah
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + diff --git a/application/views/admin/lapkecpdf.php b/application/views/admin/lapkecpdf.php new file mode 100644 index 0000000..1a8da4f --- /dev/null +++ b/application/views/admin/lapkecpdf.php @@ -0,0 +1,237 @@ + + + + + + + + + + +Aplikasi UMKM + + + +
 
+
+ REKAP DATA UMKM KECAMATAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NokelurahanJml UmkmOmset/BulanAsetJml NakerKlasifikasi
PJIPJI
PJIPJIPJILPLPLPMKMNMKMNMKMN
Total
 
TotalJml UmkmOmset/BlnAsetNakerMikroKecilMenengah
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + + diff --git a/application/views/admin/lapkecxls.php b/application/views/admin/lapkecxls.php new file mode 100644 index 0000000..7495702 --- /dev/null +++ b/application/views/admin/lapkecxls.php @@ -0,0 +1,224 @@ + + + + + + + + + + +Aplikasi UMKM + + + + + +
 
+
+ REKAP DATA UMKM KECAMATAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NokelurahanJml UmkmOmset/BulanAsetJml NakerKlasifikasi
PJIPJI
PJIPJIPJILPLPLPMKMNMKMNMKMN
Total
 
TotalJml UmkmOmset/BlnAsetNakerMikroKecilMenengah
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + diff --git a/application/views/admin/lapkelpdf.php b/application/views/admin/lapkelpdf.php new file mode 100644 index 0000000..d1335ef --- /dev/null +++ b/application/views/admin/lapkelpdf.php @@ -0,0 +1,299 @@ + + + + + + + + + + +Aplikasi UMKM + + + + +
 
+
+ REKAP DATA UMKM KELURAHAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 ?>
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + + diff --git a/application/views/admin/lapkelxls.php b/application/views/admin/lapkelxls.php new file mode 100644 index 0000000..7c3e726 --- /dev/null +++ b/application/views/admin/lapkelxls.php @@ -0,0 +1,285 @@ + + + + + + + + + + +Aplikasi UMKM + + + + + +
 
+
+ REKAP DATA UMKM KELURAHAN
+ KOTA MAGELANG +
+
 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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 ?>
+
+ + +
Tidak ada laporan yang sudah dibuat saat ini.
+ + + + + diff --git a/application/views/admin/laporan.php b/application/views/admin/laporan.php index 25b4a78..bc35e72 100644 --- a/application/views/admin/laporan.php +++ b/application/views/admin/laporan.php @@ -84,6 +84,9 @@ + diff --git a/application/views/admin/laporanbulanan.php b/application/views/admin/laporanbulanan.php new file mode 100644 index 0000000..d65dc4e --- /dev/null +++ b/application/views/admin/laporanbulanan.php @@ -0,0 +1,495 @@ + + + + + + + + + + + + + + + + + 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/admin/laporanexcel.php b/application/views/admin/laporanexcel.php index 38b9d8e..d2efc91 100644 --- a/application/views/admin/laporanexcel.php +++ b/application/views/admin/laporanexcel.php @@ -198,39 +198,17 @@
 
-
+
PERBANDINGAN DENGAN TAHUN
 
- +
- + - - - - - - - - - - - - - - -
Tahun Aset Omset
-
-
 
-
- - - - @@ -241,6 +219,8 @@ + + @@ -248,7 +228,9 @@ - + + + @@ -258,6 +240,7 @@
Jml UMKM Tenaga Kerja Mikro
+ diff --git a/application/views/admin/laporankecamatan.php b/application/views/admin/laporankecamatan.php new file mode 100644 index 0000000..3b86b47 --- /dev/null +++ b/application/views/admin/laporankecamatan.php @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + 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/admin/laporankelurahan.php b/application/views/admin/laporankelurahan.php new file mode 100644 index 0000000..6c1b7c3 --- /dev/null +++ b/application/views/admin/laporankelurahan.php @@ -0,0 +1,522 @@ + + + + + + + + + + + + + + + + + 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/admin/laporanpdf.php b/application/views/admin/laporanpdf.php index 30c098b..6b4a14c 100644 --- a/application/views/admin/laporanpdf.php +++ b/application/views/admin/laporanpdf.php @@ -204,31 +204,9 @@ - + - - - - - - - - - - - - - - -
Tahun Aset Omset
-
-
 
-
- - - - @@ -239,6 +217,8 @@ + + @@ -246,7 +226,9 @@ - + + + diff --git a/db_umkm2_test.sql b/db_umkm2_test.sql index 4ae1a26..dc785b2 100644 --- a/db_umkm2_test.sql +++ b/db_umkm2_test.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Sep 18, 2021 at 04:05 PM +-- Generation Time: Sep 19, 2021 at 02:23 PM -- Server version: 10.4.21-MariaDB -- PHP Version: 7.4.23
Jml UMKM Tenaga Kerja Mikro