| 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 : /laragon/www/_pengaduan/modules/ |
Upload File : |
<?php
$alert = '';
if (isset($_POST['kirim'])) {
$curl_kirim = curl_init();
curl_setopt_array($curl_kirim, array(
CURLOPT_URL => 'https://laporlumajang.lumajangkab.go.id/main/ws_post_opd',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'AUTH_KEY' => '$2y$10$wALz2CBxlzBFxaA4WyHeqOexj9gvFeN3vFrQLT/1vfNhON6Pdrdla',
'jawab_peng' => @$_POST['tanggapan'],
'id_peng' => @$_POST['id'],
'is_utf8' => true
)
));
$response = curl_exec($curl_kirim);
curl_close($curl_kirim);
$json_kirim = json_decode($response, true);
if ($json_kirim['response'] == 'sukses') {
$alert = '<div class="alert alert-success">Tanggapan berhasil dikirim</div>';
} else {
$alert = '<div class="alert alert-danger">Tanggapan gagal dikirim</div>';
}
}
//disini menggunakan link demo
$curl = curl_init();
$param_get = [
'opd' => $opd_alias,
'id_adu' => @$_GET['id'],
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://laporlumajang.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);
$json = $json['item'][0];
?>
<div class="row" style="margin-top: 50px">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading" style="height: 50px">
Lihat Pengaduan
<div class="pull-right">
<a href="index.php?p=b_daftar_pengaduan" class="btn btn-warning btn-sm">
Kembali
</a>
</div>
<br>
</div>
<div class="panel-body">
<?=$alert?>
<form method="post" class="form-horizontal">
<div class="form-group">
<label for="" class="col-md-2">Nama</label>
<div class="col-md-4">
<input type="text" class="form-control" readonly value="<?=$json['nama_peng']?>">
</div>
<label for="" class="col-md-2">Tanggal Pengaduan</label>
<div class="col-md-2">
<input type="text" class="form-control" readonly value="<?=$json['tgl_peng']?>">
</div>
</div>
<div class="form-group">
<label for="" class="col-md-2">Alamat</label>
<div class="col-md-4">
<input type="text" class="form-control" readonly value="<?=$json['alamat']?>">
</div>
</div>
<div class="form-group">
<label for="" class="col-md-2">Desa/Kelurahan</label>
<div class="col-md-2">
<input type="text" class="form-control" readonly value="<?=$json['kel']?>">
</div>
<label for="" class="col-md-offset-2 col-md-2">Kecamatan</label>
<div class="col-md-2">
<input type="text" class="form-control" readonly value="<?=$json['kec']?>">
</div>
</div>
<div class="form-group">
<label for="" class="col-md-2">Uraian Pengaduan</label>
<div class="col-md-10">
<textarea class="form-control" rows="10" readonly><?=$json['uraian_peng']?></textarea>
</div>
</div>
<div class="form-group row">
<label for="" class="col-md-2">Foto/Video</label><br>
<div class="col-md-10">
<?php if (count($json['file']) > 0) {
foreach ($json['file'] as $key => $value) {
if ($value['type'] == 'mp4') {
echo '<iframe border="0" width="300" height="auto" src="' . $value['link'] . '"></iframe>';
} elseif (in_array($value['type'], ['jpg', 'png', 'jpeg'])) {
echo '<img width="300" height="auto" src="' . $value['link'] . '">';
} else {
echo 'Ekstensi tidak diketahui !';
}
}
} else {
echo 'Tidak ada file diupload';
}
?>
</div>
</div>
<hr>
<div class="form-group">
<label for="" class="col-md-2">Tanggal Menanggapi</label>
<div class="col-md-2">
<input type="text" class="form-control" readonly value="<?=$json['tgl_jawab'] == '' ? '-' : $json['tgl_jawab']?>">
</div>
</div>
<div class="form-group">
<label for="" class="col-md-2">Tanggapan</label>
<div class="col-md-10">
<input type="hidden" name="id" value="<?=$json['id_peng']?>">
<textarea name="tanggapan" class="form-control" rows="10" id="isi"><?=$json['jawab_peng']?></textarea>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<button class="btn btn-success" name="kirim" value="1">Kirim Tanggapan</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="/vendor/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
selector: '#isi',
plugins: "advlist lists autolink autoresize textcolor wordcount" ,
toolbar: "bold italic underline | alignleft aligncenter alignright alignjustify | cut copy paste | bullist numlist | outdent indent | blockquote | undo redo removeformat | subscript superscript | forecolor backcolor",
menubar: "",
autoresize_min_height: 200,
image_advtab: true,
media_live_embeds: true,
table_responsive_width: true,
table_default_attributes: {
class: 'table table-hover table-striped',
border:'1'
},
});
</script>