From 8da0a691765377df61f1e43965b5c08c756e187d Mon Sep 17 00:00:00 2001 From: hafidz Date: Thu, 16 Sep 2021 22:54:20 +0700 Subject: [PATCH] Fix Responsive View Issue and Some Bugs --- application/controllers/admin/TambahAbsen.php | 15 ++-- application/controllers/user/DetailUmkm.php | 69 +++++++++++-------- application/models/AbsensiModel.php | 6 ++ application/views/admin/absensi.php | 8 +-- application/views/admin/daftarabsen.php | 6 +- application/views/admin/dashboard.php | 4 +- application/views/admin/detailabsen.php | 12 ++-- application/views/admin/detailpemilik.php | 10 +-- application/views/admin/detailumkm.php | 28 ++++---- application/views/admin/editpemilik.php | 18 ++--- application/views/admin/editumkm.php | 18 ++--- application/views/admin/progresabsen.php | 6 +- application/views/admin/resetpasspemilik.php | 8 +-- application/views/admin/setting.php | 8 +-- application/views/admin/tambahabsen.php | 2 +- application/views/admin/tambahpemilik.php | 10 +-- application/views/admin/tambahumkm.php | 12 ++-- application/views/admin/umkm.php | 20 ++---- application/views/user/dashboard.php | 22 ++---- application/views/user/detailumkm.php | 33 ++++----- application/views/user/editumkm.php | 16 ++--- application/views/user/produk.php | 22 +++--- application/views/user/riwayatabsensi.php | 22 +++--- application/views/user/tambahproduk.php | 26 +++---- 24 files changed, 200 insertions(+), 201 deletions(-) diff --git a/application/controllers/admin/TambahAbsen.php b/application/controllers/admin/TambahAbsen.php index 88e4b96..4bafd05 100644 --- a/application/controllers/admin/TambahAbsen.php +++ b/application/controllers/admin/TambahAbsen.php @@ -98,10 +98,17 @@ class TambahAbsen extends CI_Controller { foreach($daftarumkm as $umkm){ if($bulan_absen!=='1'){ - $latestabsensi = $this->AbsensiModel->getLatestAbsensi($post['bulan'],$post['tahun'],$umkm->id_umkm); - $aset_absensi= $latestabsensi->aset; - $karyawan_absensi_l = $latestabsensi->karyawan_l; - $karyawan_absensi_p = $latestabsensi->karyawan_p; + if(count($this->AbsensiModel->getLatestAbsensi($post['bulan'],$post['tahun'],$umkm->id_umkm))>0){ + $latestabsensi = $this->AbsensiModel->getLatestAbsensi($post['bulan'],$post['tahun'],$umkm->id_umkm); + $aset_absensi= $latestabsensi->aset; + $karyawan_absensi_l = $latestabsensi->karyawan_l; + $karyawan_absensi_p = $latestabsensi->karyawan_p; + } else{ + $aset_absensi= $umkm->aset_awal; + $karyawan_absensi_l= $umkm->karyawan_l; + $karyawan_absensi_p= $umkm->karyawan_p; + } + } else { $aset_absensi= $umkm->aset_awal; $karyawan_absensi_l= $umkm->karyawan_l; diff --git a/application/controllers/user/DetailUmkm.php b/application/controllers/user/DetailUmkm.php index bb793b1..dc31b79 100644 --- a/application/controllers/user/DetailUmkm.php +++ b/application/controllers/user/DetailUmkm.php @@ -76,37 +76,48 @@ class DetailUmkm extends CI_Controller { 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'; + if($this->AbsensiModel->getCountAbsensiByAbsenIdAndUmkmId($umkm->id_umkm,$data['data_absen']->id_absen)>0){ + 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; + + + $absenisi = $this->AbsensiModel->getAbsensiByAbsenIdAndUmkmId($umkm->id_umkm,$data['data_absen']->id_absen); + + $data['absenisiaktif'] = $absenisi; + $data['signed']=$absenisi->signed; + } else { + + $data['active_absen'] = false; + $data['data_absen'] = ''; } - $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; } diff --git a/application/models/AbsensiModel.php b/application/models/AbsensiModel.php index b981db1..1a917d8 100644 --- a/application/models/AbsensiModel.php +++ b/application/models/AbsensiModel.php @@ -16,6 +16,12 @@ class AbsensiModel extends CI_Model return $absensi = $this->db->get($this->_table)->row(); } + public function getCountAbsensiByAbsenIdAndUmkmId($id_umkm,$id_absen){ + $this->db->where('id_absen', $id_absen); + $this->db->where('id_umkm', $id_umkm); + return $absensi = count($this->db->get($this->_table)->result()); + } + public function update($id_absensi){ $post = $this->input->post(); $this->aset = $post["aset"]; diff --git a/application/views/admin/absensi.php b/application/views/admin/absensi.php index cf72ae8..51f900a 100644 --- a/application/views/admin/absensi.php +++ b/application/views/admin/absensi.php @@ -48,7 +48,7 @@
-
+

nama ?> @@ -72,7 +72,7 @@
-
+
Absensi
@@ -100,7 +100,7 @@
-
+

Absensi Bulan Tahun tahun ?>

@@ -140,7 +140,7 @@
-
+
diff --git a/application/views/admin/daftarabsen.php b/application/views/admin/daftarabsen.php index 25a540c..fc6059d 100644 --- a/application/views/admin/daftarabsen.php +++ b/application/views/admin/daftarabsen.php @@ -47,7 +47,7 @@
-
+

nama ?> @@ -71,7 +71,7 @@
-
+
Absensi
@@ -135,7 +135,7 @@
- +
diff --git a/application/views/admin/dashboard.php b/application/views/admin/dashboard.php index 9060f65..d7307da 100644 --- a/application/views/admin/dashboard.php +++ b/application/views/admin/dashboard.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -89,7 +89,7 @@ -
Bln
+
diff --git a/application/views/admin/detailabsen.php b/application/views/admin/detailabsen.php index f7f5cbc..33e9587 100644 --- a/application/views/admin/detailabsen.php +++ b/application/views/admin/detailabsen.php @@ -47,7 +47,7 @@
-
+

nama ?> @@ -71,7 +71,7 @@
-
+
Absensi
@@ -102,7 +102,7 @@
-
+

Absensi Bulan Tahun tahun ?>

@@ -146,7 +146,7 @@
-
+
@@ -196,7 +196,7 @@ Sudah Absen
-
No
+
@@ -239,7 +239,7 @@ Belum Absen
-
No
+
diff --git a/application/views/admin/detailpemilik.php b/application/views/admin/detailpemilik.php index 737b86b..4ff0b61 100644 --- a/application/views/admin/detailpemilik.php +++ b/application/views/admin/detailpemilik.php @@ -39,7 +39,7 @@
-
+

nama ?> @@ -63,7 +63,7 @@
-
+
Pemilik UMKM
@@ -88,7 +88,7 @@
-
+

nama?>
@@ -98,7 +98,7 @@
-
+
NPWP
:
@@ -143,7 +143,7 @@
-
No
+
diff --git a/application/views/admin/detailumkm.php b/application/views/admin/detailumkm.php index f89ddc3..58a5904 100644 --- a/application/views/admin/detailumkm.php +++ b/application/views/admin/detailumkm.php @@ -50,7 +50,7 @@
-
+

nama ?> @@ -74,7 +74,7 @@
-
+
Data UMKM
@@ -94,7 +94,7 @@
-
+

nama?>
@@ -106,7 +106,7 @@
-
+
DATA TERKINI
@@ -133,9 +133,9 @@
-
+
-
+
ASET TERAKHIR
@@ -150,7 +150,7 @@
-
+
No Telp
@@ -183,16 +183,16 @@
-
+
-
+
Alamat
-
+
Deskripsi
@@ -217,14 +217,15 @@
-
No
+
- + + @@ -266,7 +267,8 @@ - + +
-
+

nama ?> @@ -63,7 +63,7 @@
-
+
Pemilik UMKM
@@ -117,14 +117,14 @@ } } ?> -
-
- +
+
+
-
+
- +
@@ -137,7 +137,7 @@
-
+
@@ -163,7 +163,7 @@
-
+

diff --git a/application/views/admin/editumkm.php b/application/views/admin/editumkm.php index ebb0f3a..4ef701a 100644 --- a/application/views/admin/editumkm.php +++ b/application/views/admin/editumkm.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -64,7 +64,7 @@
-
+
Data UMKM
@@ -114,14 +114,14 @@ } } ?> -
+
- +
-
+
- +
@@ -139,7 +139,7 @@
-
+
@@ -167,7 +167,7 @@
-
+
-
+

