2021-09-15 21:00:06 +07:00
< ? php
function rupiah ( $angka ){
$hasil_rupiah = " Rp " . number_format ( $angka , 2 , ',' , '.' );
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 = " <?php echo base_url()?>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; " >
2021-09-16 22:54:20 +07:00
< div class = " card " >
2021-09-15 21:00:06 +07:00
< div class = " card-header text-center " >
< img src = " <?php echo base_url()?>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 text-dark 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 bg-primary text-white 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 >
2021-09-16 22:54:20 +07:00
< div class = " col col-md-9 col-lg-9 col-sm-12 col-12 " >
2021-09-15 21:00:06 +07:00
< div class = " card " >
< h5 class = " card-header " > Absensi </ h5 >
< div class = " card-body " >
< div >
< ul class = " nav nav-tabs " >
< li class = " nav-item " >
< a href = " <?php echo base_url('index.php/')?>admin/absensi " class = " nav-link " > Absen Aktif </ a >
</ li >
< li class = " nav-item " >
< a href = " <?php echo base_url('index.php/')?>admin/daftarabsen " class = " nav-link " > Data Absensi </ a >
</ li >
< li class = " nav-item " >
< a href = " <?php echo base_url('index.php/')?>admin/progresabsen " class = " nav-link " > Progres Absensi </ a >
</ li >
< li class = " nav-item " >
< a href = " " class = " nav-link active " >
Detail Umkm > < strong >< ? php echo $bulan . " " . $data_absen -> tahun ?> </strong></a>
</ li >
</ ul >
< div class = " mt-3 " >
< div class = " card " >
< div class = " card-header bg-primary text-white " >
Detail Absensi
</ div >
< div class = " card-body " >
< div class = " row " >
2021-09-16 22:54:20 +07:00
< div class = " col col-md-9 col-lg-9 col-sm-12 col-12 " >
2021-09-15 21:00:06 +07:00
< h3 > Absensi Bulan < ? php echo $bulan ?> Tahun <?php echo $data_absen->tahun ?></h3>
</ div >
< div class = " col text-right " >
< label > status </ label >
< ? php if ( $data_absen -> status_absen == 'open' ){ ?>
< span class = " badge badge-pill badge-success " > Active </ span >
< ? php } else { ?>
< span class = " badge badge-pill badge-secondary " > Inactive </ span >
< ? php } ?>
</ div >
</ div >
< hr >
< div class = " row " >
< div class = " col " >
< div class = " card text-center bg-success text-light " >
< div class = " card-header " >
Jumlah Umkm
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< b >< ? php echo $data_absen -> jumlah_umkm ?> </b></h5>
</ div >
</ div >
</ div >
< div class = " col " >
< div class = " card text-center bg-info text-light " >
< div class = " card-header " >
< ? php echo $nm_kategori1 ?>
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< ? php echo $jml_kategori1 ?> </h5>
</ div >
</ div >
</ div >
< div class = " col " >
< div class = " card text-center bg-warning " >
< div class = " card-header " >
< ? php echo $nm_kategori2 ?>
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< ? php echo $jml_kategori2 ?> </h5>
</ div >
</ div >
</ div >
2021-09-16 22:54:20 +07:00
< div class = " col col-md-3 col-lg-3 col-sm-12 col-12 mt-3 mt-md-0 mt-lg-0 " >
2021-09-15 21:00:06 +07:00
< div class = " card text-center bg-primary text-light " >
< div class = " card-header " >
< ? php echo $nm_kategori3 ?>
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< ? php echo $jml_kategori3 ?> </h5>
</ div >
</ div >
</ div >
</ div >
< label > Progres Absensi </ label >
< div class = " progress " style = " height: 25px; " >
< div class = " progress-bar progress-bar-striped bg-success " role = " progressbar " style = " width: <?php echo $prosentase_signed_absensi ?>% " aria - valuenow = " <?php echo $signed_absensi ?> " aria - valuemin = " 0 " aria - valuemax = " <?php echo $data_absen->jumlah_umkm ?> " >< ? php echo $signed_absensi ?> </div>
< div class = " progress-bar progress-bar-striped bg-secondary " role = " progressbar " style = " width: <?php echo $prosentase_unsigned_absensi ?>% " aria - valuenow = " <?php echo $unsigned_absensi ?> " aria - valuemin = " 0 " aria - valuemax = " <?php echo $data_absen->jumlah_umkm ?> " >< ? php echo $unsigned_absensi ?> </div>
</ div >
< div class = " mt-1 mb-2 " >
< span class = " badge badge-success " > Sudah Absen </ span >
< span class = " badge badge-secondary ml-2 " > Belum Absen </ span >
</ div >
< div class = " row " >
< div class = " col " >
< div class = " card text-center " >
< div class = " card-header bg-success text-light " >
Aset Bulan ini
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< ? php echo rupiah ( $data_absen -> aset ) ?> </h5>
</ div >
</ div >
</ div >
< div class = " col " >
< div class = " card text-center " >
< div class = " card-header bg-success text-light " >
Omset Bulan ini
</ div >
< div class = " card-body " >
< h5 class = " card-title " >< ? php echo rupiah ( $data_absen -> omset ) ?> </h5>
</ div >
</ div >
</ div >
</ div >
< div class = " row mt-3 " >
< div class = " col col-md-12 mb-2 " >
< div class = " card text-center " >
< div class = " card-header bg-primary text-light " >
Sudah Absen
</ div >
< div class = " card-body " >
2021-09-16 22:54:20 +07:00
< table id = " tabeldata " class = " table table-striped table-bordered table-responsive-lg " >
2021-09-15 21:00:06 +07:00
< thead >
< tr >
< th > No </ th >
< th > Umkm </ th >
< th > Omset </ th >
< th > Aset </ th >
< th > Opsi </ th >
</ tr >
</ thead >
< tbody >
< ? php
$no = 0 ;
foreach ( $data_signed_absensi as $signed_absensi ) {
$no ++ ;
?>
< tr >
< td >< ? php echo $no ?> </td>
< td >< ? php echo $signed_absensi -> nama ?> </td>
< td >< ? php echo rupiah ( $signed_absensi -> omset ) ?> </td>
< td >< ? php echo rupiah ( $signed_absensi -> aset ) ?> </td>
< td >< a target = " _blank " href = " <?php echo base_url('index.php/')?>admin/detailumkm?id_umkm=<?php echo $signed_absensi->id_umkm ?> " class = " btn btn-block btn-info btn-sm " > Detail </ a ></ td >
</ tr >
< ? php
}
?>
</ tbody >
</ table >
</ div >
</ div >
</ div >
< div class = " col col-md-12 " >
< div class = " card text-center " >
< div class = " card-header bg-danger text-light " >
Belum Absen
</ div >
< div class = " card-body " >
2021-09-16 22:54:20 +07:00
< table id = " tabeldata2 " class = " table table-striped table-bordered table-responsive-lg " >
2021-09-15 21:00:06 +07:00
< thead >
< tr >
< th > No </ th >
< th > Umkm </ th >
< th > Opsi </ th >
</ tr >
</ thead >
< tbody >
< ? php
$no = 0 ;
foreach ( $data_unsigned_absensi as $unsigned_absensi ) {
$no ++ ;
?>
< tr >
< td >< ? php echo $no ?> </td>
< td >< ? php echo $unsigned_absensi -> nama ?> </td>
< td >< a target = " _blank " href = " <?php echo base_url('index.php/')?>admin/detailumkm?id_umkm=<?php echo $unsigned_absensi->id_umkm ?> " class = " btn btn-block btn-info btn-sm " > Detail </ a ></ td >
</ tr >
< ? php
}
?>
</ tbody >
</ table >
</ div >
</ div >
</ div >
</ div >
</ div >
</ div >
</ 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 ();
} );
$ ( document ) . ready ( function () {
$ ( '#tabeldata2' ) . DataTable ();
} );
</ script >
< script >
const element = document . querySelectorAll ( '#btn_hapus' )
element . forEach ( function ( el ){
el . addEventListener ( 'click' , function ( e ) {
e . preventDefault ();
var urlToRedirect = e . currentTarget . getAttribute ( 'href' ); //use currentTarget because the click may be on the nested i tag and not a tag causing the href to be empty
console . log ( urlToRedirect ); // verify if this is the right URL
swal ({
title : " Kamu yakin ? " ,
text : " Data yang dihapus tidak bisa dikembalikan. " ,
icon : " warning " ,
buttons : [
'Batal' ,
'Hapus'
],
dangerMode : true ,
}) . then ( function ( isConfirm ) {
if ( isConfirm ) {
swal ({
title : 'Berhasil' ,
text : 'Data berhasil terhapus' ,
icon : 'success'
}) . then ( function () {
window . location . href = urlToRedirect ;
});
} else {
swal ( " Batal " , " Data tidak terhapus.) " , " error " );
}
});
});
});
</ script >
</ body >
</ html >