Add anual report feature
parent
8da0a69176
commit
cd74f850b0
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Produk extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
$this->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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class TutupTahun extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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!";
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class ResetPassword extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Setting extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -175,7 +175,13 @@
|
|||
<?php foreach($listkelurahan as $kelurahan){?>
|
||||
<option value="<?php echo $kelurahan->kelurahan?>" <?php if($kelurahan->kelurahan==$umkm->kelurahan){ echo "selected";}?>><?php echo $kelurahan->kelurahan?></option>
|
||||
<?php } ?>
|
||||
<option value="luar" <?php if($umkm->kelurahan=='Luar Kota Magelang'){ echo "selected";}?>>Luar Kota Magelang</option>
|
||||
<?php
|
||||
if($umkm->kelurahan=='Luar Kota Magelang'){
|
||||
?>
|
||||
<option value="luar" selected>Luar Kota Magelang</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,281 @@
|
|||
<?php
|
||||
function rupiah($angka){
|
||||
|
||||
$hasil_rupiah = "Rp " . number_format($angka,0,',','.');
|
||||
return $hasil_rupiah;
|
||||
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
|
||||
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
|
||||
|
||||
<title>Aplikasi UMKM</title>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="../../assets/images/logo-white.png" width="100" alt="">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
<form methode="POST" action="../login/logout" class="form-inline my-2 my-lg-0" >
|
||||
<button class="btn btn-outline-warning btn-sm my-2 my-sm-0" type="submit">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="cursor:pointer;">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<img src="../../assets/images/<?php echo $user_logged->foto_user ?>" width="125" /><br>
|
||||
<strong><?php echo $user_logged->nama ?></strong>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<a href="<?php echo base_url('index.php/')?>admin/dashboard" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark border-bottom">Data Pemilik UMKM</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>admin/umkm" style="text-decoration:none;">
|
||||
<li class="list-group-item bg-primary text-white border-bottom">Data UMKM</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>admin/absensi" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark border-bottom">Absensi</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>admin/laporan" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark border-bottom">Laporan</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>admin/setting" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark">Setting</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-sm-12" >
|
||||
<div class="card">
|
||||
<h5 class="card-header">Data UMKM</h5>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>admin/umkm" class="nav-link">Daftar UMKM</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="" class="nav-link active">
|
||||
Detail Umkm > <strong><?php echo $umkm->nama ?></strong></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<form action="" class="needs-validation">
|
||||
<div class="row pr-2">
|
||||
<div class="col col-md-4 col-sm-12 col-12 pt-4">
|
||||
<div class="form-group text-center">
|
||||
<img src="../../assets/images/umkm/<?php echo $umkm->foto_umkm ?>" width="100" class="mb-2" /><br>
|
||||
<strong><?php echo $umkm->nama?></strong><br>
|
||||
<span>Pemilik :</span><br>
|
||||
<a target="_blank" href="<?php echo base_url('index.php/')?>admin/detailpemilik?id_user=<?php echo $pemilik->id_user ?>">
|
||||
<span class="badge badge-pill badge-info">
|
||||
<?php echo $pemilik->nama?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-8 col-sm-12 col-12">
|
||||
<div class="row pt-1 ml-2 mb-0 pb-0">
|
||||
<strong>DATA TERKINI</strong>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col col-md-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-header text-light bg-success">
|
||||
TENAGA KERJA
|
||||
</div>
|
||||
<div class="card-body text-left">
|
||||
<span class="badge badge-secondary">Laki-laki : <?php echo $karyawan_l?></span><br>
|
||||
<span class="badge badge-secondary">Perempuan : <?php echo $karyawan_p?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-header bg-warning">
|
||||
OMSET TAHUNAN
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6><?php echo rupiah($omset) ?></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-4 col-12 col-sm-12 mt-3 mt-md-0 mt-lg-0">
|
||||
<div class="card text-center">
|
||||
<div class="card-header text-light bg-info">
|
||||
ASET TERAKHIR
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6><?php echo rupiah($aset) ?></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-12">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pr-2">
|
||||
<div class="col col-md-6 col-12 col-lg-6 col-sm-12">
|
||||
|
||||
<div class="row pb-2 pl-3">
|
||||
<div class="col col-md-4 pl-2 pr-2">No Telp</div>
|
||||
<div class="col col-md-1 pl-2 pr-2">:</div>
|
||||
<div class="col col-md-7 pl-2 pr-2"><?php echo $umkm->telp?></div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-2 pl-3">
|
||||
<div class="col col-md-4 pl-2 pr-2">Kategori</div>
|
||||
<div class="col col-md-1 pl-2 pr-2">:</div>
|
||||
<div class="col col-md-7 pl-2 pr-2"><?php echo $umkm->kategori?></div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-2 pl-3">
|
||||
<div class="col col-md-4 pl-2 pr-2">Jenis</div>
|
||||
<div class="col col-md-1 pl-2 pr-2">:</div>
|
||||
<div class="col col-md-7 pl-2 pr-2"><?php echo $umkm->jenis?></div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-2 pl-3">
|
||||
<div class="col col-md-4 pl-2 pr-2">Kelurahan</div>
|
||||
<div class="col col-md-1 pl-2 pr-2">:</div>
|
||||
<div class="col col-md-7 pl-2 pr-2"><?php echo $umkm->kelurahan?></div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-2 pl-3">
|
||||
<div class="col col-md-4 pl-2 pr-2">Kecamatan</div>
|
||||
<div class="col col-md-1 pl-2 pr-2">:</div>
|
||||
<div class="col col-md-7 pl-2 pr-2"><?php echo $umkm->kecamatan?></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col col-md-6 col-12 col-lg-6 col-sm-12">
|
||||
|
||||
<div class="row pb-2 pl-2">
|
||||
<div class="col col-md-12">Alamat</div>
|
||||
<div class="col col-md-12">
|
||||
<textarea class="form-control" rows="1" disabled><?php echo $umkm->alamat?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-2 pl-2">
|
||||
<div class="col col-md-12">Deskripsi</div>
|
||||
<div class="col col-md-12">
|
||||
<textarea class="form-control" rows="2" disabled><?php echo $umkm->deskripsi?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col col-md-12">
|
||||
<hr>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>admin/detailumkm?id_umkm=<?php echo $umkm->id_umkm ?>" class="nav-link active">Absensi</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>admin/produk?id_umkm=<?php echo $umkm->id_umkm ?>" class="nav-link">Produk</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col col-12">
|
||||
<table id="tabeldata" class="table table-striped table-bordered table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Foto</th>
|
||||
<th>Produk</th>
|
||||
<th>Deskripsi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($daftarproduk as $produk) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="../../assets/images/produk/<?php echo $produk->foto_produk ?>" width="80" class="img-thumbnail" /><br>
|
||||
</td>
|
||||
<td><?php echo $produk->produk?></td>
|
||||
<td><?php echo $produk->deskripsi?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- next -->
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tabeldata').DataTable();
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -83,6 +83,16 @@
|
|||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<?php
|
||||
if (isset($msg)){
|
||||
if($msg=='error!'){
|
||||
?>
|
||||
<div class="alert alert-danger" role="alert">Tidak bisa membuat laporan tahun <strong><?php echo $tahun_laporan ?></strong>
|
||||
, kerena absen belum lengkap 12 bulan</div>
|
||||
<?php }elseif($msg=='sucess'){ ?>
|
||||
<div class="alert alert-success" role="alert">Laporan tahun <strong><?php echo $tahun_laporan ?></strong> berhasil dibuat !</div>
|
||||
<?php } }?>
|
||||
|
||||
<?php foreach($tahun_list as $tahun) {?>
|
||||
<div class="mb-3">
|
||||
<div class="card">
|
||||
|
@ -125,7 +135,7 @@
|
|||
<div class="col col-md-2 d-flex align-items-center text-center">
|
||||
<btn class="btn btn-sm btn-inline btn-<?php echo $bg_warning?> mr-2" type="button" data-toggle="collapse" data-target="#detailabsen<?php echo $tahun->tahun?>" aria-expanded="false" aria-controls="detailabsen<?php echo $tahun->tahun?>">Detail</btn>
|
||||
<?php if($jumlahlaporantahunan<1){?>
|
||||
<button id="btn_close" class="btn btn-sm btn-inline btn-danger">Close</button>
|
||||
<a href="<?php echo base_url('index.php/')?>admin/tutuptahun?tahun=<?php echo $tahun->tahun?>" id="btn_close" class="btn btn-sm btn-inline btn-danger">Close</a>
|
||||
<?php } else { ?>
|
||||
<button class="btn btn-sm btn-inline btn-secondary" disabled>Close</button>
|
||||
<?php } ?>
|
||||
|
|
|
@ -166,7 +166,6 @@
|
|||
<?php foreach($listkelurahan as $kelurahan){?>
|
||||
<option value="<?php echo $kelurahan->kelurahan?>"><?php echo $kelurahan->kelurahan?></option>
|
||||
<?php } ?>
|
||||
<option value="luar">Luar Kota Magelang</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
return $hasil_rupiah;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
@ -206,22 +207,24 @@
|
|||
|
||||
<div class="row mt-2">
|
||||
<?php
|
||||
|
||||
if (isset($del_msg)){
|
||||
if($del_msg=='error'){
|
||||
?>
|
||||
<div class="alert alert-danger" role="alert">Tidak bisa menghapus <strong><?php echo $del_pemilik ?></strong>
|
||||
<div class="col col-12 alert alert-danger" role="alert">Tidak bisa menghapus <strong><?php echo $del_pemilik ?></strong>
|
||||
, kerena terdapat data UMKM yang terkait !</div>
|
||||
<?php } elseif($del_msg=='sucess'){ ?>
|
||||
<div class="alert alert-success" role="alert">Data berhasil terhapus !</div>
|
||||
<?php } elseif($del_msg=='success'){ ?>
|
||||
<div class="col col-12 alert alert-success" role="alert">Data berhasil terhapus !</div>
|
||||
<?php }}?>
|
||||
<div class="col col-12">
|
||||
<a href="<?php echo base_url('index.php/')?>user/tambahproduk?id_umkm=<?php echo $umkm->id_umkm ?>" class="btn btn-sm btn-success mb-3">Tambah Produk</a>
|
||||
<table id="tabeldata" class="table table-striped table-bordered table-responsive-lg">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Produk</th>
|
||||
<th>Foto</th>
|
||||
<th>Produk</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Opsi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
|
||||
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
|
||||
|
||||
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
|
||||
|
||||
<title>Aplikasi UMKM</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="../../assets/images/logo-white.png" width="100" alt="">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
<form methode="POST" action="../login/logout" class="form-inline my-2 my-lg-0" >
|
||||
<button class="btn btn-outline-warning btn-sm my-2 my-sm-0" type="submit">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="cursor:pointer;">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<img src="../../assets/images/<?php echo $user_logged->foto_user ?>" width="125" /><br>
|
||||
<strong><?php echo $user_logged->nama ?></strong>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<a href="<?php echo base_url('index.php/')?>user/dashboard" style="text-decoration:none;">
|
||||
<li class="list-group-item border-bottom text-light active">Daftar UMKM</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>user/setting" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark">Setting</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-9 col-12 col-sm-12 col-lg-9" >
|
||||
<div class="card">
|
||||
<h5 class="card-header">Setting</h5>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>user/setting" class="nav-link">Update Profile</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>user/resetpassword" class="nav-link active">Ganti Password</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<form action="" method="POST" class="needs-validation" oninput='password2.setCustomValidity(password2.value != password.value ? "Passwords do not match." : "")'>
|
||||
|
||||
<div class="row">
|
||||
<?php
|
||||
if(isset($_GET['msg'])){
|
||||
$msg = $_GET['msg'];
|
||||
}
|
||||
if(isset($msg)){
|
||||
if($msg=='success'){
|
||||
?>
|
||||
<div class="col col-md-12">
|
||||
<div class="alert alert-success" role="alert">Password berhasil direset !</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
|
||||
?>
|
||||
<div class="col col-md-12">
|
||||
<div class="alert alert-danger" role="alert">Gagal, password tidak berganti !</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="col col-12">
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" class="form-control" id="password" placeholder="Password" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password2">Confrim Password</label>
|
||||
<input type="password" name="password2" class="form-control" id="password2" placeholder="Confirm Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-12 text-right">
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tabeldata').DataTable();
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,185 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/dataTables.bootstrap4.min.css">
|
||||
<link data-require="sweet-alert@*" data-semver="0.4.2" rel="stylesheet" href="<?php echo base_url()?>assets/css/sweetalert.min.css" />
|
||||
|
||||
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
|
||||
|
||||
<title>Aplikasi UMKM</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="../../assets/images/logo-white.png" width="100" alt="">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
<form methode="POST" action="../login/logout" class="form-inline my-2 my-lg-0" >
|
||||
<button class="btn btn-outline-warning btn-sm my-2 my-sm-0" type="submit">Logout</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="cursor:pointer;">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<img src="../../assets/images/<?php echo $user_logged->foto_user ?>" width="125" /><br>
|
||||
<strong><?php echo $user_logged->nama ?></strong>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<a href="<?php echo base_url('index.php/')?>user/dashboard" style="text-decoration:none;">
|
||||
<li class="list-group-item border-bottom text-light active">Daftar UMKM</li>
|
||||
</a>
|
||||
<a href="<?php echo base_url('index.php/')?>user/setting" style="text-decoration:none;">
|
||||
<li class="list-group-item text-dark">Setting</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-9 col-12 col-sm-12 col-lg-9" >
|
||||
<div class="card">
|
||||
<h5 class="card-header">Setting</h5>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>user/setting" class="nav-link active">Update Profile</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="<?php echo base_url('index.php/')?>user/resetpassword" class="nav-link">Ganti Password</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<form action="" method="POST" enctype="multipart/form-data" class="needs-validation">
|
||||
|
||||
<div class="row">
|
||||
<?php
|
||||
if(isset($error_upload)){
|
||||
?>
|
||||
<div class="col col-md-12">
|
||||
<div class="alert alert-danger" role="alert">Error : <?php echo $error_upload ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if(isset($_GET['msg'])){
|
||||
$msg = $_GET['msg'];
|
||||
}
|
||||
if(isset($msg)){
|
||||
if($msg=='success'){
|
||||
?>
|
||||
<div class="col col-md-12">
|
||||
<div class="alert alert-success" role="alert">Data berhasil tersimpan !</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
|
||||
?>
|
||||
<div class="col col-md-12">
|
||||
<div class="alert alert-danger" role="alert">Gagal, Data sudah ada !</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="col col-md-6 col-12 col-sm-12 col-lg-6">
|
||||
<div class="form-group text-center">
|
||||
<img src="../../assets/images/<?php echo $pemilik->foto_user ?>" width="110" class="img img-thumbnail mt-3" />
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<label for="foto_user">Ganti Foto Pemilik UMKM</label>
|
||||
<input type="file" accept=".jpg,.jpeg,.png,.gif" name="foto_user" class="form-control-file mt-2" id="foto_user">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="namalengkap">Nama Lengkap</label>
|
||||
<input type="text" class="form-control" id="namalengkap" value="<?php echo $pemilik->nama ?>" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="telp">No Telp</label>
|
||||
<input type="text" name="telp" class="form-control" id="telp" value="<?php echo $pemilik->telp_user ?>" placeholder="No Telp" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-6 col-12 col-sm-12 col-lg-6">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="kelurahan">Kelurahan</label>
|
||||
<select name="kelurahan" class="form-control" id="kelurahan" required>
|
||||
<option value="">--Pilih Kelurahan--</option>
|
||||
<?php foreach($listkelurahan as $kelurahan){ ?>
|
||||
<option value="<?php echo $kelurahan->kelurahan ?>" <?php if($pemilik->kelurahan_user == $kelurahan->kelurahan){ echo "selected";}?>><?php echo $kelurahan->kelurahan ?></option>
|
||||
<?php } ?>
|
||||
<option value="luar" <?php if($pemilik->kelurahan_user=='Luar Kota Magelang'){ echo "selected";}?>>Luar Kota Magelang</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-1">
|
||||
<label for="alamat">Alamat</label>
|
||||
<textarea name="alamat" class="form-control" id="alamat" rows="6" placeholder="Alamat lengkap.." required><?php echo $pemilik->alamat_user?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-1">
|
||||
<label for="npwp">NPWP</label>
|
||||
<input type="text" name="npwp" class="form-control" id="npwp" value="<?php echo $pemilik->npwp?>" placeholder="No NPWP">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col col-md-12 col-12 col-sm-12 col-lg-6 text-right">
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="<?php echo base_url()?>assets/js/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?php echo base_url()?>assets/js/sweetalert.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tabeldata').DataTable();
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Loading…
Reference in New Issue