diff --git a/application/views/admin/progresabsen.php b/application/views/admin/progresabsen.php index 4748baf..7c793c6 100644 --- a/application/views/admin/progresabsen.php +++ b/application/views/admin/progresabsen.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -64,7 +64,7 @@
-
+
Absensi
@@ -107,7 +107,7 @@
-
+
getAbsenCountByYear($tahun->tahun); $prosentaseabsen = ($jumlahabsen/12)*100; diff --git a/application/views/admin/resetpasspemilik.php b/application/views/admin/resetpasspemilik.php index aa96f79..95c551d 100644 --- a/application/views/admin/resetpasspemilik.php +++ b/application/views/admin/resetpasspemilik.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -64,7 +64,7 @@
-
+
Pemilik UMKM
@@ -118,7 +118,7 @@ } } ?> -
+
@@ -129,7 +129,7 @@
-
+

diff --git a/application/views/admin/setting.php b/application/views/admin/setting.php index c31a597..867a6c7 100644 --- a/application/views/admin/setting.php +++ b/application/views/admin/setting.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -64,7 +64,7 @@
-
+
Setting User
@@ -100,7 +100,7 @@ } } ?> -
+
@@ -111,7 +111,7 @@
-
+

diff --git a/application/views/admin/tambahabsen.php b/application/views/admin/tambahabsen.php index f1e3d7a..1fcab87 100644 --- a/application/views/admin/tambahabsen.php +++ b/application/views/admin/tambahabsen.php @@ -52,7 +52,7 @@
-
+

