umkm-app/application/views/admin/laporanpdf.php.v1

486 lines
28 KiB
Plaintext

<?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>
<div class="container">
<div class="row">
<div class="col col-md-12 col-lg-12 col-sm-12 col-12">
<div class="card">
<div class="text-center">
<h4 class="card-header">Rekap Data UMKM Tahun <?php echo $tahun ?> <br>KOTA MAGELANG</h4>
</div>
<div class="card-body">
<div>
<div class="mt-3">
<?php if(isset($tahun_0)){?>
<div class="card">
<div class="card-header">
<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-7 col-lg-7">
<div class="row">
<canvas id="myChart" width="500" height="400"></canvas>
</div>
</div>
<div class="col col-5"></div>
<div class="col col-12">
<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" style="margin-top:50px;">
<div class="row pl-2">
<canvas id="myChart2" width="450" height="400"></canvas>
</div>
</div>
<div class="col col-5"></div>
<div class="col col-12">
<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">
<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-md 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>
<script>
window.print();
</script>
</body>
</html>