| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /wamp/www/bpkd_api/work/ |
Upload File : |
<?php
//$file = "test.json";
//$datajson = file_get_contents($file);
//$data = json_decode($datajson,true);
//echo "<pre>";
//print_r($data);
//echo "</pre>";
//$option = array();
//$linkApi = "https://bprd.lumajangkab.go.id/bprd/realisasi/realisasi.php?bulan=01&tahun=2023";
//$masterlinkApi = "https://bprd.lumajangkab.go.id/bprd/realisasi/realisasi.php?";
$masterlinkApi = "https://bprd.lumajangkab.go.id/bprd/integrasibpkd/api.php?";
if(!empty($_GET['tglawal']) && !empty($_GET['tglakhir']) ){
$awal = $_GET['tglawal'];
$akhir = $_GET['tglakhir'];
$childlinkApi = $masterlinkApi."tglawal=".$awal."&tglakhir=".$akhir;
$dataApi = file_get_contents($childlinkApi,false);
$data = json_decode($dataApi,true);
}else{
$data=array();
}
?>
<script type="text/javascript">
$(function(){
$(".datepicker").datepicker({
format: 'yyyy-mm-dd',
autoclose: true,
todayHighlight: true,
});
$("#tgl_mulai").on('changeDate', function(selected) {
var startDate = new Date(selected.date.valueOf());
$("#tgl_akhir").datepicker('setStartDate', startDate);
if($("#tgl_mulai").val() > $("#tgl_akhir").val()){
$("#tgl_akhir").val($("#tgl_mulai").val());
}
});
});
</script>
<!DOCTYPE html>
<html>
<head>
<title>REST API BPKD</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<br />
<h3 align="center">DATA COMPARE REALISASI BPRD </h3>
<br />
<form class="form-inline" method="get" action="">
<input id="tglawal" placeholder="Masukkan tanggal awal" type="text" class="form-control datepicker" name="tglawal">
<input id="tglakhir" placeholder="Masukkan tanggal akhir" type="text" class="form-control datepicker" name="tglakhir">
<button type="submit" class="btn btn-success form-control"> Tampilkan </button>
</form>
<br>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>JENIS PAJAK</th>
<th>TARGET</th>
<th>REALISASI</th>
<th>TAHUN</th>
<th>TANGGAL</th>
<th>ID JENIS</th>
<th>BULAN</th>
<th>JUMLAH WP</th>
</tr>
</thead>
<tbody>
<?php
$tottarget=0;
$totreal=0;
$totjmlwp=0;
if(count($data)>0){
foreach($data as $row)
{
echo '
<tr>
<td>'.$row['id'].'</td>
<td>'.$row['jenis_pajak'].'</td>
<td align="right">'.number_format($row['target']).'</td>
<td align="right">'.number_format($row['realisasi']).'</td>
<td>'.$row['tahun'].'</td>
<td>'.$row['tanggal'].'</td>
<td>'.$row['id_jenis'].'</td>
<td>'.$row['bulan'].'</td>
<td align="right">'.number_format($row['jumlah_wp']).'</td>
</tr>
';
$tottarget = $tottarget + $row['target'];
$totreal = $totreal + $row['realisasi'];
$totjmlwp = $totjmlwp + $row['jumlah_wp'];
}
echo '
<tr>
<td colspan="2"><b>TOTAL</b></td>
<td align="right"><b>'.number_format($tottarget).'</b></td>
<td align="right"><b>'.number_format($totreal).'</b></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td align="right"><b>'.number_format($totjmlwp).'</b></td>
</tr>
';
}else{
echo '<tr><td colspan="9" align="center">-- belum ada data --</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>