nama ?> diff --git a/application/views/admin/tambahpemilik.php b/application/views/admin/tambahpemilik.php index cdf8c13..e129b79 100644 --- a/application/views/admin/tambahpemilik.php +++ b/application/views/admin/tambahpemilik.php @@ -39,7 +39,7 @@
-
+

nama ?> @@ -63,7 +63,7 @@
-
+
Pemilik UMKM
@@ -108,7 +108,7 @@ } } ?> -
+
@@ -134,7 +134,7 @@
-
+
@@ -162,7 +162,7 @@
-
+

diff --git a/application/views/admin/tambahumkm.php b/application/views/admin/tambahumkm.php index e7d10e8..8d8965f 100644 --- a/application/views/admin/tambahumkm.php +++ b/application/views/admin/tambahumkm.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -64,7 +64,7 @@
-
+
Pemilik UMKM
@@ -119,7 +119,7 @@ } } ?> -
+
@@ -146,7 +146,7 @@
-
+
@@ -176,7 +176,7 @@
-
+
@@ -192,7 +192,7 @@
-
+

diff --git a/application/views/admin/umkm.php b/application/views/admin/umkm.php index cb0084d..536419f 100644 --- a/application/views/admin/umkm.php +++ b/application/views/admin/umkm.php @@ -16,18 +16,6 @@ Aplikasi UMKM - @@ -54,7 +42,7 @@
-
+

