diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..175ed52 Binary files /dev/null and b/.DS_Store differ diff --git a/.env b/.env new file mode 100644 index 0000000..33d86f9 --- /dev/null +++ b/.env @@ -0,0 +1,46 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY=base64:kJqxmAbo0WxiIy/a1U0U807qcfgj+Dz7ZVrQHZaiJ84= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=pgsql +DB_HOST=localhost +DB_PORT=5432 +DB_DATABASE=dikplhd +DB_USERNAME=postgres +DB_PASSWORD=postgres + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/app/Helpers/custom.php b/app/Helpers/custom.php index 2089a6b..ac933d0 100644 --- a/app/Helpers/custom.php +++ b/app/Helpers/custom.php @@ -3,6 +3,8 @@ use App\Models\Master\Menu; use App\Models\Master\AccessMenu; use App\Models\User; use App\Models\Master\Group; +use App\Models\Master\Dataset; +use App\Models\Master\Topik; use App\Models\Log; if (!function_exists('taskLabel')) { @@ -325,4 +327,65 @@ if (!function_exists('include_files_in_folder')) { echo $e->getMessage(); } } +} +if (!function_exists('topikById')) { + function topikById($id){ + $keyId = decode_id($id); + $topik = Topik::find($keyId); + return $topik; + } +} + +if (!function_exists('topikByDataset')) { + function topikByDataset($json){ + + // $table = Dataset::find($id); + + $decode = json_decode($json); + + $res = "Belum ada data"; + if(count($decode) > 0){ + $res = []; + $d = ''; + foreach ($decode as $key => $value) { + if (($value !== null) && ($value !== "")) { + $d .= ''.topikById($value)->name.' '; + } + + } + // $d .= ''; + array_push($res, $d); + + $res = implode("", $res); + } + + return $res; + } +} + +if (!function_exists('tags')) { + function tags($json){ + + // $table = Dataset::find($id); + + $decode = json_decode($json); + + $res = "Belum ada data"; + if(count($decode) > 0){ + $res = []; + $d = ''; + foreach ($decode as $key => $value) { + if (($value !== null) && ($value !== "")) { + $d .= ''.$value.' '; + } + + } + // $d .= ''; + array_push($res, $d); + + $res = implode("", $res); + } + + return $res; + } } \ No newline at end of file diff --git a/app/Http/Controllers/Opendata/DatasetController.php b/app/Http/Controllers/Opendata/DatasetController.php index 4cd0695..34d8842 100644 --- a/app/Http/Controllers/Opendata/DatasetController.php +++ b/app/Http/Controllers/Opendata/DatasetController.php @@ -39,41 +39,85 @@ class DatasetController extends Controller public function grid(Request $request) { - $data = Dataset::all(); - // $data = User::with(['group'])->orderBy('id','DESC')->get(); - $_data = []; + // $data = Dataset::all(); + // // $data = User::with(['group'])->orderBy('id','DESC')->get(); + // $_data = []; - foreach ($data as $key => $row) { + // foreach ($data as $key => $row) { - $action = ''; + // $action = ''; - if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){ - $action .= '
'; - $action .= ''; - $action .= ''; - if(session('group_id') == 1){ - // $action .= ''; - // $action .= ''; - } - $action .= '
'; - } + // if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){ + // $action .= '
'; + // $action .= ''; + // $action .= ''; + // if(session('group_id') == 1){ + // // $action .= ''; + // // $action .= ''; + // } + // $action .= '
'; + // } - $_data[] = [ - 'no' => $key+1, - 'id' => encode_id($row->id), - 'name' => @$row->name, - 'publik' => @$row->publik, - 'created_at' => date('d-m-Y H:i:s',strtotime(@$row->created_at)), - 'instansi' => @$row->instansi->name, - 'action' => @$action, - ]; + // $_data[] = [ + // 'no' => $key+1, + // 'id' => encode_id($row->id), + // 'name' => @$row->name, + // 'publik' => @$row->publik, + // 'created_at' => date('d-m-Y H:i:s',strtotime(@$row->created_at)), + // 'instansi' => @$row->instansi->name, + // 'action' => @$action, + // ]; - } + // } - // return response()->json($_data); // Return the data as a JSON response - return response()->json($_data); + // // return response()->json($_data); // Return the data as a JSON response + // return response()->json($_data); + + // $perPage = $request->query('limit', 10); + // $page = $request->query('page', 1); + // // dd($page); + // $search = $request->query('search'); + $id = $request->query('id'); + $keyId = decode_id($id); + $item = Dataset::find($keyId); // atau pakai ->pluck(), ->find(), dll + + $json = json_decode($item->data, true); + $limit = $request->input('limit', 10); + $offset = $request->input('offset', 0); + + $rows = array_slice($json, $offset, $limit); + return response()->json([ + 'total' => count($json), + 'rows' => $rows + ]); + + // // Ambil JSON dari kolom database + // $rawData = Dataset::find($keyId)->data; // atau pakai ->pluck(), ->find(), dll + // $array = json_decode($rawData, true); // array dari JSON + // $collection = collect($array); + + // if ($search) { + // $collection = $collection->filter(function ($item) use ($search) { + // foreach ($item as $value) { + // if (stripos($value, $search) !== false) { + // return true; + // } + // } + // return false; + // }); + // } + + // $total = $collection->count(); + + // $paginated = $collection->slice(($page - 1) * $perPage, $perPage)->values(); + + // return response()->json([ + // 'data' => $paginated, + // 'page' => $page, + // 'total' => $total + // ]); } diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 0000000..9b19b93 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1 @@ +*.sqlite* diff --git a/public/.DS_Store b/public/.DS_Store new file mode 100644 index 0000000..11478e1 Binary files /dev/null and b/public/.DS_Store differ diff --git a/public/assets/.DS_Store b/public/assets/.DS_Store new file mode 100644 index 0000000..6f13ee5 Binary files /dev/null and b/public/assets/.DS_Store differ diff --git a/public/uploads/dataset/2025/06/17/_file_6850e3ed7258e.xlsx b/public/uploads/dataset/2025/06/17/_file_6850e3ed7258e.xlsx new file mode 100644 index 0000000..350850e Binary files /dev/null and b/public/uploads/dataset/2025/06/17/_file_6850e3ed7258e.xlsx differ diff --git a/resources/.DS_Store b/resources/.DS_Store new file mode 100644 index 0000000..7d91215 Binary files /dev/null and b/resources/.DS_Store differ diff --git a/resources/views/.DS_Store b/resources/views/.DS_Store new file mode 100644 index 0000000..76c9f1b Binary files /dev/null and b/resources/views/.DS_Store differ diff --git a/resources/views/modules/.DS_Store b/resources/views/modules/.DS_Store new file mode 100644 index 0000000..8771b7d Binary files /dev/null and b/resources/views/modules/.DS_Store differ diff --git a/resources/views/modules/management/user/.DS_Store b/resources/views/modules/management/user/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/resources/views/modules/management/user/.DS_Store differ diff --git a/resources/views/modules/opendata/dataset/view.blade.php b/resources/views/modules/opendata/dataset/view.blade.php index 8478e13..67d82d3 100644 --- a/resources/views/modules/opendata/dataset/view.blade.php +++ b/resources/views/modules/opendata/dataset/view.blade.php @@ -1,4 +1,6 @@ @extends('layouts.master') +@section('css') +@endsection @section('content')
@@ -7,153 +9,75 @@

{{$title}}

-
- {{csrf_field()}} - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Instansi{{$item->instansi->name}}
Resource Data{{$item->template->name}}
Nama Dataset{{$item->name}}
Sifat Dataset - @if($item->publik == 1) - Terbuka/Publik - @else - Rahasia/Private - @endif -
Tags{{$item->tags}}
File :  Download File
Topik{{$item->topik}}
Deskripsi{{$item->deskripsi}}
- data); - ?> - - - - @if (!empty($data)) - @foreach ($data[0] as $k => $key) - - @endforeach +
+
+
{{ ucwords(str_replace('_', ' ', $k)) }}
+ + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + +
Instansi{{$item->instansi->name}}
Resource Data{{$item->template->name}}
Nama Dataset{{$item->name}}
Sifat Dataset + @if($item->publik == 1) + Terbuka/Publik + @else + Rahasia/Private @endif -
Tags{!!tags($item->tags)!!}
File :  Download File
Topik{!! topikByDataset($item->topik)!!}
Deskripsi{{$item->deskripsi}}
+ data); + ?> + + + + + @if (!empty($data)) - @foreach ($data as $row) - - @foreach ($row as $value) - - @endforeach - + @foreach ($data[0] as $k => $key) + @endforeach @endif - -
{{ $value ?? '-' }}
{{ ucwords(str_replace('_', ' ', $k)) }}
-
+ + +
-
+ @endsection @section('js') - - @endsection \ No newline at end of file diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore new file mode 100644 index 0000000..05c4471 --- /dev/null +++ b/storage/framework/.gitignore @@ -0,0 +1,9 @@ +compiled.php +config.php +down +events.scanned.php +maintenance.php +routes.php +routes.scanned.php +schedule-* +services.json diff --git a/vendor/hamcrest/hamcrest-php/.gitignore b/vendor/hamcrest/hamcrest-php/.gitignore new file mode 100644 index 0000000..987e2a2 --- /dev/null +++ b/vendor/hamcrest/hamcrest-php/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/vendor/mockery/mockery/docs/.gitignore b/vendor/mockery/mockery/docs/.gitignore new file mode 100644 index 0000000..e35d885 --- /dev/null +++ b/vendor/mockery/mockery/docs/.gitignore @@ -0,0 +1 @@ +_build diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore new file mode 100644 index 0000000..b2395aa --- /dev/null +++ b/vendor/psr/container/.gitignore @@ -0,0 +1,3 @@ +composer.lock +composer.phar +/vendor/ diff --git a/vendor/psr/event-dispatcher/.gitignore b/vendor/psr/event-dispatcher/.gitignore new file mode 100644 index 0000000..3a9875b --- /dev/null +++ b/vendor/psr/event-dispatcher/.gitignore @@ -0,0 +1,2 @@ +/vendor/ +composer.lock