{% extends 'frontend/base.html.twig' %}
{% block body %}
<main>
<section class="dataset-inner section-padding bg-gray">
<div class="page-bar-hero is-detail" style="margin-top: -44px; background-image: url({{ asset('/assets/background/simpang_gumul.png') }})">
<div class="container d-flex align-items-center">
<div class="position-relative">
<a href="{{ path('dataset') }}" class="btn btn-outline-light btn-sm fw-500 mb-3">
<i class="bi bi-arrow-left-circle"></i>
Daftar Dataset
</a>
<div class="position-relative">
<h5 class="text-light fw-600">{{ publikasi.judul }}</h5>
<p
class="text-light">{# {% if publikasi.div.div_icon %}
<img style="width:35px;" src="{{asset('uploads/') ~ publikasi.div.div_icon}}">
{% else %}
<img style="width:35px;" src="{{asset('assets/logo/kota_kediri.png')}}">
{% endif %} #}
</p>
<div class="row">
<div class="col-md-12">
<div class="text-light" style="margin-top: -7px;">
<i class="fa fa-building mr-2"></i>
{{ publikasi.div }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<div class="text-light mt-2">
<i class="fa fa-file-text mr-1"></i>
{{ kategori }}
</div>
</div>
<div class="col-md-3">
<div class="text-light fw-700 pull-right">
<i class="fa fa-download mr-1"></i>
{% if publikasi.jumlahDownload %}
{{ publikasi.jumlahDownload }}
{% else %}
0
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<div class="text-light mt-2">
<i class="fa fa-calendar mr-1"></i>
{{ publikasi.createdAt|date('d F Y') }}
</div>
</div>
<div class="col-md-3">
<div class="text-light fw-700 pull-right">
<i class="fa fa-eye mr-1"></i>
{{ publikasi.view }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="mt-4"></div>
<div class="app-box-card">
<div class="app-box-card__head d-flex justify-content-between align-items-center">
<h5 class="mb-0 fw-600">Meta Data</h6>
<div class="sosmed">
Bagikan :
<a href="https://www.facebook.com/sharer/sharer.php?u={{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
<i class="fa fa-facebook-square mr-2"></i>
</a>
<a href="https://twitter.com/intent/tweet?text={{ publikasi.judul }}&url={{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
<i class="fa fa-twitter-square mr-2"></i>
</a>
{# <a href="whatsapp://send?text={{ publikasi.judul }} {{app.request.getSchemeAndHttpHost()}}{{ path('dataset_detail', {id: publikasi.id}) }}" target="_blank">
<i class="fa fa-whatsapp mr-2"></i>
</a> #}
<a href="https://web.whatsapp.com/" target="_blank">
<i class="fa fa-whatsapp mr-2"></i>
</a>
{# <a href="{{ path('dataset_excel', {id:publikasi.id}) }}" class="btn btn-light bg-blue"><i class="fa fa-download mr-1" style="font-size: 13px;"></i>Unduh</a> #}
<div class="dropdown">
<button onclick="dropDown()" class="dropbtn bg-primary text-light">
<i class="fa fa-download mr-1" style="font-size: 13px;"></i>Unduh</button>
<div id="myDropdown" class="dropdown-content">
<a href="{{ path('dataset_excel', {id:publikasi.id, tipe:'xlsx'}) }}">
<i class="fas fa-file-excel mr-1" style="font-size: 13px;"></i>Spreadsheet</a>
<a href="{{ path('dataset_excel', {id:publikasi.id, tipe:'csv'}) }}">
<i class="fas fa-file-csv mr-1" style="font-size: 13px;"></i>CSV</a>
<a href="{{ path('api', {id: publikasi.id}) }}" target="_blank">
<i class="fas fa-gears mr-1" style="font-size: 13px;"></i>API</a>
<a href="{{ path('dataset_dcat', {id: publikasi.id}) }}" target="_blank">
<i class="fas fa-gears mr-1" style="font-size: 13px;"></i>CKAN DCAT</a>
</div>
</div>
</div>
</div>
<div class="app-box-card__body">
<div class="table-responsive mt-20">
<table class="table table-bordered table-addt">
<tbody>
<tr>
<td width="20%">Dataset Dibuat</td>
<th>{{ publikasi.createdAt|date('d F Y') }}</th>
<td>Satuan Dataset</td>
<th>{{ publikasi.satuan }}</th>
</tr>
<tr>
<td>Kode Dataset</td>
<th>{{ publikasi.kode }}</th>
<td>Periode Dataset</td>
<th>{{ publikasi.periode }}</th>
</tr>
<tr>
<td>Produsen</td>
<th>{{ publikasi.div }}</th>
<td>Sumber Dataset</td>
<th>{{ publikasi.sumber }}</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mb-5"></div>
<div class="app-box-card" style="margin-top: -25px;">
<div class="card-body">
<div class="app-box-card with-tabs">
<div class="app-box-card__head d-flex">
<ul class="nav nav-pills" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="nasional-tab" data-toggle="tab" href="#tabel" role="tab" aria-controls="data" aria-selected="true">Tabel</a>
</li>
<li class="nav-item">
<a class="nav-link" id="lokal-tab" data-toggle="tab" href="#grafik" role="tab" aria-controls="datamedia" aria-selected="false">Grafik</a>
</li>
{# <li class="nav-item">
<a class="nav-link" id="lokal-tab" data-toggle="tab" href="#peta" role="tab" aria-controls="datamedia" aria-selected="false">Peta</a>
</li> #}
</ul>
</div>
<div class="app-box-card__body">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tabel" role="tabpanel" aria-labelledby="versi-tab">
<div class="content">
{% if publikasi.jenis != 1 %}
<div class="table-responsive mt-30">
<table class="table table-bordered table-addt" id="" width="100%">
<thead>
<tr>
<th>Deskripsi</th>
<th>Rumus</th>
<th>Satuan</th>
<th colspan="{{ jumlah_tahun }}" style="text-align: center;">Tahun</th>
</tr>
<tr>
{% set i = 0 %}
<th></th>
<th></th>
<th></th>
{% for thn in tahun %}
<th style="text-align: center;">
{{thn.isi}}
</th>
{% set i = i + 1 %}
{% endfor %}
</tr>
</thead>
<tbody>
<tr>
<td>{{ publikasi.judul }}</td>
<td>{{ publikasi.rumus }}</td>
<td>{{ publikasi.satuan }}</td>
{% set temp_target = '' %}
{% set temp_real = '' %}
{% for res in result %}
<td style="text-align: center;">
{% set temp_target = res['target']['nilai'] %}
{% set temp_real = res['realisasi']['nilai'] %}
{{ temp_target }}<br>
{{ temp_real }}
</td>
{% endfor %}
</tr>
</tbody>
</table>
</div>
{% else %}
{% if variabel %}
<div class="table-responsive mt-30">
<table class="table table-bordered table-addt" id="table_ajax" width="100%">
<thead>
<tr>
{% for var in variabel %}
<th>{{ var.nama }}</th>
{% endfor %}
</tr>
<tr>
{% set i = 0 %}
{% for var in variabel %}
<th><input type="text" id="{{ var.nama }}" data-column="{{ i }}" class="search-input-text form-control"></th>
{% set i = i + 1 %}
{% endfor %}
</tr>
</thead>
<tbody></tbody>
</table>
</div>
{% endif %}
{% endif %}
</div>
</div>
<div class="tab-pane fade" id="grafik" role="tabpanel" aria-labelledby="metode-tab">
<div class="content">
<br>
<div class="row">
{% if grafik %}
{% if grafik.isShow == true %}
<div class="col-lg-1">Periode</div>
<div class="col-lg-3">
<div style="display:flex ;">
<div>
<select name="periode" id="periode">
{% for k, item in opt_periode %}
<option value="{{ item }}">{{ item }}</option>
{% endfor %}
</select>
</div>
<div style="margin-left:2px ;">
<select name="tahun" id="tahunx">
<option value="All">Semua</option>
{% for i in range( "now"|date("Y"), 2016 ) %}
<option value="{{i}}">{{i}}</option>
{% endfor %}
</select>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
<hr>
<div style="overflow-x: auto;">
{% if grafik %}
{% if grafik.isShow == true %}
{{ include('frontend/dataset/_chart.html.twig', {publikasi:publikasi, grafik:grafik}) }}
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card mt-50" style="background: whitesmoke;">
<div class="card-body">
<h5>Rekomendasi Dataset</h5>
<div class="content-rekom">
{% for dt in terkait %}
{% if dt.judul %}
<div class="d-block">
<i class="fa fa-angle-double-right"></i>
<a href="{{ path('dataset_detail', {id: dt.id}) }}">{{ dt.judul }}</a>
</div>
{% endif %}
{% else %}
<div class="d-block">
Tidak Ada Rekomendasi Dataset
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</section>
</main>
{% if variabel %}
{# <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.css"> #}
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.24/css/dataTables.bootstrap4.min.css">
<script src="{{ asset('frontend/js/jquery.min.js') }}"></script>
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.24/js/dataTables.bootstrap4.min.js"></script>
<script src="//code.highcharts.com/4.1.8/highcharts.js"></script>
<script src="//code.highcharts.com/4.1.8/modules/exporting.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
var dataTable = $('#table_ajax').DataTable({
"processing": true,
"bSortCellsTop": true,
"searching": false,
"serverSide": true,
"bLengthChange": false,
"ordering": false,
"scrollX": true,
"ajax": {
'url': "{{ path('dataset_dataset_table', {id: publikasi.id}) }}",
'type': 'POST',
'data': function (data) {
{% for val in variabel %}
{{ "data."|raw }}{{ val.nama }}{{ " = $('#"|raw }}{{ val.nama }}{{ "').val();"|raw }}
{% endfor %}
}
}
});
$('.search-input-text').on('keyup click', function () {
dataTable.draw();
});
})
</script>
{% endif %}
<script>
$('#periode').change(function () {
getDataChart();
});
$('#tahunx').change(function () {
getDataChart();
});
</script>
{% endblock %}