<?php
namespace App\Controller\Frontend;
use App\Controller\Base\BaseController;
use App\Entity\MKategoriDetail;
use App\Entity\TData;
use App\Entity\TPermohonan;
use App\Entity\TPublikasi;
use App\Entity\TVariabel;
use App\Form\TPermohonanType;
use App\Repository\MKategoriDetailRepository;
use App\Repository\MKategoriRepository;
use App\Repository\MSektorRepository;
use App\Repository\MUrusanDetailRepository;
use App\Repository\TDataRepository;
use App\Repository\MUrusanRepository;
use App\Repository\TDivRepository;
use App\Repository\TGrafikRepository;
use App\Repository\TPermohonanRepository;
use App\Repository\TPublikasiRepository;
use App\Repository\TVariabelRepository;
use Doctrine\Persistence\ManagerRegistry;
use Knp\Component\Pager\PaginatorInterface;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Writer\Csv;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Sonata\SeoBundle\Seo\SeoPageInterface;
use Kematjaya\Export\Manager\ManagerInterface;
use Kematjaya\Export\Processor\Excel\SpreadsheetFromArrayProcessor;
class DatasetController extends BaseController
{
/**
* @Route("/dataset", name="dataset", methods={"POST", "GET"})
*/
public function index(
SeoPageInterface $seoPage,
Request $request,
MKategoriRepository $mKategoriRepo,
MKategoriDetailRepository $mKategoriDetailRepo,
PaginatorInterface $paginatorInterface,
TDivRepository $tDivRepo,
MSektorRepository $mSektorRepo,
MUrusanRepository $mUrusanRepo,
MUrusanDetailRepository $mUrusanDetailRepository,
TPublikasiRepository $tPublikasiRepository
): Response {
$seoPage->addTitlePrefix("Dataset");
$queryBuilder = $this->getQueryBuilder(TPublikasi::class);
// if ($request->get('kategori')){
// $queryBuilder = $queryBuilder
// ->join(MKategoriDetail::class, 'k', 'WITH', 'k.reff_id = this.id')
// ->andWhere("k.reff_name = 'PUBLIKASI'")
// ->andWhere('k.kategori = ' . $request->get('kategori'));
// }
$queryBuilder = $queryBuilder
->andWhere("this.status = 3");
if ($request->get('judul')) {
$queryBuilder = $queryBuilder->andWhere("lower(this.judul) LIKE lower('%" . $request->get('judul', '') . "%')");
}
if ($request->get('opd')) {
$queryBuilder = $queryBuilder->andWhere("this.div = " . $request->get('opd'));
}
if ($request->get('sektor')) {
$queryBuilder = $queryBuilder->andWhere("this.sektor = " . $request->get('sektor'));
}
$queryBuilder = $queryBuilder->addOrderBy('this.id', 'desc');
// dump($queryBuilder->getQuery()->getResult());exit;
$pagination = $paginatorInterface->paginate($queryBuilder, $request->query->getInt('page', 1), 10);
$kategori = array();
$icons = array();
foreach ($pagination as $pub) {
$kategori_detail = $mUrusanDetailRepository->findBy(['reff_id' => $pub->getId(), 'reff_name' => 'PUBLIKASI'], ['id' => 'ASC']);
if ($kategori_detail) {
$icons[$pub->getId()] = ($kategori_detail[0]->getUrusan()->getIcon()) ? $kategori_detail[0]->getUrusan()->getIcon() : '';
$temp = array();
foreach ($kategori_detail as $kat) {
$temp[] = $kat->getUrusan()->getNama();
}
$kategori[$pub->getId()] = implode(', ', $temp);
} else {
$kategori[$pub->getId()] = '-';
$icons[$pub->getId()] = null;
}
}
$list_sektor = $mSektorRepo->findAll();
$list_div = $tDivRepo->findAll();
$urusan = $mUrusanRepo->findBy([], ['id' => 'asc']);
// dump($urusan); exit;
$total_pub = $tPublikasiRepository->findBy(['status' => 3], ['id' => 'desc']);
$total_pub = count($total_pub);
return $this->render('frontend/dataset/index.html.twig', [
'controller_name' => 'DatasetController',
'header_kategori' => $this->getHeaderKategori(),
// 'publikasi' => $publikasi,
'pagination' => $pagination,
'kategori' => $kategori,
'icons' => $icons,
'list_sektor' => $list_sektor,
'list_div' => $list_div,
'total_pub' => $total_pub,
'search' => array('judul' => $request->get('judul', ''), 'opd' => $request->get('opd'), 'sektor' => $request->get('sektor')),
'urusan' => $urusan,
]);
}
/**
* @Route("/dataset/{id}/detail", name="dataset_detail", methods={"GET"})
*/
public function detail(
?string $id,
Request $request,
TPublikasiRepository $tPublikasiRepo,
MKategoriDetailRepository $mKategoriDetailRepo,
TVariabelRepository $tVariabelRepo,
TGrafikRepository $tGrafikRepo
) {
$publikasi = $tPublikasiRepo->find($id);
$publikasi->setView($publikasi->getView() + 1);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($publikasi);
$entityManager->flush();
$kategori_detail = $mKategoriDetailRepo->findBy(['reff_id' => $publikasi->getId(), 'reff_name' => 'PUBLIKASI'], ['id' => 'ASC']);
$kategori = '';
if ($kategori_detail) {
$temp = array();
foreach ($kategori_detail as $kat) {
$temp[] = $kat->getKategori()->getNama();
}
$kategori = implode(', ', $temp);
} else {
$kategori = '';
}
if ($publikasi->getUrusan()) {
$terkait = $this->getQueryBuilder(TPublikasi::class)
->andWhere("this.id != " . $publikasi->getId())
// ->andWhere("this.div = " .$publikasi->getDiv()->getId())
->andWhere("this.urusan = " . $publikasi->getUrusan()->getId())
->orderBy('this.view', 'desc')->setMaxResults(5)
->getQuery()->getResult();
} else {
$terkait = '';
}
$opt_periode = $this->getPeriodeName($publikasi->getPeriode()->getId());
$variabel = $tVariabelRepo->findBy(['pub' => $publikasi->getId(), 'is_tampil' => true], ['id' => 'ASC']);
$grafik = $tGrafikRepo->findOneBy(['pub' => $publikasi->getId()]);
$grafik_info = [];
if ($grafik) {
$variabel_x = $tVariabelRepo->find($grafik->getAxisX());
// $variabel_y = $tVariabelRepo->find($grafik->getAxisY());
$grafik_info = [
'title' => $grafik->getJudul(),
'tipe' => $grafik->getTipe(),
'varX' => $variabel_x->getNama(),
// 'varY' => $variabel_y->getNama()
];
}
if ($publikasi->getJenis() != 1) {
$queryBuilderTahun = $this->getQueryBuilder(TData::class);
$queryBuilderTahun = $queryBuilderTahun
->join(TVariabel::class, 'v', 'WITH', 'v.id = this.variabel')
->andWhere("this.pub = " . $publikasi->getId())
->andWhere("v.nama = 'tahun'");
$queryBuilderTahun = $queryBuilderTahun->addOrderBy('this.id', 'asc');
$tahun = $queryBuilderTahun->getQuery()->getResult();
$result = [];
$ids = 0;
foreach ($tahun as $thn) {
$result[$ids++]['tahun'] = $thn->getIsi();
}
$queryBuilderTarget = $this->getQueryBuilder(TData::class);
$queryBuilderTarget = $queryBuilderTarget
->join(TVariabel::class, 'v', 'WITH', 'v.id = this.variabel')
->andWhere("this.pub = " . $publikasi->getId())
->andWhere("v.nama = 'target'");
$queryBuilderTarget = $queryBuilderTarget->addOrderBy('this.id', 'asc');
$targets = $queryBuilderTarget->getQuery()->getResult();
$ids = 0;
// it should pushed to server
if (!empty($targets)) {
foreach ($targets as $target) {
$result[$ids++]['target'] = ['id'=> $target->getId(),'nilai' => $target->getIsi()];
}
} else {
$target = null;
}
$queryBuilderRealisasi = $this->getQueryBuilder(TData::class);
$queryBuilderRealisasi = $queryBuilderRealisasi
->join(TVariabel::class, 'v', 'WITH', 'v.id = this.variabel')
->andWhere("this.pub = " . $publikasi->getId())
->andWhere("v.nama = 'realisasi'");
$queryBuilderRealisasi = $queryBuilderRealisasi->addOrderBy('this.id', 'asc');
$realisasi = $queryBuilderRealisasi->getQuery()->getResult();
$ids = 0;
foreach ($realisasi as $real) {
$result[$ids++]['realisasi'] = ['id'=> $real->getId(),'nilai' => $real->getIsi()];
}
$jumlah_tahun = count($tahun);
// dump($result); exit;
}else{
$tahun = null;
$target = null;
$realisasi = null;
$result = null;
$jumlah_tahun = null;
}
return $this->render('frontend/dataset/detail.html.twig', [
'controller_name' => 'DatasetController',
'header_kategori' => $this->getHeaderKategori(),
'publikasi' => $publikasi,
'kategori' => $kategori,
'variabel' => $variabel,
'terkait' => $terkait,
'grafik' => $grafik,
'result' => $result,
'target' => $target,
'realisasi' => $realisasi,
'tahun' => $tahun,
'jumlah_tahun' => $jumlah_tahun,
'opt_periode' => $opt_periode,
'grafik_info' => $grafik_info,
]);
}
/**
* @Route("/dataset/request/{id}", defaults={"id"= null}, name="dataset_form", methods={"POST", "GET"})
*/
public function form(?string $id = null, Request $request, TPermohonanRepository $tPermohonanRepository)
{
if ($id) {
$permohonan = $tPermohonanRepository->find($id);
} else {
$permohonan = new TPermohonan();
}
if (!$permohonan) {
throw new NotFoundHttpException();
}
$form = $this->createForm(TPermohonanType::class, $permohonan, ['action' => $this->generateUrl('dataset_form', ['id' => $permohonan->getId()])]);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$user = $form->getData();
$user->setisDone(false);
$user->setCreatedAt(new \DateTime());
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($user);
$entityManager->flush();
$this->addFlash('notice', 'Berhasil dikirim');
return $this->redirectToRoute('dataset');
}
return $this->render('/frontend/dataset/form.html.twig', [
'form' => $form->createView(),
'header_kategori' => $this->getHeaderKategori(),
]);
}
/**
* @Route("/dataset/{id}/dataset_table", name="dataset_dataset_table", methods={"GET", "POST"})
*/
public function dataset_table(?string $id, Request $request, ManagerRegistry $managerRegistry)
{
$item_per_page = $_POST['length'];
$page = ($_POST['start'] / $item_per_page) + 1;
$page = ($page - 1) * 10;
$dataset = $this->getDataTableFront($managerRegistry, $id, 10, $page, $_POST);
$jumlah = count($this->getDataTableFront($managerRegistry, $id, null, null, $_POST));
$arrJson['aaData'] = $dataset;
$arrJson['iTotalRecords'] = $jumlah;
$arrJson['iTotalDisplayRecords'] = $jumlah;
return new JsonResponse($arrJson);
}
/**
* @Route("/dataset/{id}/{tipe}/download_excel", name="dataset_excel", methods={"GET", "POST"})
*/
public function downloadExcel(?string $id, string $tipe, TPublikasiRepository $tPublikasiRepo, TVariabelRepository $tVariabelRepo)
{
$publikasi = $tPublikasiRepo->find($id);
$jumlah_download = ($publikasi->getJumlahDownload()) ? $publikasi->getJumlahDownload() + 1 : 0;
$publikasi->setJumlahDownload($jumlah_download + 1);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($publikasi);
$entityManager->flush();
$variabel = $tVariabelRepo->findBy(['pub' => $id, 'is_tampil' => true], ['id' => 'asc']);
$dataset = $this->getDataTable($id, null, null, null);
$styleFontCenter = array(
'alignment' => array('horizontal' => Alignment::HORIZONTAL_CENTER)
);
$styleBorder = array(
'borders' => array(
'allBorders' => array(
'borderStyle' => Border::BORDER_THIN,
)
)
);
$styleFontBold = array(
'font' => array('bold' => true)
);
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$cols = "A";
foreach ($variabel as $var) {
$sheet->getColumnDimension($cols)->setAutoSize(true);
$sheet->getCell($cols . '1')->setValue($var->getNama());
if ($tipe == 'xlsx') {
$sheet->getStyle($cols . '1')->applyFromArray($styleFontBold);
$sheet->getStyle($cols . '1')->applyFromArray($styleFontCenter);
$sheet->getStyle($cols . '1')->applyFromArray($styleBorder);
}
$cols++;
}
// $cols = chr(ord($cols) - 1);
$cols = "A";
if ($tipe == 'xlsx') {
foreach ($variabel as $var) {
$sheet->getStyle($cols . '2:' . $cols . (count($dataset) + 1))->applyFromArray($styleBorder);
$cols++;
}
}
$sheet->fromArray($dataset, null, 'A2');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="' . substr($publikasi->getJudul(), 0, 30) . '.' . $tipe . '"');
if ($tipe == 'xlsx') {
$writer = new Xlsx($spreadsheet);
} else {
$writer = new Csv($spreadsheet);
$writer->setDelimiter(';');
$writer->setEnclosure('"');
$writer->setLineEnding("\r\n");
}
$writer->save("php://output");
exit;
// return $this->redirectToRoute('dataset_detail', ['id' => $id]);
}
/**
* @Route("/dataset/{id}/{tipe}/download_excel_kmj", name="dataset_excel_kmj", methods={"GET", "POST"})
*/
public function downloadExcelKmj(
?string $id,
string $tipe,
TPublikasiRepository $tPublikasiRepo,
TVariabelRepository $tVariabelRepo,
ManagerInterface $managerInterface
) {
$publikasi = $tPublikasiRepo->find($id);
$variabel = $tVariabelRepo->findBy(['pub' => $id, 'is_tampil' => true], ['id' => 'asc']);
$dataset = $this->getDataTable($id, null, null, null);
foreach ($variabel as $var) {
$vars[] = $var->getNama();
}
array_unshift($dataset, $vars);
$filename = substr($publikasi->getJudul(), 0, 30) . ".xlsx";
$arrayToExcel = $managerInterface->render($dataset, new SpreadsheetFromArrayProcessor('peringkat_pd.xlsx'));
return $arrayToExcel;
}
/**
* @Route("/dataset/{id}/chartJson", name="dataset_chart_json", methods={"POST", "GET"})
*/
public function chartJson(
Request $request,
TPublikasi $tPublikasi,
TPublikasiRepository $tPublikasiRepo,
TGrafikRepository $tGrafikRepo,
TVariabelRepository $tVariabelRepo,
TDataRepository $tDataRepo
) {
$detail = $tPublikasiRepo->find($tPublikasi);
$sel_periode = $request->get('periode');
$grafik = $tGrafikRepo->findOneBy(['pub' => $detail->getId()]);
$varYs = [];
foreach ($grafik->getAxisYIds() as $axisY) {
$varYs[$axisY] = $tVariabelRepo->find($axisY);;
}
$period = explode(" ", $sel_periode);
if ($period[1] == 'All') {
$opt_periode = $this->getPeriodeName($detail->getPeriode()->getId());
foreach ($opt_periode as $k => $v) {
if ($period[0] == $v) {
$periodex = $k;
}
}
} else {
$periodex = $period[0] . ' ' . $period[1];
}
$data_chart = $this->getTabelGrafik($detail->getId(), $varYs, $sel_periode);
$var = $tVariabelRepo->find($grafik->getAxisX());
if ($var && $var->getNama() == 'periode_update') {
if ($period[1] == 'All') {
$queryBuilder = $this->getQueryBuilder(TData::class);
$queryBuilder = $queryBuilder->andWhere("lower(this.isi) LIKE lower('%" . $period[1] . "%')");
$queryBuilder = $queryBuilder->andWhere("this.pub = " . $detail->getId());
$queryBuilder = $queryBuilder->andWhere("this.variabel = " . $grafik->getAxisX());
$queryBuilder = $queryBuilder->addOrderBy('this.id', 'desc');
$tdataKategori = $queryBuilder->getQuery()->getResult();
} else {
$tdataKategori = $tDataRepo->findBy(['pub' => $detail->getId(), 'variabel' => $grafik->getAxisX(), 'isi' => $periodex], ['id' => 'asc']);
}
} else if ($var && $var->getNama() == 'tahun') {
if ($period[1] == 'All') {
$queryBuilder = $this->getQueryBuilder(TData::class);
// $queryBuilder = $queryBuilder->andWhere("lower(this.isi) LIKE lower('%" . $period[1] . "%')");
// $queryBuilder = $queryBuilder->andWhere("this.isi = " . $period[1]);
$queryBuilder = $queryBuilder->andWhere("this.pub = " . $detail->getId());
$queryBuilder = $queryBuilder->andWhere("this.variabel = " . $grafik->getAxisX());
$queryBuilder = $queryBuilder->addOrderBy('this.id', 'asc');
$tdataKategori = $queryBuilder->getQuery()->getResult();
} else {
$tdataKategori = $tDataRepo->findBy(['pub' => $detail->getId(), 'variabel' => $grafik->getAxisX(), 'isi' => $period[1]], ['id' => 'asc']);
}
} else {
$tdataKategori = $tDataRepo->findBy(['pub' => $detail->getId(), 'variabel' => $grafik->getAxisX()], ['id' => 'asc']);
}
$data_kategori = array();
foreach ($tdataKategori as $td) {
$data_kategori[] = $td->getIsi();
}
// dump($data_kategori); exit;
$data_kategori = array();
foreach ($tdataKategori as $td) {
$data_kategori[] = $td->getIsi();
}
// $json = ['columns' => $data_kategori, 'datas' => $data_chart];
$datas = [];
foreach ($data_chart as $dchart) {
foreach ($dchart as $k => $v) {
$datas[$k]["name"] = $k;
$datas[$k]["data"][] = floatval($v);
}
}
unset($datas['periode_order']);
unset($datas['periode_update']);
$datas = array_values($datas);
// dump($datas); exit;
// $datas[] = [
// "name" => "kat1",
// "data" => [70, 72, 71, 74, 73]
// ];
// $datas[] = [
// "name" => "kat2",
// "data" => [80, 82, 81, 84, 83]
// ];
$json = ['columns' => $data_kategori, 'datas' => $datas];
return $this->json($json);
}
/**
* @Route("/dataset/{id}/dcat", name="dataset_dcat", methods={"POST", "GET"})
*/
public function dcat(?string $id, TPublikasiRepository $tPublikasiRepo)
{
header('Content-Type: application/json');
$data = array(
"@context" => "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"@id" => "http://103.20.91.54:8007/data.json",
"@type" => "dcat:Catalog",
"conformsTo" => "https://project-open-data.cio.gov/v1.1/schema",
"describedBy" => "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
);
$dataset = [];
$publikasi = [$tPublikasiRepo->find($id)];
foreach ($publikasi as $pub) {
$dataset[] = [
"@type" => "dcat:Dataset",
"accessLevel" => "public",
"contactPoint" => [
"fn" => "Rustam",
"hasEmail" => "mailto:noemailprovided@usa.gov"
],
"distribution" => [
[
"@type" => "dcat:Distribution",
"downloadURL" => "http://103.20.91.54:8007/frontend/dataset/" . $pub->getId() . "/csv/download_excel",
"mediaType" => "text/csv",
"format" => "csv",
"title" => $pub->getJudul()
]
],
"identifier" => md5($pub->getId()),
"issued" => "-",
"landingPage" => "http://103.20.91.54:8007/dataset/" . $pub->getId() . "/detail",
"modified" => $pub->getCreatedAt()->format("Y-m-d"),
"publisher" => [
"@type" => "org:Organization",
"name" => "http://103.20.91.54:8007/"
],
"title" => $pub->getJudul(),
"description" => $pub->getDeskripsi() ? strip_tags($pub->getDeskripsi()) : "",
"keyword" => $pub->getKeyword() ? implode(",", $pub->getKeyword()) : []
];
}
$data['dataset'] = $dataset;
return $this->json($data);
}
public function getDataTableFront($managerRegistry, $id, $limit, $page, $get, $state = null, $row = null)
{
$connection = $managerRegistry->getConnection();
// $connection = DriverManager::getConnection($this->connParams);
$tbl_func = "CREATE EXTENSION IF NOT EXISTS tablefunc; ";
$stmt = $connection->prepare($tbl_func);
$stmt->execute();
$variabel_repo = $managerRegistry->getRepository(TVariabel::class);
$variabel = $variabel_repo->findBy(['pub' => $id, 'is_tampil' => true], ['id' => 'asc']);
$as_columns = "";
foreach ($variabel as $var) {
$as_columns .= ", " . $var->getNama() . " text";
}
$sql = "SELECT * FROM crosstab('select a.row_id, b.id, a.isi
from t_data a
join t_variabel b
on a.variabel_id = b.id
where a.pub_id = " . $id . " and b.is_tampil is true ";
$sql .= " order by 1, 2')
AS ct (row_id int" . $as_columns . ") where 1=1";
if ($row) {
$sql .= " and row_id = " . $row;
}
if ($get) {
foreach ($variabel as $var) {
if ($value = $get[$var->getNama()]) {
$sql .= " and " . $var->getNama() . " ILIKE '%" . $value . "%'";
}
}
}
if ($limit) {
$sql .= " LIMIT " . $limit;
}
if ($page) {
$sql .= " OFFSET " . $page;
}
$stmt = $connection->prepare($sql);
$stmt->execute();
$result = array();
foreach ($stmt->fetchAll() as $data) {
$temp = array();
if ($state) {
$temp['id'] = $data['row_id'];
}
foreach ($variabel as $var) {
$temp[] = $data[$var->getNama()];
}
$result[] = $temp;
}
// print_r($result);exit;
return $result;
}
/**
* @Route("/dataset/urusan/{id}", name="dataset_urusan", methods={"GET"})
*/
public function datasetUrusan(
int $id,
Request $request,
MUrusanRepository $mUrusanRepo,
MSektorRepository $mSektorRepository,
TPublikasiRepository $tPublikasiRepository
) {
$urusan = $mUrusanRepo->findBy([], ['id' => 'asc']);
$sektor = $mSektorRepository->findBy(['urusan' => $id]);
$dataset = [];
foreach ($sektor as $sk) {
$dataset[$sk->getId()] = $tPublikasiRepository->findBy(['sektor' => $sk->getId()], ['id' => 'desc'], 5);
}
// dump($sektor);
// exit;
return $this->render('/frontend/dataset/dataset_urusan.html.twig', [
'sektor' => $sektor,
'urusan' => $urusan,
'dataset' => $dataset,
// 'search' => array('judul'=>$request->get('judul', ''), 'opd'=>$request->get('opd'), 'sektor' => $request->get('sektor')),
]);
}
/**
* @Route("/dataset/detail_urusan/{id}", name="detail_dataset_urusan", methods={"GET"})
*/
public function detailDatasetUrusan(int $id, Request $request, MSektorRepository $mSektorRepository, TPublikasiRepository $tPublikasiRepository, PaginatorInterface $paginatorInterface)
{
$sektor = $mSektorRepository->find($id);
$queryBuilder = $this->getQueryBuilder(TPublikasi::class);
$queryBuilder = $queryBuilder->andWhere("this.status = 3");
$queryBuilder = $queryBuilder->andWhere("this.sektor = " . $sektor->getId());
if ($request->get('judul')) {
$queryBuilder = $queryBuilder->andWhere("lower(this.judul) LIKE lower('%" . $request->get('judul', '') . "%')");
}
$queryBuilder = $queryBuilder->addOrderBy('this.id', 'desc');
// dump($queryBuilder->getQuery()->getResult());exit;
$pagination = $paginatorInterface->paginate($queryBuilder, $request->query->getInt('page', 1), 10);
return $this->render('/frontend/dataset/detail_dataset_urusan.html.twig', [
'sektor' => $sektor,
'pagination' => $pagination
]);
}
}