diff --git a/.gitignore b/.gitignore index 77016c6..a2c1fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,5 @@ -# ---> CodeIgniter -*/config/development -*/logs/log-*.php -!*/logs/index.html -*/cache/* -!*/cache/index.html -!*/cache/.htaccess - -user_guide_src/build/* -user_guide_src/cilexer/build/* -user_guide_src/cilexer/dist/* -user_guide_src/cilexer/pycilexer.egg-info/* - #codeigniter 3 -application/logs/* -!application/logs/index.html -!application/logs/.htaccess -/vendor/ + db_umkm2.sql application/config/database.php diff --git a/application/config/database.php.example b/application/config/database.php.example index c58c384..41f1b12 100644 --- a/application/config/database.php.example +++ b/application/config/database.php.example @@ -77,8 +77,8 @@ $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'your_mysql_username', - 'password' => 'your_mysql_password', - 'database' => 'your_db_name', + 'password' => '', + 'database' => 'your_database_name', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/controllers/login.php b/application/controllers/login.php index 37a4081..c72ebf8 100644 --- a/application/controllers/login.php +++ b/application/controllers/login.php @@ -17,14 +17,18 @@ class Login extends CI_Controller { if($this->session->userdata('user_logged')->level=='admin'){ redirect(site_url('admin/dashboard')); } else { - redirect(site_url('dashboard')); + redirect(site_url('user/dashboard')); } } if($this->input->post()){ if($this->UserModel->doLogin()) { - redirect(site_url('admin/dashboard')); + if($this->UserModel->isPemilik()){ + redirect(site_url('user/dashboard')); + } else { + redirect(site_url('admin/dashboard')); + } } else { $data['error']="Username atau Password salah !"; $this->load->view('login',$data); diff --git a/application/controllers/user/Dashboard.php b/application/controllers/user/Dashboard.php new file mode 100644 index 0000000..54d496e --- /dev/null +++ b/application/controllers/user/Dashboard.php @@ -0,0 +1,40 @@ +load->model("UmkmModel"); + $this->load->model("UserModel"); + $this->load->model("KategoriModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + + } + + public function index() + { + if($this->input->get()){ + $get = $this->input->get(); + if(isset($get['pemilik'])){ + $data['del_pemilik']= $get['pemilik']; + } + $data['del_msg']= $get['del_msg']; + + } + + $data['user_logged'] = $this->session->userdata('user_logged'); + $data['data_umkm'] = $this->UmkmModel->getUmkmsByIdPemilik($data['user_logged']->id_user); + $this->load->view('user/dashboard',$data); + + } + + +} diff --git a/application/controllers/user/DetailUmkm.php b/application/controllers/user/DetailUmkm.php new file mode 100644 index 0000000..bb793b1 --- /dev/null +++ b/application/controllers/user/DetailUmkm.php @@ -0,0 +1,120 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("AbsensiModel"); + $this->load->model("AbsenModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('user/dashboard')); + } + } + + 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(); + + // var_dump($this->input->post());die(); + + if($this->input->post()){ + + $post = $this->input->post(); + if($this->AbsensiModel->update($post['id_absensi'])){ + redirect(site_url('user/detailumkm?id_umkm='.$umkm->id_umkm.'&msg=success')); + } else { + $data['msg']="error!"; + } + + + } + + $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; + $data['listabsensi'] = $this->AbsensiModel->getSignedAbsensiByUmkmId($umkm->id_umkm); + } else { + $aset = $umkm->aset_awal; + $karyawan_l = $umkm->karyawan_l; + $karyawan_p = $umkm->karyawan_p; + $data['listabsensi'] = array(); + } + + + $data['omset'] = $umkm->omset_awal; + $data['karyawan_l'] = $karyawan_l; + $data['karyawan_p'] = $karyawan_p; + $data['aset'] = $aset; + $data['daftarkategori'] = $daftarkategori; + $data['umkm'] = $umkm; + $data['pemilik'] = $pemilik; + $data['user_logged'] = $this->session->userdata('user_logged'); + + if($this->AbsenModel->getCountActiveAbsen()>0){ + $data['data_absen'] = $this->AbsenModel->getActiveAbsen(); + if($data['data_absen']->bulan=='1'){ + $bulan = 'Januari'; + } elseif($data['data_absen']->bulan=='2'){ + $bulan = 'Februari'; + } elseif($data['data_absen']->bulan=='3'){ + $bulan = 'Maret'; + } elseif($data['data_absen']->bulan=='4'){ + $bulan = 'April'; + } elseif($data['data_absen']->bulan=='5'){ + $bulan = 'Mei'; + } elseif($data['data_absen']->bulan=='6'){ + $bulan = 'Juni'; + } elseif($data['data_absen']->bulan=='7'){ + $bulan = 'Juli'; + } elseif($data['data_absen']->bulan=='8'){ + $bulan = 'Agustus'; + } elseif($data['data_absen']->bulan=='9'){ + $bulan = 'September'; + } elseif($data['data_absen']->bulan=='10'){ + $bulan = 'Oktober'; + } elseif($data['data_absen']->bulan=='11'){ + $bulan = 'November'; + } elseif($data['data_absen']->bulan=='12'){ + $bulan = 'Desember'; + } + $data['bulan'] = $bulan; + + $data['active_absen'] = true; + + $data['absenisiaktif'] = $this->AbsensiModel->getAbsensiByAbsenIdAndUmkmId($umkm->id_umkm,$data['data_absen']->id_absen); + } else { + $data['data_absen'] = ''; + $data['active_absen'] = false; + } + + + $this->load->view('user/detailumkm',$data); + + } + + +} diff --git a/application/controllers/user/EditUmkm.php b/application/controllers/user/EditUmkm.php new file mode 100644 index 0000000..f7e73ea --- /dev/null +++ b/application/controllers/user/EditUmkm.php @@ -0,0 +1,84 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("KelurahanModel"); + $this->load->model("JenisModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('user/dashboard')); + } + } + + public function index() + { + + $get = $this->input->get(); + $umkm = $this->UmkmModel->getUmkmsById($get['id_umkm']); + + + if($this->input->post()){ + + if(strlen($_FILES['foto_umkm']['tmp_name'])>0){ + $config['upload_path'] = './assets/images/umkm/'; + $config['allowed_types'] = 'jpg|jpeg|gif|png'; + $config['max_size'] = 100; + $config['max_width'] = 1024; + $config['max_height'] = 768; + $config['file_name'] = $umkm->id_umkm; + $config['overwrite'] = TRUE; + + $this->load->library('upload', $config); + + if ( ! $this->upload->do_upload('foto_umkm')){ + $data['error_upload'] = $this->upload->display_errors(); + } else { + $foto_lama = $umkm->foto_umkm; + $file = $this->upload->data(); + if($this->UmkmModel->userUpdate($umkm->id_umkm,$file['file_name'])){ + if($umkm->foto_umkm!=='umkm.png'){ + unlink('./assets/images/umkm/'.$foto_lama); + } + redirect(site_url('user/editumkm?id_umkm='.$umkm->id_umkm.'&msg=success')); + } else { + $data['msg']="error!"; + } + } + + } else{ + $foto_umkm = $umkm->foto_umkm; + if($this->UmkmModel->userUpdate($umkm->id_umkm,$foto_umkm)){ + redirect(site_url('user/editumkm?id_umkm='.$umkm->id_umkm.'&msg=success')); + } else { + $data['msg']="error!"; + } + } + } + + $daftarjenis = $this->JenisModel->getJenis(); + $data['daftarjenis'] = $daftarjenis; + $data['listkelurahan'] = $this->KelurahanModel->getKelurahan(); + $data['umkm'] = $umkm; + $data['user_logged'] = $this->session->userdata('user_logged'); + + $this->load->view('user/editumkm',$data); + + } + + +} diff --git a/application/controllers/user/HapusProduk.php b/application/controllers/user/HapusProduk.php new file mode 100644 index 0000000..2af4411 --- /dev/null +++ b/application/controllers/user/HapusProduk.php @@ -0,0 +1,50 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("AbsensiModel"); + $this->load->model("ProdukModel"); + + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + $get = $this->input->get(); + if($get['id_produk']==NULL){ + redirect(site_url('user/dashboard')); + } + } + + public function index() + { + + + $get = $this->input->get(); + $produk = $this->ProdukModel->getProdukById($get['id_produk']); + $id_umkm = $produk->id_umkm; + + if($produk->foto_produk!=='default.png'){ + unlink('./assets/images/produk/'.$produk->foto_produk); + } + $this->ProdukModel->delete($get['id_produk']); + redirect(site_url('user/produk?del_msg=success&id_umkm='.$id_umkm)); + + + + + $data['produk'] = $produk; + $data['user_logged'] = $this->session->userdata('user_logged'); + + } + + +} diff --git a/application/controllers/user/Produk.php b/application/controllers/user/Produk.php new file mode 100644 index 0000000..e1e4b11 --- /dev/null +++ b/application/controllers/user/Produk.php @@ -0,0 +1,87 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("AbsensiModel"); + $this->load->model("AbsenModel"); + $this->load->model("ProdukModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + + + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('user/dashboard')); + + } + } + + public function index() + { + + $get = $this->input->get(); + + if($this->input->get()){ + if(isset($get['del_msg'])){ + $data['del_msg']= $get['del_msg']; + } + + } + + $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); + + // var_dump($this->input->post());die(); + + + + $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; + $data['listabsensi'] = $this->AbsensiModel->getSignedAbsensiByUmkmId($umkm->id_umkm); + } else { + $aset = $umkm->aset_awal; + $karyawan_l = $umkm->karyawan_l; + $karyawan_p = $umkm->karyawan_p; + $data['listabsensi'] = array(); + } + + + $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('user/produk',$data); + + } + + +} diff --git a/application/controllers/user/RiwayatAbsensi.php b/application/controllers/user/RiwayatAbsensi.php new file mode 100644 index 0000000..54ca882 --- /dev/null +++ b/application/controllers/user/RiwayatAbsensi.php @@ -0,0 +1,74 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("AbsensiModel"); + $this->load->model("AbsenModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('user/dashboard')); + } + } + + 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(); + + // var_dump($this->input->post());die(); + + + + $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; + $data['listabsensi'] = $this->AbsensiModel->getSignedAbsensiByUmkmId($umkm->id_umkm); + } else { + $aset = $umkm->aset_awal; + $karyawan_l = $umkm->karyawan_l; + $karyawan_p = $umkm->karyawan_p; + $data['listabsensi'] = array(); + } + + + $data['omset'] = $umkm->omset_awal; + $data['karyawan_l'] = $karyawan_l; + $data['karyawan_p'] = $karyawan_p; + $data['aset'] = $aset; + $data['daftarkategori'] = $daftarkategori; + $data['umkm'] = $umkm; + $data['pemilik'] = $pemilik; + $data['user_logged'] = $this->session->userdata('user_logged'); + + + + $this->load->view('user/riwayatabsensi',$data); + + } + + +} diff --git a/application/controllers/user/TambahProduk.php b/application/controllers/user/TambahProduk.php new file mode 100644 index 0000000..8549440 --- /dev/null +++ b/application/controllers/user/TambahProduk.php @@ -0,0 +1,126 @@ +load->model("UserModel"); + $this->load->model("UmkmModel"); + $this->load->model("KategoriModel"); + $this->load->model("AbsensiModel"); + $this->load->model("AbsenModel"); + $this->load->model("ProdukModel"); + + if($this->UserModel->isNotLogin()) { + redirect(site_url('login')); + } elseif(!($this->UserModel->isPemilik())) { + redirect(site_url('admin/dashboard')); + } + + $get = $this->input->get(); + if($get['id_umkm']==NULL){ + redirect(site_url('user/dashboard')); + } + } + + 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(); + + // var_dump($this->input->post());die(); + + if($this->input->post()){ + $post=$this->input->post(); + if($post['produk']!=='default'){ + if($this->ProdukModel->save($umkm->id_umkm)){ + + $current_produk = $this->ProdukModel->getLastProdukByIdUmkm($umkm->id_umkm); + + if(strlen($_FILES['foto_produk']['tmp_name'])>0){ + $config['upload_path'] = './assets/images/produk/'; + $config['allowed_types'] = 'jpg|jpeg|gif|png'; + $config['max_size'] = 100; + $config['max_width'] = 1024; + $config['max_height'] = 768; + $config['file_name'] = $current_produk->id_produk; + $config['overwrite'] = TRUE; + + $this->load->library('upload', $config); + + if ( ! $this->upload->do_upload('foto_produk')){ + $foto_produk = 'default.png'; + $this->ProdukModel->setFirstImage($current_produk->id_produk,$foto_produk); + $data['error_upload'] = $this->upload->display_errors(); + $data['msg']="success"; + } else { + $file = $this->upload->data(); + + if($this->ProdukModel->setFirstImage($current_produk->id_produk,$file['file_name'])){ + $data['msg']="success"; + } else { + $foto_produk = 'default.png'; + $this->ProdukModel->setFirstImage($current_produk->id_produk,$foto_produk); + $data['error_upload'] = 'gagal upload foto'; + $data['msg']="success"; + } + } + + } else { + $foto_produk = 'default.png'; + $this->ProdukModel->setFirstImage($current_produk->id_produk,$foto_produk); + $data['msg']="success"; + } + + } else { + $data['msg']="error!"; + } + } else { + $data['msg']="error!"; + } + + + } + + $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; + $data['listabsensi'] = $this->AbsensiModel->getSignedAbsensiByUmkmId($umkm->id_umkm); + } else { + $aset = $umkm->aset_awal; + $karyawan_l = $umkm->karyawan_l; + $karyawan_p = $umkm->karyawan_p; + $data['listabsensi'] = array(); + } + + + $data['omset'] = $umkm->omset_awal; + $data['karyawan_l'] = $karyawan_l; + $data['karyawan_p'] = $karyawan_p; + $data['aset'] = $aset; + $data['daftarkategori'] = $daftarkategori; + $data['umkm'] = $umkm; + $data['pemilik'] = $pemilik; + $data['user_logged'] = $this->session->userdata('user_logged'); + + + + + $this->load->view('user/tambahproduk',$data); + + } + + +} diff --git a/application/models/AbsensiModel.php b/application/models/AbsensiModel.php index 51c14f7..b981db1 100644 --- a/application/models/AbsensiModel.php +++ b/application/models/AbsensiModel.php @@ -10,6 +10,22 @@ class AbsensiModel extends CI_Model return $absensi = $this->db->get($this->_table)->result(); } + public function getAbsensiByAbsenIdAndUmkmId($id_umkm,$id_absen){ + $this->db->where('id_absen', $id_absen); + $this->db->where('id_umkm', $id_umkm); + return $absensi = $this->db->get($this->_table)->row(); + } + + public function update($id_absensi){ + $post = $this->input->post(); + $this->aset = $post["aset"]; + $this->omset = $post["omset"]; + $this->karyawan_l = $post["karyawan_l"]; + $this->karyawan_p = $post["karyawan_p"]; + $this->signed = 1; + 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); @@ -75,6 +91,7 @@ class AbsensiModel extends CI_Model public function getSignedAbsensiByUmkmId($id_umkm){ $this->db->where('signed', true); $this->db->where('id_umkm', $id_umkm); + $this->db->where('tahun', date('Y')); $this->db->order_by('bulan', 'DESC'); $this->db->order_by('tahun', 'DESC'); return $user = $this->db->get($this->_table)->result(); diff --git a/application/models/ProdukModel.php b/application/models/ProdukModel.php new file mode 100644 index 0000000..f64871d --- /dev/null +++ b/application/models/ProdukModel.php @@ -0,0 +1,47 @@ +input->post(); + $this->id_umkm = $id_umkm; + $this->produk = $post["produk"]; + $this->deskripsi = $post["deskripsi"]; + + $this->foto_produk = "default.png"; + return $this->db->insert($this->_table, $this); + } + + public function getProdukByUmkmId($id_umkm){ + $this->db->where('id_umkm', $id_umkm); + $this->db->order_by('produk', 'DESC'); + return $produk = $this->db->get($this->_table)->result(); + } + + public function getProdukById($id_produk){ + $this->db->where('id_produk', $id_produk); + return $produk = $this->db->get($this->_table)->row(); + } + + public function getLastProdukByIdUmkm($id_umkm){ + $this->db->where('id_umkm', $id_umkm); + $this->db->order_by('id_produk', 'DESC'); + return $umkm = $this->db->get($this->_table)->row(); + } + + public function setFirstImage($id_produk,$foto_produk) + { + $this->foto_produk = $foto_produk; + return $this->db->update($this->_table, $this, array('id_produk' => $id_produk)); + } + + public function delete($id_produk) + { + return $this->db->delete($this->_table, array("id_produk" => $id_produk)); + } + + +} \ No newline at end of file diff --git a/application/models/UmkmModel.php b/application/models/UmkmModel.php index 536a6d2..04fde85 100644 --- a/application/models/UmkmModel.php +++ b/application/models/UmkmModel.php @@ -66,6 +66,7 @@ class UmkmModel extends CI_Model public function getUmkmsByIdPemilik($id_pemilik){ $this->db->join('tb_kategori','tb_kategori.id_kategori = tb_umkm.id_kategori'); + $this->db->join('tb_jenis','tb_jenis.id_jenis = tb_umkm.id_jenis'); $this->db->where('id_pemilik', $id_pemilik); return $umkm = $this->db->get($this->_table)->result(); } @@ -127,6 +128,20 @@ class UmkmModel extends CI_Model return $this->db->update($this->_table, $this, array('id_umkm' => $id_umkm)); } + public function userUpdate($id_umkm,$foto_umkm) + { + $post = $this->input->post(); + $this->nama = $post["nama"]; + + + $this->id_jenis = $post["jenis"]; + + $this->telp = $post["telp"]; + $this->deskripsi = $post["deskripsi"]; + $this->foto_umkm = $foto_umkm; + return $this->db->update($this->_table, $this, array('id_umkm' => $id_umkm)); + } + public function delete($id_umkm) { return $this->db->delete($this->_table, array("id_umkm" => $id_umkm)); diff --git a/application/views/user/dashboard.php b/application/views/user/dashboard.php new file mode 100644 index 0000000..d6e25ac --- /dev/null +++ b/application/views/user/dashboard.php @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Daftar UMKM
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + KategoriModel->getKategoriById($umkm->id_kategori); + ?> + + + + + + + +
NoNama UmkmKecamatanKategoriOpsi
nama?>kecamatan?>kategori?> + Detail + Edit + +
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/user/detailumkm.php b/application/views/user/detailumkm.php new file mode 100644 index 0000000..2921b4e --- /dev/null +++ b/application/views/user/detailumkm.php @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Data UMKM
+
+
+ + +
+ +
+
+
+
+ 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
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ Absen Aktif +
+ + +
+
+
+
Bulan Tahun tahun ?>
+
+
+ signed==1){?> + Sudah Absen + + Belum Absen + +
+
+
+
+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+
+ + +
+ +
+ + +
+ +
+ +
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
+ + + + + +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/user/editumkm.php b/application/views/user/editumkm.php new file mode 100644 index 0000000..2fe41f0 --- /dev/null +++ b/application/views/user/editumkm.php @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Data UMKM
+
+
+ + +
+
+
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/user/produk.php b/application/views/user/produk.php new file mode 100644 index 0000000..35af4a7 --- /dev/null +++ b/application/views/user/produk.php @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Data UMKM
+
+
+ + +
+
+
+
+
+
+ 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
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+ + + + + +
+ Tambah Produk + + + + + + + + + + + + + + + + + + + + +
ProdukFotoDeskripsi
+
+
produk?>deskripsi?> + Hapus +
+
+
+ + + + +
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/user/riwayatabsensi.php b/application/views/user/riwayatabsensi.php new file mode 100644 index 0000000..bf7508e --- /dev/null +++ b/application/views/user/riwayatabsensi.php @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Data UMKM
+
+
+ + +
+
+
+
+
+
+ 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
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + bulan==1){ + $bulan = 'Januari'; + } elseif($absensi->bulan==2){ + $bulan = 'Februari'; + } elseif($absensi->bulan==3){ + $bulan = 'Maret'; + } elseif($absensi->bulan==4){ + $bulan = 'April'; + } elseif($absensi->bulan==5){ + $bulan = 'Mei'; + } elseif($absensi->bulan==6){ + $bulan = 'Juni'; + } elseif($absensi->bulan==7){ + $bulan = 'Juli'; + } elseif($absensi->bulan==8){ + $bulan = 'Agustus'; + } elseif($absensi->bulan==9){ + $bulan = 'September'; + } elseif($absensi->bulan==10){ + $bulan = 'Oktober'; + } elseif($absensi->bulan==11){ + $bulan = 'November'; + } elseif($absensi->bulan==12){ + $bulan = 'Desember'; + } else { + $bulan = 'a/n'; + } + + ?> + + + + + + + + + + +
TahunBulanAset TerkiniOmset Bulan IniJumlah lJumlah p
tahun?>aset) ?>omset) ?>karyawan_l ?>karyawan_p ?>
+
+
+ + + + +
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/user/tambahproduk.php b/application/views/user/tambahproduk.php new file mode 100644 index 0000000..4f3751d --- /dev/null +++ b/application/views/user/tambahproduk.php @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + Aplikasi UMKM + + + + + + + +
+
+
+
+
+
+ nama ?> +
+ +
+
+
+
+
Data UMKM
+
+
+ + +
+ +
+
+
+
+ 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
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ Tambah Produk +
+ + +
+
+
+
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+
+ +
+
+
+ + +
+
+ + + +
+
+
+ + + + + +
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/produk/default.png b/assets/images/produk/default.png new file mode 100644 index 0000000..8226e9b Binary files /dev/null and b/assets/images/produk/default.png differ diff --git a/assets/images/umkm/1.jpg b/assets/images/umkm/1.jpg new file mode 100644 index 0000000..cb5be21 Binary files /dev/null and b/assets/images/umkm/1.jpg differ diff --git a/assets/images/umkm/1.png b/assets/images/umkm/1.png deleted file mode 100644 index 07b84bc..0000000 Binary files a/assets/images/umkm/1.png and /dev/null differ diff --git a/db_umkm2_test.sql b/db_umkm2_test.sql index ad7b905..7b8a24e 100644 --- a/db_umkm2_test.sql +++ b/db_umkm2_test.sql @@ -1,11 +1,11 @@ -- phpMyAdmin SQL Dump --- version 5.1.1 +-- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 --- Generation Time: Sep 15, 2021 at 03:25 PM --- Server version: 10.4.21-MariaDB --- PHP Version: 7.4.23 +-- Generation Time: Sep 16, 2021 at 10:36 AM +-- Server version: 10.4.16-MariaDB +-- PHP Version: 7.4.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; @@ -18,7 +18,7 @@ SET time_zone = "+00:00"; /*!40101 SET NAMES utf8mb4 */; -- --- Database: `db_umkm2_test` +-- Database: `db_umkm2` -- -- -------------------------------------------------------- @@ -133,7 +133,7 @@ INSERT INTO `tb_absensi` (`id_absensi`, `id_absen`, `id_umkm`, `id_pemilik`, `ke (166, '46', '2', '2', '', '', 0, 0, 0, 0, '12', '2020', 1), (167, '46', '3', '2', '', '', 0, 0, 0, 0, '12', '2020', 1), (168, '46', '4', '6', '', '', 0, 0, 0, 0, '12', '2020', 1), -(173, '48', '1', '2', 'Magelang Utara', 'Kramat Utara', 100000000, 0, 20, 8, '1', '2021', 0), +(173, '48', '1', '2', 'Magelang Utara', 'Kramat Utara', 100000000, 5000000, 20, 8, '1', '2021', 1), (174, '48', '2', '2', 'Magelang Selatan', 'Tidar Selatan', 30000000, 0, 30, 12, '1', '2021', 0), (175, '48', '3', '2', 'Magelang Selatan', 'Rejowinangun Selatan', 5000000, 0, 5, 8, '1', '2021', 0), (176, '48', '4', '6', 'Magelang Tengah', 'Cacaban', 10000000, 0, 3, 6, '1', '2021', 0); @@ -237,6 +237,20 @@ INSERT INTO `tb_laporan` (`id_laporan`, `tahun`, `jml_umkm`, `total_aset`, `tota -- -------------------------------------------------------- +-- +-- Table structure for table `tb_produk` +-- + +CREATE TABLE `tb_produk` ( + `id_produk` bigint(20) NOT NULL, + `foto_produk` text NOT NULL, + `id_umkm` bigint(20) NOT NULL, + `produk` varchar(50) NOT NULL, + `deskripsi` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + -- -- Table structure for table `tb_umkm` -- @@ -264,7 +278,7 @@ CREATE TABLE `tb_umkm` ( -- INSERT INTO `tb_umkm` (`id_umkm`, `id_pemilik`, `nama`, `id_kategori`, `kecamatan`, `kelurahan`, `alamat`, `telp`, `id_jenis`, `omset_awal`, `aset_awal`, `karyawan_l`, `karyawan_p`, `deskripsi`, `foto_umkm`) VALUES -(1, '2', 'Meubel Rotan', 1, 'Magelang Utara', 'Kramat Utara', 'Jl. Jeruk Purut, Kupatan, Kramat Utara, Magelang', '08121212121', 1, 25000000, 100000000, 20, 8, 'Sedia berbagai furnitur dan Meubel', '1.png'), +(1, '2', 'Meubel Rotan', 1, 'Magelang Utara', 'Kramat Utara', 'Jl. Jeruk Purut, Kupatan, Kramat Utara, Magelang', '08121212121', 1, 25000000, 100000000, 20, 8, 'Sedia berbagai furnitur dan Meubel', '1.jpg'), (2, '2', 'Percetakan Jaya Muya', 1, 'Magelang Selatan', 'Tidar Selatan', 'Kiringan III, Tidar Selatan, Kota Magelang', '0811111111', 2, 15000000, 30000000, 30, 12, 'Jasa Reklame, Baliho, Banner dan Printing Sepanduk', 'umkm.png'), (3, '2', 'Frozen Food Magelang', 1, 'Magelang Selatan', 'Rejowinangun Selatan', 'Tanon, Jl. Singosari, Rejowinangun Selatan, Magelang', '08121212121', 2, 12000000, 5000000, 5, 8, 'Reseller Produk makanan beku : Sosis, Daging, Tempura, Nuget, dll', 'umkm.png'), (4, '6', 'Putih Abu Workshop', 1, 'Magelang Tengah', 'Cacaban', 'Cacaban Tengah', '+6233333923', 3, 16000000, 10000000, 3, 6, 'Souvenir Nikah Karakter', 'umkm.png'); @@ -296,7 +310,7 @@ CREATE TABLE `tb_user` ( INSERT INTO `tb_user` (`id_user`, `nama`, `username`, `password`, `alamat_user`, `kecamatan_user`, `kelurahan_user`, `kota_user`, `telp_user`, `npwp`, `foto_user`, `level`) VALUES (1, 'Admin', 'admin', '643ed2bde5b2f6bd70f7f32a9b0f4ebb', 'Kota Magelang', 'Magelang Selatan', '', 'Kota Magelang', '', '', 'user.png', 'admin'), -(2, 'Yoga Ismail Pratama', 'yogaismail', '81dc9bdb52d04dc20036dbd8313ed055', 'Magelang', 'Magelang Selatan', 'Tidar Selatan', 'Kota Magelang', '0812222999383', '6343266', 'user.png', 'pemilik'), +(2, 'Yoga Ismail Pratama', 'yogaismail', '643ed2bde5b2f6bd70f7f32a9b0f4ebb', 'Magelang', 'Magelang Selatan', 'Tidar Selatan', 'Kota Magelang', '0812222999383', '6343266', 'user.png', 'pemilik'), (6, 'Prawira Setia ', 'prawira', '643ed2bde5b2f6bd70f7f32a9b0f4ebb', 'Jambe Wangi', 'Magelang Selatan', 'Kramat Utara', 'Kota Magelang', '082689625495', '', 'user.png', 'pemilik'); -- @@ -343,6 +357,14 @@ ALTER TABLE `tb_kelurahan` ALTER TABLE `tb_laporan` ADD PRIMARY KEY (`id_laporan`); +-- +-- Indexes for table `tb_produk` +-- +ALTER TABLE `tb_produk` + ADD PRIMARY KEY (`id_produk`), + ADD KEY `id_umkm` (`id_umkm`), + ADD KEY `produk` (`produk`); + -- -- Indexes for table `tb_umkm` -- @@ -399,11 +421,17 @@ ALTER TABLE `tb_kelurahan` ALTER TABLE `tb_laporan` MODIFY `id_laporan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; +-- +-- AUTO_INCREMENT for table `tb_produk` +-- +ALTER TABLE `tb_produk` + MODIFY `id_produk` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; + -- -- AUTO_INCREMENT for table `tb_umkm` -- ALTER TABLE `tb_umkm` - MODIFY `id_umkm` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; + MODIFY `id_umkm` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `tb_user`