Public landing page done

This commit is contained in:
2021-09-21 15:19:35 +07:00
parent ef7a10356f
commit 5e94f90ac1
17 changed files with 3385 additions and 239 deletions

View File

@@ -0,0 +1,474 @@
<?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-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan <span class="sr-only">(current)</span></a>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<?php
if($bulan==1){
$bulantext = 'Januari';
}elseif($bulan==1){
$bulantext = 'Februari';
}elseif($bulan==2){
$bulantext = 'Februari';
}elseif($bulan==3){
$bulantext = 'Maret';
}elseif($bulan==4){
$bulantext = 'April';
}elseif($bulan==5){
$bulantext = 'Mei';
}elseif($bulan==6){
$bulantext = 'Juni';
}elseif($bulan==7){
$bulantext = 'Julai';
}elseif($bulan==8){
$bulantext = 'Agustus';
}elseif($bulan==9){
$bulantext = 'September';
}elseif($bulan==10){
$bulantext = 'Oktober';
}elseif($bulan==11){
$bulantext = 'November';
}elseif($bulan==12){
$bulantext = 'Desember';
}
?>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="bulan">Pilih Bulan</label>
<select name="bulan" class="form-control" id="bulan" onchange="this.form.submit()" required>
<?php foreach($bulan_list as $list) {?>
<option value="<?php echo $list['bulan'] ?>" <?php if($list['bulan']===$bulan){echo "selected";}?>>
<?php echo $list['text'] ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Bulan <?php echo $bulantext ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<?php if($msg!=='empty'){?>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3">Jumlah UMKM</th>
<th class="align-middle" colspan="3">Omset/Bulan</th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1 ?></small></td>
<td><small><?php echo $umkm_jen2 ?></small></td>
<td><small><?php echo $umkm_jen3 ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen1) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen2) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen3) ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="3"><small>Total</small></th>
</tr>
<?php
$umkm = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$omset = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $umkm ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($omset) ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-lg table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3" rowspan="2">Aset</th>
<th class="align-middle" colspan="6" >Jumlah Naker</th>
</tr>
<tr>
<th colspan="2" ><small>P</small></th>
<th colspan="2" ><small>J</small></th>
<th colspan="2" ><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo rupiah($aset_jen1) ?></small></td>
<td><small><?php echo rupiah($aset_jen2) ?></small></td>
<td><small><?php echo rupiah($aset_jen3) ?></small></td>
<td><small><?php echo $naker_jen1_l ?></small></td>
<td><small><?php echo $naker_jen1_p ?></small></td>
<td><small><?php echo $naker_jen2_l ?></small></td>
<td><small><?php echo $naker_jen2_p ?></small></td>
<td><small><?php echo $naker_jen3_l ?></small></td>
<td><small><?php echo $naker_jen3_p ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="6"><small>Total</small></th>
</tr>
<?php
$naker = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$naker = $naker+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$aset = $aset_jen1+$aset_jen2+$aset_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($aset) ?></small></th>
<th class="align-middle" colspan="6" ><small><?php echo $naker ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="9" >Klasifikasi</th>
</tr>
<tr>
<th colspan="3" ><small>P</small></th>
<th colspan="3" ><small>J</small></th>
<th colspan="3" ><small>I</small></th>
</tr>
<tr>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1_ket1?></small></td>
<td><small><?php echo $umkm_jen1_ket2?></small></td>
<td><small><?php echo $umkm_jen1_ket3?></small></td>
<td><small><?php echo $umkm_jen2_ket1?></small></td>
<td><small><?php echo $umkm_jen2_ket2?></small></td>
<td><small><?php echo $umkm_jen2_ket3?></small></td>
<td><small><?php echo $umkm_jen3_ket1?></small></td>
<td><small><?php echo $umkm_jen3_ket2?></small></td>
<td><small><?php echo $umkm_jen3_ket3?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Mikro</small></th>
<th class="align-middle" colspan="3"><small>Kecil</small></th>
<th class="align-middle" colspan="3"><small>Menengah</small></th>
</tr>
<?php
$mikro = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$kecil = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$menengah = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $mikro ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $kecil ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $menengah ?></small></th>
</tr>
</tfoot>
</table>
</div>
</div>
<?php } else {?>
<div class="card-body text-center">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</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 src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').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>

View File

@@ -8,243 +8,151 @@
<!-- 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 rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<link rel="icon" type="image/png" href="../assets/images/favicon.png" />
<title>Portal Data UMKM Kota Magelang</title>
<title>Aplikasi UMKM</title>
</head>
<body>
<style>
.carousel .item {
height: 100px;
}
.item img {
position: absolute;
top: 0;
left: 0;
min-height: 100px;
}
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<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>
/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */
/* MARKETING CONTENT
-------------------------------------------------- */
/* Center align the text within the three columns below the carousel */
.marketing .col-lg-4 {
margin-bottom: 1.5rem;
text-align: center;
}
.marketing h2 {
font-weight: 400;
}
.marketing .col-lg-4 p {
margin-right: .75rem;
margin-left: .75rem;
}
/* Featurettes
------------------------- */
.featurette-divider {
margin: 5rem 0; /* Space out the Bootstrap <hr> more */
}
/* Thin out the marketing headings */
.featurette-heading {
font-weight: 300;
line-height: 1;
letter-spacing: -.05rem;
}
/* RESPONSIVE CSS
-------------------------------------------------- */
@media (min-width: 40em) {
/* Bump up size of carousel content */
.featurette-heading {
font-size: 50px;
}
}
@media (min-width: 62em) {
.featurette-heading {
margin-top: 7rem;
}
}
</style>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">
<img src="../assets/images/favicon.png" width="30" height="30" class="d-inline-block align-top" alt="">
PORTAL UMKM
</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">
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporan">Laporan Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporanbulanan">Laporan Bulanan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporankecamatan">Laporan Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/laporankelurahan">Laporan Kelurahan</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<a class="btn btn-outline-light btn-sm my-2 my-sm-0" href="<?php echo base_url()?>index.php/login">Login</a>
</form>
</div>
</nav>
</header>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2">
<div class="col-12">
<h5>Data Terkini</h5>
</div>
</div>
<div class="row mt-3 mb-3">
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-warning">
<h4 class="card-title">UMKM AKTIF</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_umkm ?></h5>
</div>
</div>
</div>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-success">
<h4 class="card-title">TENAGA KERJA</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_karyawan ?></h5>
</div>
</div>
</div>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="card-body bg-primary text-light">
<h4 class="card-title">PRODUK</h4>
<h5 class="card-subtitle mb-2"><?php echo $jumlah_produk ?></h5>
</div>
</div>
</div>
</div>
<hr>
<div class="row pl-2 pr-2 pt-2 bg-success">
<div class="col-12 text-light">
<h3>UMKM</h3>
</div>
</div>
<div class="row mb-3 bg-success">
<?php foreach($umkm as $um){?>
<div class="col col-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<img class="card-img-top" src="<?php echo base_url()?>assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Card image cap">
<div class="card-body">
<h5 class="card-title"><?php echo $um->nama ?></h5>
<p class="card-text"><?php echo $um->deskripsi ?></p>
</div>
</div>
</div>
<?php } ?>
<div class="col-12 text-center mt-3 pb-4">
<a href="<?php echo base_url()?>index.php/umkm" class="btn btn-warning">Lihat Daftar UMKM</a>
</div>
</div>
<hr>
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>PRODUK</h3>
</div>
</div>
<div class="row mb-3">
<?php foreach($produk as $pr){?>
<div class="col col-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<img class="card-img-top" src="<?php echo base_url()?>assets/images/produk/<?php echo $pr->foto_produk ?>" alt="Card image cap">
<div class="card-body">
<h5 class="card-title"><?php echo $pr->produk ?></h5>
<p class="card-text"><?php echo $pr->deskripsi ?></p>
</div>
</div>
</div>
<?php } ?>
<div class="col-12 text-center mt-3 pb-4">
<a href="<?php echo base_url()?>index.php/produk" class="btn btn-warning">Lihat Daftar produk</a>
</div>
</div>
<div class="fluid" >
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="../assets/images/corousel1.jpg" alt="First slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>UMKM KOTA MAGELANG</h1>
<h3>saat ini, kota magelang mempunyai <strong>5</strong> UMKM aktif</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../assets/images/corousel2.jpg" alt="Second slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>TENAGA KERJA</h1>
<h3><strong>500</strong> Tenaga kerja terserap oleh kegiatan UMKM</h3>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../assets/images/corousel3.jpg" alt="Third slide">
<div class="carousel-caption d-none d-md-block mb-5">
<h1>PRODUK UMKM</h1>
<h3>UMKM kota magelang menghasilkan <strong>500</strong> produk</h3>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<!-- Three columns of text below the carousel -->
<div class="container mt-4">
<div class="container marketing">
<div class="text-center text-secondary"><h3><u>PRODUK UMKM</u></h3></div>
<div class="row mt-4">
<?php
foreach($produk as $prod){
?>
<div class="col-lg-4">
<img class="rounded-circle" src="../assets/images/produk/<?php echo $prod->foto_produk ?>" alt="Generic placeholder image" width="140" height="140">
<h2><?php echo $prod->produk ?></h2>
<p><a class="btn btn-secondary" href="#" role="button">View details &raquo;</a></p>
</div><!-- /.col-lg-4 -->
<?php
}
?>
</div>
<div class="text-center"> <label><a href="#" class="btn btn-outline-primary">Lihat Produk Lengkap</a></label></div>
<hr>
<!-- START THE FEATURETTES -->
<?php
$no='ganjil';
foreach($umkm as $um){
if($no=='ganjil'){
?>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading"><?php echo $um->nama ?></h2>
<p class="lead"><?php echo $um->deskripsi ?></p>
</div>
<div class="col-md-5">
<img class="featurette-image img-fluid mx-auto" src="../assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Generic placeholder image">
</div>
</div>
<?php
$no = 'genap';
}else{
?>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7 order-md-2">
<h2 class="featurette-heading"><?php echo $um->nama ?></h2>
<p class="lead"><?php echo $um->deskripsi ?></p>
</div>
<div class="col-md-5 order-md-1">
<img class="featurette-image img-fluid mx-auto" src="../assets/images/umkm/<?php echo $um->foto_umkm ?>" alt="Generic placeholder image">
</div>
</div>
<?php
$no='ganjil';
}
}
?>
<!-- /END THE FEATURETTES -->
</div>
</div>
<div class="bg-dark text-light mt-5" style="padding-top: 50px;padding-bottom:40px;">
<footer class="container">
<p class="float-right"><a href="#">Back to top</a></p>
<p>&copy; 2021 , Ardi Ferdianto</p>
</footer>
</div>
</div>
</div>
@@ -254,8 +162,10 @@
<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>
</body>

View File

@@ -0,0 +1,425 @@
<?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-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan <span class="sr-only">(current)</span></a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="kecamatan">Pilih Kecamatan</label>
<select name="kecamatan" class="form-control" id="kecamatan" onchange="this.form.submit()" required>
<?php foreach($kecamatan_list as $list) {?>
<option value="<?php echo $list['kecamatan'] ?>" <?php if($list['kecamatan']===$kecamatan){echo "selected";}?>>
<?php echo $list['kecamatan'] ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<?php if($msg!=='empty'){?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Kecamatan <?php echo $kecamatan ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive table-striped">
<thead>
<tr>
<th rowspan="3"><small>No</small></th>
<th rowspan="3"><small>kelurahan</small></th>
<th rowspan="2" colspan="3"><small>Jml Umkm</small></th>
<th rowspan="2" colspan="3"><small>Omset/Bulan</small></th>
<th rowspan="2" colspan="3"><small>Aset</small></th>
<th rowspan="1" colspan="6"><small>Jml Naker</small></th>
<th rowspan="1" colspan="9"><small>Klasifikasi</small></th>
</tr>
<tr>
<th colspan="2"><small>P</small></th>
<th colspan="2"><small>J</small></th>
<th colspan="2"><small>I</small></th>
<th colspan="3"><small>P</small></th>
<th colspan="3"><small>J</small></th>
<th colspan="3"><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($listlaporan as $laporan){
$no++;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left"><small><?php echo $laporan['kelurahan'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis1'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis2'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis3'] ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis3']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis3']) ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_p'] ?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat3']?></small></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="2"><small>Total</small></th>
<th><small><?php echo $umkm_jenis1 ?></small></th>
<th><small><?php echo $umkm_jenis2 ?></small></th>
<th><small><?php echo $umkm_jenis3 ?></small></th>
<th><small><?php echo rupiah($omset_jenis1) ?></small></th>
<th><small><?php echo rupiah($omset_jenis2) ?></small></th>
<th><small><?php echo rupiah($omset_jenis3) ?></small></th>
<th><small><?php echo rupiah($aset_jenis1) ?></small></th>
<th><small><?php echo rupiah($aset_jenis2) ?></small></th>
<th><small><?php echo rupiah($aset_jenis3) ?></small></th>
<th><small><?php echo $karyawan_jen1_l ?></small></th>
<th><small><?php echo $karyawan_jen1_p ?></small></th>
<th><small><?php echo $karyawan_jen2_l ?></small></th>
<th><small><?php echo $karyawan_jen2_p ?></small></th>
<th><small><?php echo $karyawan_jen3_l ?></small></th>
<th><small><?php echo $karyawan_jen3_p ?></small></th>
<th><small><?php echo $umkm_jen1_kat1 ?></small></th>
<th><small><?php echo $umkm_jen1_kat2 ?></small></th>
<th><small><?php echo $umkm_jen1_kat3 ?></small></th>
<th><small><?php echo $umkm_jen2_kat1 ?></small></th>
<th><small><?php echo $umkm_jen2_kat2 ?></small></th>
<th><small><?php echo $umkm_jen2_kat3 ?></small></th>
<th><small><?php echo $umkm_jen3_kat1 ?></small></th>
<th><small><?php echo $umkm_jen3_kat2 ?></small></th>
<th><small><?php echo $umkm_jen3_kat3 ?></small></th>
</tr>
<tr>
<th colspan="26" style="height:1px;">&nbsp;</th>
</tr>
<tr>
<th colspan="2" rowspan="2"><badge>Total</badge></th>
<th colspan="3"><badge>Jml Umkm</badge></th>
<th colspan="3"><badge>Omset/Bln</badge></th>
<th colspan="3"><badge>Aset</badge></th>
<th colspan="6"><badge>Naker</badge></th>
<th colspan="3"><badge>Mikro</badge></th>
<th colspan="3"><badge>Kecil</badge></th>
<th colspan="3"><badge>Menengah</badge></th>
</tr>
<tr>
<th colspan="3"><badge><?php echo $umkm ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($omset) ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($aset) ?></badge></th>
<th colspan="6"><badge><?php echo $karyawan ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat1 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat2 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat3 ?></badge></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<?php } else {?>
<div class="row-container text-center mt-3">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</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 src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').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>

View File

@@ -0,0 +1,498 @@
<?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-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan <span class="sr-only">(current)</span></a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<div>
<form action="" method="POST" class="needs-validation">
<div class="form-group">
<label for="kelurahan">Pilih Kelurahan</label>
<select name="kelurahan" class="form-control" id="kelurahan" onchange="this.form.submit()" required>
<?php foreach($kelurahan_list as $list) {?>
<option value="<?php echo $list->kelurahan ?>" <?php if($list->kelurahan===$kelurahan){echo "selected";}?>>
<?php echo $list->kelurahan ?>
</option>
<?php } ?>
</select>
</div>
</form>
</div>
<?php if($msg!=='empty'){?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Kelurahan <?php echo $kelurahan ?> <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive table-striped">
<thead>
<tr>
<th class="align-middle" rowspan="3"><small>No</small></th>
<th class="align-middle" rowspan="3"><small>kelurahan</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Jml Umkm</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Omset/Bulan</small></th>
<th class="align-middle" rowspan="2" colspan="3"><small>Aset</small></th>
<th class="align-middle" rowspan="1" colspan="6"><small>Jml Naker</small></th>
<th class="align-middle" rowspan="1" colspan="9"><small>Klasifikasi</small></th>
</tr>
<tr>
<th colspan="2"><small>P</small></th>
<th colspan="2"><small>J</small></th>
<th colspan="2"><small>I</small></th>
<th colspan="3"><small>P</small></th>
<th colspan="3"><small>J</small></th>
<th colspan="3"><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($listlaporan as $laporan){
$no++;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left"><small><?php echo $laporan['kelurahan'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis1'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis2'] ?></small></td>
<td><small><?php echo $laporan['umkm_jenis3'] ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['omset_jenis3']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis1']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis2']) ?></small></td>
<td><small><?php echo rupiah($laporan['aset_jenis3']) ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen1_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen2_p'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_l'] ?></small></td>
<td><small><?php echo $laporan['karyawan_jen3_p'] ?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen1_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen2_kat3']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat1']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat2']?></small></td>
<td><small><?php echo $laporan['umkm_jen3_kat3']?></small></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="2"><small>Total</small></th>
<th><small><?php echo $umkm_jenis1 ?></small></th>
<th><small><?php echo $umkm_jenis2 ?></small></th>
<th><small><?php echo $umkm_jenis3 ?></small></th>
<th><small><?php echo rupiah($omset_jenis1) ?></small></th>
<th><small><?php echo rupiah($omset_jenis2) ?></small></th>
<th><small><?php echo rupiah($omset_jenis3) ?></small></th>
<th><small><?php echo rupiah($aset_jenis1) ?></small></th>
<th><small><?php echo rupiah($aset_jenis2) ?></small></th>
<th><small><?php echo rupiah($aset_jenis3) ?></small></th>
<th><small><?php echo $karyawan_jen1_l ?></small></th>
<th><small><?php echo $karyawan_jen1_p ?></small></th>
<th><small><?php echo $karyawan_jen2_l ?></small></th>
<th><small><?php echo $karyawan_jen2_p ?></small></th>
<th><small><?php echo $karyawan_jen3_l ?></small></th>
<th><small><?php echo $karyawan_jen3_p ?></small></th>
<th><small><?php echo $umkm_jen1_kat1 ?></small></th>
<th><small><?php echo $umkm_jen1_kat2 ?></small></th>
<th><small><?php echo $umkm_jen1_kat3 ?></small></th>
<th><small><?php echo $umkm_jen2_kat1 ?></small></th>
<th><small><?php echo $umkm_jen2_kat2 ?></small></th>
<th><small><?php echo $umkm_jen2_kat3 ?></small></th>
<th><small><?php echo $umkm_jen3_kat1 ?></small></th>
<th><small><?php echo $umkm_jen3_kat2 ?></small></th>
<th><small><?php echo $umkm_jen3_kat3 ?></small></th>
</tr>
<tr>
<th colspan="26" style="height:1px;">&nbsp;</th>
</tr>
<tr>
<th colspan="2" rowspan="2"><badge>Total</badge></th>
<th colspan="3"><badge>Jml Umkm</badge></th>
<th colspan="3"><badge>Omset/Bln</badge></th>
<th colspan="3"><badge>Aset</badge></th>
<th colspan="6"><badge>Naker</badge></th>
<th colspan="3"><badge>Mikro</badge></th>
<th colspan="3"><badge>Kecil</badge></th>
<th colspan="3"><badge>Menengah</badge></th>
</tr>
<tr>
<th colspan="3"><badge><?php echo $umkm ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($omset) ?></badge></th>
<th colspan="3"><badge><?php echo rupiah($aset) ?></badge></th>
<th colspan="6"><badge><?php echo $karyawan ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat1 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat2 ?></badge></th>
<th colspan="3"><badge><?php echo $umkm_kat3 ?></badge></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Daftar UMKM <?php echo $kelurahan ?> Tahun <?php echo $tahun ?></h6>
</div>
</div>
</div>
<div class="card-body">
<div class="row mt-3 table-responsive">
<table id="tabeldata" class="table table-sm table-bordered table-striped text-center">
<thead>
<tr>
<th class="align-middle" rowspan="2"><small>No</small></th>
<th class="align-middle" rowspan="2"><small>Nama UMKM</small></th>
<th class="align-middle" rowspan="2"><small>Pemilik</small></th>
<th class="align-middle" rowspan="2"><small>Kelurahan</small></th>
<th class="align-middle" rowspan="2"><small>Alamat</small></th>
<th class="align-middle" rowspan="2"><small>Telp</small></th>
<th class="align-middle" rowspan="2"><small>Deskripsi</small></th>
<th class="align-middle" rowspan="2"><small>Jenis</small></th>
<th class="align-middle" rowspan="2"><small>Omset/Bulan</small></th>
<th class="align-middle" rowspan="2"><small>Aset</small></th>
<th class="align-middle" colspan="2"><small>Naker</small></th>
<th class="align-middle" rowspan="2"><small>Skala Usaha</small></th>
</tr>
<tr>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<?php
$no=0;
foreach($umkmlist as $umkm){
$no++;
$usaha = $this->UmkmModel->getUmkmsById($umkm->id_umkm);
$jenis = $this->JenisModel->getJenisById($umkm->id_jenis);
$kategori = $this->KategoriModel->getKategoriById($umkm->id_kategori);
$listomset = $this->AbsensiModel->getAbsensiByTahunAndUmkmId($umkm->tahun,$umkm->id_umkm);
$ttl_omset=0;
foreach($listomset as $oms){
$ttl_omset = $ttl_omset+$oms->omset;
}
$r_omset = $ttl_omset/12;
?>
<tr>
<td><small><?php echo $no ?></small></td>
<td class="text-left text-nowrap"><small><?php echo $usaha->nama?></small></td>
<td class="text-left text-nowrap"><small><?php echo $umkm->nama?></small></td>
<td class="text-left"><small><?php echo $umkm->kelurahan ?></small></td>
<td class="text-left"><small><?php echo $usaha->alamat ?></small></td>
<td><small><?php echo $usaha->telp ?></small></td>
<td class="text-left"><small><?php echo $usaha->deskripsi ?></small></td>
<td><small><?php echo $jenis->jenis ?></small></td>
<td class="text-left"><small><?php echo rupiah($r_omset) ?></small></td>
<td class="text-left"><small><?php echo rupiah($umkm->aset) ?></small></td>
<td><small><?php echo $umkm->karyawan_l ?></small></td>
<td><small><?php echo $umkm->karyawan_p ?></small></td>
<td><small><?php echo $kategori->kategori ?></small></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<?php } else {?>
<div class="row-container text-center mt-3">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</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 src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').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>

View File

@@ -0,0 +1,514 @@
<?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-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle active" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data <span class="sr-only">(current)</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item active" href="<?php echo base_url()?>index.php/tahunan">Tahunan <span class="sr-only">(current)</span></a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<h5 class="card-header">Laporan</h5>
<div class="card-body">
<div>
<div class="mt-3">
<?php if(isset($tahun_0)){?>
<div class="card">
<div class="card-header bg-primary text-white">
<h6>Monografi Kota Magelang Tahun <?php echo $tahun ?></h6>
</div>
<div class="card-body">
<div class="row">
<div class="col col-12 col-sm-12 col-md-5 col-lg-5">
<div class="row">
<canvas id="myChart" width="400" height="300"></canvas>
</div>
<div class="row">
<table class="table text-center text-nowarp table-sm table-bordered table-striped">
<thead>
<tr>
<th></th>
<th><small>Aset</small></th>
<th><small>Omset</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo rupiah($aset_1) ?></small></td>
<td><small><?php echo rupiah($omset_1) ?></small></td>
</tr>
<tr>
<td><small><?php echo $tahun_0 ?></small></td>
<td><small><?php echo rupiah($aset_0) ?></small></td>
<td><small><?php echo rupiah($omset_0) ?></small></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col col col-12 col-sm-12 col-md-7 col-lg-7">
<div class="row pl-2">
<canvas id="myChart2" width="550" height="300"></canvas>
</div>
<div class="row pl-2">
<table class="table text-center table-sm table-responsive-sm table-bordered table-striped">
<thead>
<tr>
<th></th>
<th><small>Jml UMKM</small></th>
<th><small>Tenaga Kerja</small></th>
<th><small>Mikro</small></th>
<th><small>Kecil</small></th>
<th><small>Menengah</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo $umkm_1 ?></small></td>
<td><small><?php echo $naker_1 ?></small></td>
<td><small><?php echo $mikro_1 ?></small></td>
<td><small><?php echo $kecil_1 ?></small></td>
<td><small><?php echo $menengah_1 ?></small></td>
</tr>
<tr>
<td><small><?php echo $tahun ?></small></td>
<td><small><?php echo $umkm_0 ?></small></td>
<td><small><?php echo $naker_0 ?></small></td>
<td><small><?php echo $mikro_0 ?></small></td>
<td><small><?php echo $kecil_0 ?></small></td>
<td><small><?php echo $menengah_0 ?></small></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="card">
<div class="card-header bg-primary text-white">
<div class="row">
<div class="col col-12 col-sm-12 col-md-8 col-lg-8">
<h6>Data UMKM Kota Magelang Tahun <?php echo $tahun ?></h6>
</div>
</div>
</div>
<?php if($msg!=='empty'){?>
<div class="card-body">
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3">Jumlah UMKM</th>
<th class="align-middle" colspan="3">Omset/Bulan</th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1 ?></small></td>
<td><small><?php echo $umkm_jen2 ?></small></td>
<td><small><?php echo $umkm_jen3 ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen1) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen2) ?></small></td>
<td><small><?php echo rupiah($omset_bln_jen3) ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="3"><small>Total</small></th>
</tr>
<?php
$umkm = $umkm_jen1+$umkm_jen2+$umkm_jen3;
$omset = $omset_bln_jen1+$omset_bln_jen2+$omset_bln_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $umkm ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($omset) ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-lg table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="3" rowspan="2">Aset</th>
<th class="align-middle" colspan="6" >Jumlah Naker</th>
</tr>
<tr>
<th colspan="2" ><small>P</small></th>
<th colspan="2" ><small>J</small></th>
<th colspan="2" ><small>I</small></th>
</tr>
<tr>
<th><small>P</small></th>
<th><small>J</small></th>
<th><small>I</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
<th><small>L</small></th>
<th><small>P</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo rupiah($aset_jen1) ?></small></td>
<td><small><?php echo rupiah($aset_jen2) ?></small></td>
<td><small><?php echo rupiah($aset_jen3) ?></small></td>
<td><small><?php echo $naker_jen1_l ?></small></td>
<td><small><?php echo $naker_jen1_p ?></small></td>
<td><small><?php echo $naker_jen2_l ?></small></td>
<td><small><?php echo $naker_jen2_p ?></small></td>
<td><small><?php echo $naker_jen3_l ?></small></td>
<td><small><?php echo $naker_jen3_p ?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Total</small></th>
<th class="align-middle" colspan="6"><small>Total</small></th>
</tr>
<?php
$naker = $naker_jen1_l+$naker_jen2_l+$naker_jen3_l;
$naker = $naker+$naker_jen1_p+$naker_jen2_p+$naker_jen3_p;
$aset = $aset_jen1+$aset_jen2+$aset_jen3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo rupiah($aset) ?></small></th>
<th class="align-middle" colspan="6" ><small><?php echo $naker ?></small></th>
</tr>
</tfoot>
</table>
</div>
<hr>
<div class="row">
<table class="table table-bordered table-sm text-center text-nowrap table-responsive-sm table-striped">
<thead class="">
<tr>
<th class="align-middle" colspan="9" >Klasifikasi</th>
</tr>
<tr>
<th colspan="3" ><small>P</small></th>
<th colspan="3" ><small>J</small></th>
<th colspan="3" ><small>I</small></th>
</tr>
<tr>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
<th><small>M</small></th>
<th><small>K</small></th>
<th><small>MN</small></th>
</tr>
</thead>
<tbody>
<tr>
<td><small><?php echo $umkm_jen1_ket1?></small></td>
<td><small><?php echo $umkm_jen1_ket2?></small></td>
<td><small><?php echo $umkm_jen1_ket3?></small></td>
<td><small><?php echo $umkm_jen2_ket1?></small></td>
<td><small><?php echo $umkm_jen2_ket2?></small></td>
<td><small><?php echo $umkm_jen2_ket3?></small></td>
<td><small><?php echo $umkm_jen3_ket1?></small></td>
<td><small><?php echo $umkm_jen3_ket2?></small></td>
<td><small><?php echo $umkm_jen3_ket3?></small></td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="align-middle" colspan="3"><small>Mikro</small></th>
<th class="align-middle" colspan="3"><small>Kecil</small></th>
<th class="align-middle" colspan="3"><small>Menengah</small></th>
</tr>
<?php
$mikro = $umkm_jen1_ket1+$umkm_jen2_ket1+$umkm_jen3_ket1;
$kecil = $umkm_jen1_ket2+$umkm_jen2_ket2+$umkm_jen3_ket2;
$menengah = $umkm_jen1_ket3+$umkm_jen2_ket3+$umkm_jen3_ket3;
?>
<tr>
<th class="align-middle" colspan="3" ><small><?php echo $mikro ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $kecil ?></small></th>
<th class="align-middle" colspan="3" ><small><?php echo $menengah ?></small></th>
</tr>
</tfoot>
</table>
</div>
</div>
<?php } else {?>
<div class="card-body text-center">
<img src="<?php echo base_url()?>assets/images/search.png" width="150" /><br>
<div class="alert alert-warning" role="alert">
Tidak ada <strong>laporan yang sudah dibuat</strong> saat ini.
</div>
</div>
<?php } ?>
</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 src="<?php echo base_url()?>assets/js/chart.js"></script>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Aset', 'Omset'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $aset_1 ?>, <?php echo $omset_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $aset_0 ?>, <?php echo $omset_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
var ctx = document.getElementById('myChart2').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jml UMKM', 'Tenaga Kerja', 'Mikro', 'Kecil','Menengah'],
datasets: [
{
label: '<?php echo $tahun ?>',
data: [<?php echo $umkm_1 ?>, <?php echo $naker_1 ?>, <?php echo $mikro_1 ?>, <?php echo $kecil_1 ?>, <?php echo $menengah_1 ?>],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(255, 99, 132, 1)'
],
borderWidth: 1
},
{
label: '<?php echo $tahun_0 ?>',
data: [<?php echo $umkm_0 ?>, <?php echo $naker_0 ?>, <?php echo $mikro_0 ?>, <?php echo $kecil_0 ?>, <?php echo $menengah_0 ?>],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
'rgba(54, 162, 235, 0.2)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(54, 162, 235, 1)'
],
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
<script>
$(document).ready(function() {
$('#tabeldata').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>

View File

@@ -0,0 +1,132 @@
<!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 rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>PRODUK</h3>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<table id="tabeldata" class="table table-sm datatable w-100 " >
<thead>
<tr>
<th>Foto</th>
<th>Produk</th>
<th>Deskripsi</th>
<th>UMKM</th>
<th>Kontak</th>
</tr>
</thead>
<tbody>
<?php foreach($listproduk as $produk){ ?>
<tr>
<td class="align-middle text-center"><img src="<?php echo base_url()?>/assets/images/produk/<?php echo $produk->foto_produk ?>" width="150" class="img-thumbnail"></td>
<td class="align-middle"><?php echo $produk->produk ?></td>
<td class="align-middle"><?php echo $produk->deskripsi ?></td>
<td class="align-middle"><?php echo $produk->nama ?></td>
<td class="align-middle"><?php echo $produk->telp ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</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>

130
application/views/umkm.php Normal file
View File

@@ -0,0 +1,130 @@
<!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 rel="icon" type="image/png" href="<?php echo base_url()?>assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<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>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php">Beranda</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="<?php echo base_url()?>index.php/umkm">Umkm <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url()?>index.php/produk">Produk</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Data
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo base_url()?>index.php/tahunan">Tahunan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/bulanan">Bulanan</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kecamatan">Kecamatan</a>
<a class="dropdown-item" href="<?php echo base_url()?>index.php/kelurahan">Kelurahan</a>
</div>
</li>
</ul>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
<form methode="POST" action="<?php echo base_url('index.php/')?>login/logout" class="form-inline my-2 my-lg-0" >
<button class="btn btn-outline-light btn-sm my-2 my-sm-0" type="submit">Login</button>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row mt-3">
<div class="col col-12 col-md-12 col-lg-12">
<div class="card">
<h5 class="card-header">PORTAL UMKM</h5>
<div class="card-body">
<div class="row pl-2 pr-2 pt-2">
<div class="col-12 pb-2">
<h3>UMKM</h3>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<table id="tabeldata" class="table table-sm datatable w-100 " >
<thead>
<tr>
<th>Foto</th>
<th>Nama</th>
<th>Deskripsi</th>
<th>Kontak</th>
</tr>
</thead>
<tbody>
<?php foreach($listumkm as $umkm){ ?>
<tr>
<td class="align-middle text-center"><img src="<?php echo base_url()?>/assets/images/umkm/<?php echo $umkm->foto_umkm ?>" width="150" class="img-thumbnail"></td>
<td class="align-middle"><?php echo $umkm->nama ?></td>
<td class="align-middle"><?php echo $umkm->deskripsi ?></td>
<td class="align-middle"><?php echo $umkm->telp ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</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>