diff --git a/application/controllers/admin/Produk.php b/application/controllers/admin/Produk.php new file mode 100644 index 0000000..8e64a3d --- /dev/null +++ b/application/controllers/admin/Produk.php @@ -0,0 +1,67 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("AbsensiModel"); + $this->load->model("ProdukModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('dashboard')); + } + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('admin/umkm')); + } + } + + public function index() + { + + $get = $this->input->get(); + $umkm = $this->UmkmModel->getUmkmsById($get['id_umkm']); + $pemilik = $this->UserModel->getUsersById($umkm->id_pemilik); + $daftarkategori = $this->KategoriModel->getKategori(); + $daftarproduk = $this->ProdukModel->getProdukByUmkmId($umkm->id_umkm); + + $cekabsensiakhir = $this->AbsensiModel->getLatestSignedAbsensiCountByUmkmId($umkm->id_umkm); + + if($cekabsensiakhir > 0 ){ + $absensiakhir = $this->AbsensiModel->getLatestSignedAbsensiByUmkmId($umkm->id_umkm); + $aset = $absensiakhir->aset; + $karyawan_l = $absensiakhir->karyawan_l; + $karyawan_p = $absensiakhir->karyawan_p; + } else { + $aset = $umkm->aset_awal; + $karyawan_l = $umkm->karyawan_l; + $karyawan_p = $umkm->karyawan_p; + } + + + $data['omset'] = $umkm->omset_awal; + $data['karyawan_l'] = $karyawan_l; + $data['karyawan_p'] = $karyawan_p; + $data['aset'] = $aset; + $data['daftarkategori'] = $daftarkategori; + $data['daftarproduk'] = $daftarproduk; + $data['umkm'] = $umkm; + $data['pemilik'] = $pemilik; + $data['user_logged'] = $this->session->userdata('user_logged'); + + + $this->load->view('admin/produk',$data); + + } + + +} diff --git a/application/controllers/admin/ProgresAbsen.php b/application/controllers/admin/ProgresAbsen.php index 176d16b..203dd33 100644 --- a/application/controllers/admin/ProgresAbsen.php +++ b/application/controllers/admin/ProgresAbsen.php @@ -23,7 +23,11 @@ class ProgresAbsen extends CI_Controller { public function index() { - + if($this->input->get()){ + $get = $this->input->get(); + $data['tahun_laporan'] = $get['tahun']; + $data['msg'] = $get['msg']; + } $data['tahun_list']= $this->AbsenModel->getAbsenTahun(); $data['user_logged'] = $this->session->userdata('user_logged'); diff --git a/application/controllers/admin/TambahAbsen.php b/application/controllers/admin/TambahAbsen.php index 4bafd05..4e3ed76 100644 --- a/application/controllers/admin/TambahAbsen.php +++ b/application/controllers/admin/TambahAbsen.php @@ -115,7 +115,7 @@ class TambahAbsen extends CI_Controller { $karyawan_absensi_p= $umkm->karyawan_p; } $omset_absensi= 0; - $this->AbsensiModel->save($id_absen,$umkm->id_umkm,$umkm->id_pemilik,$umkm->kecamatan,$umkm->kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p); + $this->AbsensiModel->save($id_absen,$umkm->id_umkm,$umkm->id_pemilik,$umkm->id_jenis,$umkm->id_kategori,$umkm->kecamatan,$umkm->kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p); } @@ -162,7 +162,7 @@ class TambahAbsen extends CI_Controller { $karyawan_absensi_p= $umkm->karyawan_p; } $omset_absensi= 0; - $this->AbsensiModel->save($id_absen,$umkm->id_umkm,$umkm->id_pemilik,$umkm->kecamatan,$umkm->kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p); + $this->AbsensiModel->save($id_absen,$umkm->id_umkm,$umkm->id_pemilik,$umkm->id_jenis,$umkm->id_kategori,$umkm->kecamatan,$umkm->kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p); } diff --git a/application/controllers/admin/TutupTahun.php b/application/controllers/admin/TutupTahun.php new file mode 100644 index 0000000..6a6985b --- /dev/null +++ b/application/controllers/admin/TutupTahun.php @@ -0,0 +1,168 @@ +load->model("AbsenModel"); + $this->load->model("AbsensiModel"); + $this->load->model("UserModel"); + $this->load->model("KelurahanModel"); + $this->load->model("LaporanModel"); + $this->load->model("UmkmModel"); + + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isAdmin())) { + redirect(site_url('user/sdashboard')); + } + + $get = $this->input->get(); + if($get['tahun']==NULL){ + redirect(site_url('admin/progresabsen')); + } else { + $this->tahun = $get['tahun']; + } + } + + public function index() + { + $tahun = $this->tahun; + $coutAbsen = $this->AbsenModel->getAbsenCountByYear($tahun); + + //cek absen lengkap 12 bulan atau tidak + if($coutAbsen<12){ + redirect(site_url('admin/progresabsen?tahun='.$tahun.'&msg=error!')); + die(); + } else { + $listabsen = $this->AbsenModel->getAbsensByTahun($tahun); + foreach($listabsen as $absen){ + $this->AbsenModel->setCloseAbsen($absen->id_absen); + $omset = 0; + $aset = 0; + $karyawan_l = 0; + $karyawan_p = 0; + + $listabsensi = $this->AbsensiModel->getAbsensiByBulanAndThn($absen->bulan,$tahun); + + foreach($listabsensi as $absensi){ + $this->AbsensiModel->absenBySystem($absensi->id_absensi); + $omset = $omset + $absensi->omset; + $aset = $aset + $absensi->aset; + $karyawan_l = $karyawan_l + $absensi->karyawan_l; + $karyawan_p = $karyawan_p + $absensi->karyawan_p; + + $omset_tahunan_umkm=0; + + $listabsensiumkm = $this->AbsensiModel->getAbsensiByTahunAndUmkmId($tahun,$absensi->id_umkm); + + foreach($listabsensiumkm as $absensiumkm){ + $omset_tahunan_umkm = $omset_tahunan_umkm + $absensiumkm->omset; + } + + $this->UmkmModel->updateOmset($absensi->id_umkm,$omset_tahunan_umkm); + + + } + + $this->AbsenModel->update($absen->id_absen,$omset,$aset,$karyawan_l,$karyawan_p); + } + + + + $listkelurahan = $this->KelurahanModel->getKelurahan(); + foreach($listkelurahan as $kelurahan){ + $kecamatan = $kelurahan->kecamatan; + $aset=0; + $omset=0; + $jumlah_umkm = 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_jen1_p = 0; + $karyawan_jen2_l = 0; + $karyawan_jen2_p = 0; + $karyawan_jen3_l = 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; + $listabsensiupdated = $this->AbsensiModel->getAbsensByTahunAndKelurahan($tahun,$kelurahan->kelurahan); + foreach($listabsensiupdated as $updatedabsensi){ + $aset = $aset+$updatedabsensi->aset; + $omset = $omset+$updatedabsensi->omset; + $jumlah_umkm++; + + $karyawan = $updatedabsensi->karyawan_l + $updatedabsensi->karyawan_p; + + if($updatedabsensi->id_jenis=='1'){ + $karyawan_jenis1 = $karyawan_jenis1 + $karyawan; + $omset_jenis1 = $omset_jenis1 + $updatedabsensi->omset; + $aset_jenis1 = $aset_jenis1 + $updatedabsensi->aset; + $karyawan_jen1_l = $karyawan_jen1_l +$updatedabsensi->karyawan_l; + $karyawan_jen1_p = $karyawan_jen1_p +$updatedabsensi->karyawan_p; + }elseif($updatedabsensi->id_jenis=='2'){ + $karyawan_jenis2 = $karyawan_jenis2 + $karyawan; + $omset_jenis2 = $omset_jenis2 + $updatedabsensi->omset; + $aset_jenis2 = $aset_jenis2 + $updatedabsensi->aset; + $karyawan_jen2_l = $karyawan_jen2_l +$updatedabsensi->karyawan_l; + $karyawan_jen2_p = $karyawan_jen2_p +$updatedabsensi->karyawan_p; + }elseif($updatedabsensi->id_jenis=='3'){ + $karyawan_jenis3 = $karyawan_jenis3 + $karyawan; + $omset_jenis3 = $omset_jenis3 + $updatedabsensi->omset; + $aset_jenis3 = $aset_jenis3 + $updatedabsensi->aset; + $karyawan_jen3_l = $karyawan_jen3_l +$updatedabsensi->karyawan_l; + $karyawan_jen3_p = $karyawan_jen3_p +$updatedabsensi->karyawan_p; + } + + if(($updatedabsensi->id_jenis=='1')AND($updatedabsensi->id_kategori=='1')){ + $umkm_jen1_kat1++; + }elseif(($updatedabsensi->id_jenis=='1')AND($updatedabsensi->id_kategori=='2')){ + $umkm_jen1_kat2++; + }elseif(($updatedabsensi->id_jenis=='1')AND($updatedabsensi->id_kategori=='3')){ + $umkm_jen1_kat3++; + }elseif(($updatedabsensi->id_jenis=='2')AND($updatedabsensi->id_kategori=='1')){ + $umkm_jen2_kat1++; + }elseif(($updatedabsensi->id_jenis=='2')AND($updatedabsensi->id_kategori=='2')){ + $umkm_jen2_kat2++; + }elseif(($updatedabsensi->id_jenis=='2')AND($updatedabsensi->id_kategori=='3')){ + $umkm_jen2_kat3++; + }elseif(($updatedabsensi->id_jenis=='3')AND($updatedabsensi->id_kategori=='1')){ + $umkm_jen3_kat1++; + }elseif(($updatedabsensi->id_jenis=='3')AND($updatedabsensi->id_kategori=='2')){ + $umkm_jen3_kat2++; + }elseif(($updatedabsensi->id_jenis=='3')AND($updatedabsensi->id_kategori=='3')){ + $umkm_jen3_kat3++; + } + + $this->LaporanModel->save($tahun,$updatedabsensi->bulan,$kelurahan->kelurahan,$kecamatan,$aset,$omset,$jumlah_umkm,$karyawan_jenis1,$karyawan_jenis2,$karyawan_jenis3,$omset_jenis1,$omset_jenis2,$omset_jenis3,$aset_jenis1,$aset_jenis2,$aset_jenis3,$karyawan_jen1_l,$karyawan_jen1_p,$karyawan_jen2_l,$karyawan_jen2_p,$karyawan_jen3_l,$karyawan_jen3_p,$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); + + } + } + + } + + redirect(site_url('admin/progresabsen?tahun='.$tahun.'&msg=success')); + die(); + + + } + + +} diff --git a/application/controllers/admin/setting.php b/application/controllers/admin/setting.php index 912112f..6fd949a 100644 --- a/application/controllers/admin/setting.php +++ b/application/controllers/admin/setting.php @@ -11,7 +11,7 @@ class Setting extends CI_Controller { if($this->UserModel->isNotLogin()) { redirect(site_url('login')); } elseif(!($this->UserModel->isAdmin())) { - redirect(site_url('dashboard')); + redirect(site_url('user/dashboard')); } } diff --git a/application/controllers/user/DetailUmkm.php b/application/controllers/user/DetailUmkm.php index dc31b79..e0171d6 100644 --- a/application/controllers/user/DetailUmkm.php +++ b/application/controllers/user/DetailUmkm.php @@ -27,8 +27,12 @@ class DetailUmkm extends CI_Controller { public function index() { - - $get = $this->input->get(); + if($this->input->get()){ + $get = $this->input->get(); + if(isset($get['msg'])){ + $data['msg'] = 'success'; + } + } $umkm = $this->UmkmModel->getUmkmsById($get['id_umkm']); @@ -41,6 +45,9 @@ class DetailUmkm extends CI_Controller { $post = $this->input->post(); if($this->AbsensiModel->update($post['id_absensi'])){ + + $this->UmkmModel->updateAset($umkm->id_umkm,$post['aset']); + redirect(site_url('user/detailumkm?id_umkm='.$umkm->id_umkm.'&msg=success')); } else { $data['msg']="error!"; diff --git a/application/controllers/user/Produk.php b/application/controllers/user/Produk.php index e1e4b11..f08287d 100644 --- a/application/controllers/user/Produk.php +++ b/application/controllers/user/Produk.php @@ -76,8 +76,6 @@ class Produk extends CI_Controller { $data['umkm'] = $umkm; $data['pemilik'] = $pemilik; $data['user_logged'] = $this->session->userdata('user_logged'); - - $this->load->view('user/produk',$data); diff --git a/application/controllers/user/ResetPassword.php b/application/controllers/user/ResetPassword.php new file mode 100644 index 0000000..a5257b8 --- /dev/null +++ b/application/controllers/user/ResetPassword.php @@ -0,0 +1,45 @@ +load->model("UserModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + } + + public function index() + { + $data['user_logged'] = $this->session->userdata('user_logged'); + + if($this->input->get()){ + $get = $this->input->get(); + if(isset($get['msg'])){ + $data['msg'] = $get['msg']; + } + } + + if($this->input->post()){ + + if($this->UserModel->resetPassword($data['user_logged']->id_user)){ + redirect(site_url('user/resetpassword?&msg=success')); + } else { + $data['msg']="error!"; + } + + } + + $this->load->view('user/resetpassword',$data); + + } + + +} diff --git a/application/controllers/user/RiwayatAbsensi.php b/application/controllers/user/RiwayatAbsensi.php index 54ca882..86827a9 100644 --- a/application/controllers/user/RiwayatAbsensi.php +++ b/application/controllers/user/RiwayatAbsensi.php @@ -40,6 +40,7 @@ class RiwayatAbsensi extends CI_Controller { $cekabsensiakhir = $this->AbsensiModel->getLatestSignedAbsensiCountByUmkmId($umkm->id_umkm); + //var_dump($cekabsensiakhir);die(); if($cekabsensiakhir > 0 ){ $absensiakhir = $this->AbsensiModel->getLatestSignedAbsensiByUmkmId($umkm->id_umkm); diff --git a/application/controllers/user/setting.php b/application/controllers/user/setting.php new file mode 100644 index 0000000..053cf04 --- /dev/null +++ b/application/controllers/user/setting.php @@ -0,0 +1,79 @@ +load->model("UserModel"); + $this->load->model("KelurahanModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + } + + public function index() + { + $current_user['user_logged'] = $this->session->userdata('user_logged'); + $pemilik = $this->UserModel->getUsersById($current_user['user_logged']->id_user); + + if($this->input->get()){ + $get = $this->input->get(); + if(isset($get['msg'])){ + $data['msg'] = $get['msg']; + } + } + + if($this->input->post()){ + + if(strlen($_FILES['foto_user']['tmp_name'])>0){ + $config['upload_path'] = './assets/images/'; + $config['allowed_types'] = 'jpg|jpeg|gif|png'; + $config['max_size'] = 100; + $config['max_width'] = 1024; + $config['max_height'] = 768; + $config['file_name'] = $pemilik->username; + $config['overwrite'] = TRUE; + + $this->load->library('upload', $config); + + if ( ! $this->upload->do_upload('foto_user')){ + $data['error_upload'] = $this->upload->display_errors(); + }else{ + $foto_lama = $pemilik->foto_user; + $file = $this->upload->data(); + if($this->UserModel->selfUpdate($pemilik->id_user,$file['file_name'])){ + if($pemilik->foto_user!=='user.png'){ + unlink('./assets/images/'.$foto_lama); + } + redirect(site_url('user/setting?&msg=success')); + } else { + $data['msg']="error!"; + } + } + } else { + $foto_user = $pemilik->foto_user; + if($this->UserModel->selfUpdate($pemilik->id_user,$foto_user)){ + redirect(site_url('user/setting?&msg=success')); + } else { + $data['msg']="error!"; + } + } + + } + + + $data['pemilik'] = $pemilik; + $data['listkelurahan'] = $this->KelurahanModel->getKelurahan(); + $data['user_logged'] = $this->session->userdata('user_logged'); + $this->load->view('user/setting',$data); + + } + + +} diff --git a/application/models/AbsenModel.php b/application/models/AbsenModel.php index 42fe7a8..bcec8d4 100644 --- a/application/models/AbsenModel.php +++ b/application/models/AbsenModel.php @@ -25,9 +25,11 @@ class AbsenModel extends CI_Model public function getAbsenTahun(){ $this->db->select('tahun'); $this->db->distinct('tahun'); + $this->db->order_by('tahun','DESC'); return $tahun = $this->db->get($this->_table)->result(); } + public function getCountActiveAbsen(){ $this->db->where('status_absen', 'open'); return $absen = count($this->db->get($this->_table)->result()); @@ -106,6 +108,17 @@ class AbsenModel extends CI_Model return $this->db->insert($this->_table, $this); } + public function update($id_absen,$omset,$aset,$karyawan_l,$karyawan_p) + { + + $this->omset = $omset; + $this->aset = $aset; + $this->karyawan_l = $karyawan_l; + $this->karyawan_p = $karyawan_p; + + return $this->db->update($this->_table, $this, array('id_absen' => $id_absen)); + } + public function delete($id_absen) { return $this->db->delete($this->_table, array("id_absen" => $id_absen)); diff --git a/application/models/AbsensiModel.php b/application/models/AbsensiModel.php index 1a917d8..57978e3 100644 --- a/application/models/AbsensiModel.php +++ b/application/models/AbsensiModel.php @@ -32,6 +32,41 @@ class AbsensiModel extends CI_Model return $this->db->update($this->_table, $this, array('id_absensi' => $id_absensi)); } + public function getAbsensiByBulanAndTahun($bulan,$tahun){ + $this->db->where('bulan', $bulan); + $this->db->where('tahun', $tahun); + return $absensi = count($this->db->get($this->_table)->result()); + } + + public function getAbsensiByTahunAndUmkmId($tahun,$id_umkm){ + $this->db->where('id_umkm', $id_umkm); + $this->db->where('tahun', $tahun); + return $absensi = $this->db->get($this->_table)->result(); + } + + public function getAbsensByTahunAndKelurahan($tahun,$kelurahan){ + $this->db->where('kelurahan', $kelurahan); + $this->db->where('tahun', $tahun); + return $absensi = $this->db->get($this->_table)->result(); + } + + public function getAbsensiByBulanAndThn($bulan,$tahun){ + $this->db->where('bulan', $bulan); + $this->db->where('tahun', $tahun); + return $absensi = $this->db->get($this->_table)->result(); + } + + public function getAbsensiByTahunAndKelurahan($tahun,$kelurahan){ + $this->db->where('tahun', $tahun); + $this->db->where('kelurahan', $kelurahan); + return $absensi = count($this->db->get($this->_table)->result()); + } + + public function absenBySystem($id_absensi){ + $this->signed = 3; + return $this->db->update($this->_table, $this, array('id_absensi' => $id_absensi)); + } + public function getLastMonthAbsensi($bulan,$tahun){ $bulan = $bulan-1; $this->db->where('bulan', $bulan); @@ -71,7 +106,7 @@ class AbsensiModel extends CI_Model } public function getLatestSignedAbsensiCountByUmkmId($id_umkm){ - $this->db->where('signed', true); + $this->db->where('signed', 1); $this->db->where('id_umkm', $id_umkm); $this->db->where('tahun', date('Y')); $this->db->order_by('bulan', 'DESC'); @@ -95,7 +130,8 @@ class AbsensiModel extends CI_Model } public function getSignedAbsensiByUmkmId($id_umkm){ - $this->db->where('signed', true); + $this->db->where('signed', 1); + // $this->db->where('signed', 3); $this->db->where('id_umkm', $id_umkm); $this->db->where('tahun', date('Y')); $this->db->order_by('bulan', 'DESC'); @@ -117,11 +153,13 @@ class AbsensiModel extends CI_Model return $absensi = $this->db->get($this->_table)->result(); } - public function save($id_absen,$id_umkm,$id_pemilik,$kecamatan,$kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p) + public function save($id_absen,$id_umkm,$id_pemilik,$id_jenis,$id_kategori,$kecamatan,$kelurahan,$bulan_absen,$tahun_absen,$omset_absensi,$aset_absensi,$karyawan_absensi_l,$karyawan_absensi_p) { $this->id_absen = $id_absen; $this->id_umkm = $id_umkm; $this->id_pemilik = $id_pemilik; + $this->id_jenis = $id_jenis; + $this->id_kategori = $id_kategori; $this->kecamatan = $kecamatan; $this->kelurahan = $kelurahan; $this->bulan = $bulan_absen; diff --git a/application/models/LaporanModel.php b/application/models/LaporanModel.php index 4f0b123..51568b6 100644 --- a/application/models/LaporanModel.php +++ b/application/models/LaporanModel.php @@ -9,5 +9,44 @@ class LaporanModel extends CI_Model return $laporan = count($this->db->get($this->_table)->result()); } + public function save($tahun,$bulan,$kelurahan,$kecamatan,$aset,$omset,$jumlah_umkm,$karyawan_jenis1,$karyawan_jenis2,$karyawan_jenis3,$omset_jenis1,$omset_jenis2,$omset_jenis3,$aset_jenis1,$aset_jenis2,$aset_jenis3,$karyawan_jen1_l,$karyawan_jen1_p,$karyawan_jen2_l,$karyawan_jen2_p,$karyawan_jen3_l,$karyawan_jen3_p,$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) + { + $this->tahun = $tahun; + $this->bulan = $bulan; + $this->kelurahan = $kelurahan; + $this->kecamatan = $kecamatan; + $this->aset = $aset; + $this->omset = $omset; + $this->jumlah_umkm = $jumlah_umkm; + $this->karyawan_jenis1 = $karyawan_jenis1; + $this->karyawan_jenis2 = $karyawan_jenis2; + $this->karyawan_jenis3 = $karyawan_jenis3; + $this->omset_jenis1 = $omset_jenis1; + $this->omset_jenis2 = $omset_jenis2; + $this->omset_jenis3 = $omset_jenis3; + $this->aset_jenis1 = $aset_jenis1; + $this->aset_jenis2 = $aset_jenis2; + $this->aset_jenis3 = $aset_jenis3; + $this->karyawan_jen1_l = $karyawan_jen1_l; + $this->karyawan_jen1_p = $karyawan_jen1_p; + $this->karyawan_jen2_l = $karyawan_jen2_l; + $this->karyawan_jen2_p = $karyawan_jen2_p; + $this->karyawan_jen3_l = $karyawan_jen3_l; + $this->karyawan_jen3_p = $karyawan_jen3_p; + $this->umkm_jen1_kat1 = $umkm_jen1_kat1; + $this->umkm_jen1_kat2 = $umkm_jen1_kat2; + $this->umkm_jen1_kat3 = $umkm_jen1_kat3; + $this->umkm_jen2_kat1 = $umkm_jen2_kat1; + $this->umkm_jen2_kat2 = $umkm_jen2_kat2; + $this->umkm_jen2_kat3 = $umkm_jen2_kat3; + $this->umkm_jen3_kat1 = $umkm_jen3_kat1; + $this->umkm_jen3_kat2 = $umkm_jen3_kat2; + $this->umkm_jen3_kat3 = $umkm_jen3_kat3; + + //var_dump($this);die(); + + return $this->db->insert($this->_table, $this); + } + } \ No newline at end of file diff --git a/application/models/UmkmModel.php b/application/models/UmkmModel.php index 04fde85..0e7b3f2 100644 --- a/application/models/UmkmModel.php +++ b/application/models/UmkmModel.php @@ -128,6 +128,38 @@ class UmkmModel extends CI_Model return $this->db->update($this->_table, $this, array('id_umkm' => $id_umkm)); } + public function updateOmset($id_umkm,$omset) + { + + $this->omset_awal = $omset; + + if($omset>2500000000){ + $id_kategori = 3; + } elseif($omset>300000000){ + $id_kategori = 2; + } else { + $id_kategori = 1; + } + + + $this->id_kategori = $id_kategori; + + + return $this->db->update($this->_table, $this, array('id_umkm' => $id_umkm)); + } + + + + public function updateAset($id_umkm,$aset) + { + if($aset>500000000){ + $this->id_kategori = 3; + } else{ + $this->id_kategori = 1; + } + return $this->db->update($this->_table, $this, array('id_umkm' => $id_umkm)); + } + public function userUpdate($id_umkm,$foto_umkm) { $post = $this->input->post(); diff --git a/application/models/UserModel.php b/application/models/UserModel.php index ad00886..70fc612 100644 --- a/application/models/UserModel.php +++ b/application/models/UserModel.php @@ -101,6 +101,28 @@ class UserModel extends CI_Model return $this->db->update($this->_table, $this, array('id_user' => $id_pemilik)); } + public function selfUpdate($id_pemilik,$foto_user) + { + $post = $this->input->post(); + $this->alamat_user = $post["alamat"]; + if($post['kelurahan']!=='luar'){ + $kelurahan = $post['kelurahan']; + $kecamatan = $this->KelurahanModel->getKecamatanByKelurahan($post['kelurahan']); + $kota = 'Kota Magelang'; + } else { + $kelurahan = 'Luar Kota Magelang'; + $kecamatan = 'Luar Kota Magelang'; + $kota = 'Luar Kota Magelang'; + } + $this->kelurahan_user = $kelurahan; + $this->kecamatan_user = $kecamatan; + $this->kota_user = $kota; + $this->telp_user = $post["telp"]; + $this->npwp = $post["npwp"]; + $this->foto_user = $foto_user; + return $this->db->update($this->_table, $this, array('id_user' => $id_pemilik)); + } + public function resetPassword($id_user) { $post = $this->input->post(); diff --git a/application/views/admin/editumkm.php b/application/views/admin/editumkm.php index 4ef701a..394af6f 100644 --- a/application/views/admin/editumkm.php +++ b/application/views/admin/editumkm.php @@ -175,7 +175,13 @@ - + kelurahan=='Luar Kota Magelang'){ + ?> + + diff --git a/application/views/admin/produk.php b/application/views/admin/produk.php new file mode 100644 index 0000000..d1f6193 --- /dev/null +++ b/application/views/admin/produk.php @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+ +
+
+
Data UMKM
+
+
+ + +
+
+
+
+
+
+ nama?>
+ Pemilik :
+ + + nama?> + + +
+
+
+
+ DATA TERKINI +
+
+
+
+
+
+ TENAGA KERJA +
+
+ Laki-laki :
+ Perempuan : +
+
+
+
+
+
+ OMSET TAHUNAN +
+
+
+
+
+
+
+
+
+ ASET TERAKHIR +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
No Telp
+
:
+
telp?>
+
+ +
+
Kategori
+
:
+
kategori?>
+
+ +
+
Jenis
+
:
+
jenis?>
+
+ +
+
Kelurahan
+
:
+
kelurahan?>
+
+ +
+
Kecamatan
+
:
+
kecamatan?>
+
+ +
+
+ +
+
Alamat
+
+ +
+
+ +
+
Deskripsi
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
FotoProdukDeskripsi
+
+
produk?>deskripsi?>
+
+
+ + + + +
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/admin/progresabsen.php b/application/views/admin/progresabsen.php index 7c793c6..0b88be7 100644 --- a/application/views/admin/progresabsen.php +++ b/application/views/admin/progresabsen.php @@ -83,6 +83,16 @@
+ + + + + +
@@ -125,7 +135,7 @@
- + Close diff --git a/application/views/admin/tambahumkm.php b/application/views/admin/tambahumkm.php index 8d8965f..acd4439 100644 --- a/application/views/admin/tambahumkm.php +++ b/application/views/admin/tambahumkm.php @@ -166,7 +166,6 @@ -
diff --git a/application/views/user/produk.php b/application/views/user/produk.php index c995d9a..6117bcc 100644 --- a/application/views/user/produk.php +++ b/application/views/user/produk.php @@ -5,6 +5,7 @@ return $hasil_rupiah; } + ?> @@ -206,22 +207,24 @@
-