| 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 : D:/laragon/www/_pengaduan/modules/ |
Upload File : |
<?php
//disini menggunakan link demo
$curl = curl_init();
$param_get = [
'opd' => $opd_alias,
'limit' => 5, /*bisa custom*/
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://lapor.lumajangkab.go.id/main/api_opd?' . http_build_query($param_get),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
?>
<div class="row" style="margin-top: 50px">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading" style="height:50px">
DAFTAR PENGADUAN LAPOR LUMAJANG !
</div>
<div class="panel-body">
<table class="table table-striped table-bordered" id="datatable1">
<thead>
<tr>
<th class="text-center">No</th>
<th class="text-center">Tanggal</th>
<th class="text-center">Nama</th>
<th class="text-center">Desa/Kelurahan</th>
<th class="text-center">Kecamatan</th>
<th class="text-center">Status</th>
<th class="text-center">Aksi</th>
</tr>
</thead>
<tbody>
<?php foreach($json['item'] as $key => $value){
if($value['jawab_peng'] != ''){
$status = '<label class="label label-success">Sudah Ditanggapi</label>';
}elseif ($value['jawab_peng'] == '') {
$status = '<label class="label label-warning">Belum Ditanggapi</label>';
}else{
$status = '<label class="label label-danger">Tidak diketahui</label>';
}
?>
<tr>
<td><?= $key + 1?></td>
<td><?= $value['tgl_peng']?></td>
<td><?= $value['nama_peng']?></td>
<td><?= $value['kel']?></td>
<td><?= $value['kec']?></td>
<td><?= $status?></td>
<td class="text-center">
<a href="index.php?p=lihat_pengaduan&id=<?= $value['id_peng']?>" class="btn btn-primary btn-sm">Lihat</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.10.23/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.23/datatables.min.js"></script>
<script>
$(document).ready( function () {
$('#datatable1').DataTable();
} );
</script>