nama ?> @@ -78,7 +66,7 @@
-
+
Data UMKM
@@ -89,7 +77,7 @@ -
+
@@ -98,7 +86,7 @@ -
Tahun Bulan Aset Terkini Omset Bulan IniJumlah KaryawanTenaga Kerja (L)Tenaga Kerja (P)
aset) ?> omset) ?>karyawan ?>karyawan_l ?>karyawan_p ?>
+
diff --git a/application/views/user/dashboard.php b/application/views/user/dashboard.php index d6e25ac..9f5fca0 100644 --- a/application/views/user/dashboard.php +++ b/application/views/user/dashboard.php @@ -15,19 +15,7 @@ Aplikasi UMKM - - + @@ -54,7 +42,7 @@
-
+

nama ?> @@ -69,7 +57,7 @@
-
+
Daftar UMKM
@@ -80,7 +68,7 @@ -
+
@@ -89,7 +77,7 @@ -
No
+
diff --git a/application/views/user/detailumkm.php b/application/views/user/detailumkm.php index 2921b4e..9fd87f6 100644 --- a/application/views/user/detailumkm.php +++ b/application/views/user/detailumkm.php @@ -50,7 +50,7 @@
-
+

nama ?> @@ -65,7 +65,7 @@
-
+
Data UMKM
@@ -85,14 +85,14 @@
-
+

nama?>
-
+
DATA TERKINI
@@ -119,7 +119,7 @@
-
+
ASET TERAKHIR @@ -131,12 +131,12 @@
-
+

-
+
No Telp
@@ -169,7 +169,7 @@
-
+
Alamat
@@ -186,7 +186,7 @@
-
+

-
+
Absen Aktif @@ -214,11 +214,11 @@
-
+
Bulan Tahun tahun ?>
- signed==1){?> + Sudah Absen Belum Absen @@ -248,7 +248,7 @@ } } ?> -
+
@@ -260,7 +260,7 @@
-
+
@@ -273,7 +273,7 @@
-
+

@@ -290,9 +290,6 @@ -
diff --git a/application/views/user/editumkm.php b/application/views/user/editumkm.php index 2fe41f0..37736a1 100644 --- a/application/views/user/editumkm.php +++ b/application/views/user/editumkm.php @@ -40,7 +40,7 @@
-
+

nama ?> @@ -55,7 +55,7 @@
-
+
Data UMKM
@@ -105,14 +105,14 @@ } } ?> -
-
+
+
-
+
- +
@@ -121,7 +121,7 @@
-
+
No
+
diff --git a/application/views/user/riwayatabsensi.php b/application/views/user/riwayatabsensi.php index bf7508e..e12dd08 100644 --- a/application/views/user/riwayatabsensi.php +++ b/application/views/user/riwayatabsensi.php @@ -50,7 +50,7 @@
-
+

nama ?> @@ -65,7 +65,7 @@
-
+
Data UMKM
@@ -85,14 +85,14 @@
-
+

nama?>
-
+
DATA TERKINI
@@ -119,7 +119,7 @@
-
+
ASET TERAKHIR @@ -131,12 +131,12 @@
-
+

-
+
No Telp
@@ -169,7 +169,7 @@
-
+
Alamat
@@ -186,7 +186,7 @@
-
+

-
-
Produk
+
+
diff --git a/application/views/user/tambahproduk.php b/application/views/user/tambahproduk.php index 4f3751d..ef7f9f9 100644 --- a/application/views/user/tambahproduk.php +++ b/application/views/user/tambahproduk.php @@ -51,7 +51,7 @@
-
+

nama ?> @@ -66,7 +66,7 @@
-
+
Data UMKM
@@ -86,14 +86,14 @@
-
+

nama?>
-
+
DATA TERKINI
@@ -120,7 +120,7 @@
-
+
ASET TERAKHIR @@ -132,12 +132,12 @@
-
+

-
+
No Telp
@@ -170,7 +170,7 @@
-
+
Alamat
@@ -187,7 +187,7 @@
-
+

-
+
Tambah Produk @@ -225,7 +225,7 @@ -
+
-
+
@@ -267,7 +267,7 @@
-
+

Tahun