umkm-app/application/views/admin/lapkecxls.php

225 lines
15 KiB
PHP
Raw Permalink Normal View History

<?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">
<link rel="icon" type="image/png" href="../../assets/images/favicon.png" />
<title>Aplikasi UMKM</title>
<style>
table{
border:solid 1px black;
padding-right:5px;
padding-left:5px;
margin-top:10px;
margin-bottom:20px;
text-align: center;
width:1500px;
font-size: 14px;
}
th{
padding-right:1px;
padding-left:1px;
padding-top:2px;
padding-bottom:2px;
border:solid 1px black;
}
thead{
background-color: #ccc;
}
td{
padding-right:1px;
padding-left:1px;
padding-top:2px;
padding-bottom:2px;
text-align: center;
border:solid 1px black;
}
.judul{
font-weight: bold;
text-align: center;
width: 1500px;
font-size: 20px;
}
.spasi{
height:40px;
content: '&nbsp;';
min-height: 40px;
}
</style>
</head>
<body>
<?php
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Rekap_Data_UMKM_kec_".$kecamatan.'_'.$tahun.".xls");
?>
<div class="spasi">&nbsp;</div>
<div class="judul">
REKAP DATA UMKM KECAMATAN <?php echo strtoupper($kecamatan) ?> <?php echo $tahun ?> <br>
KOTA MAGELANG
</div>
<div class="spasi">&nbsp;</div>
<?php if($msg!=='empty'){?>
<div>
<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>
<?php } else {?>
<div>Tidak ada laporan yang sudah dibuat saat ini.</div>
<?php } ?>
</body>
</html>