From cc00af9ed36ccf98185a2e35039f376ac0a675d5 Mon Sep 17 00:00:00 2001 From: Ilham Wara Nugroho Date: Mon, 6 Apr 2026 14:08:35 +0700 Subject: [PATCH] update --- .../Activity/FormAdaptasiController.php | 20 +- .../Activity/FormMitigasiController.php | 21 +- app/Models/EmissionReductionMitigation.php | 9 +- app/Models/KegiatanMitigasi.php | 38 +- .../EmissionReductionRepository.php | 17 +- app/Services/Activity/FormMitigasiService.php | 2 +- composer.json | 1 + composer.lock | 524 +++++++++++++++++- config/dompdf.php | 301 ++++++++++ .../views/auth/dashboard-adaptation.blade.php | 4 +- resources/views/layouts/master.blade.php | 1 + .../modules/form/index-adaptasi.blade.php | 30 +- .../modules/form/index-mitigasi.blade.php | 187 +++++-- routes/modules/modules.php | 11 +- 14 files changed, 1025 insertions(+), 141 deletions(-) create mode 100644 config/dompdf.php diff --git a/app/Http/Controllers/Activity/FormAdaptasiController.php b/app/Http/Controllers/Activity/FormAdaptasiController.php index 27b70fd..9c7c96f 100644 --- a/app/Http/Controllers/Activity/FormAdaptasiController.php +++ b/app/Http/Controllers/Activity/FormAdaptasiController.php @@ -31,7 +31,7 @@ class FormAdaptasiController extends Controller 'penurunan' => $km->emission_factor, ]; - return view('form.index-adaptasi-thankyou', compact('data', 'km')); + return view('modules.form.index-adaptasi-thankyou', compact('data', 'km')); } public function downloadPDF(string $id) @@ -51,7 +51,7 @@ class FormAdaptasiController extends Controller 'penurunan' => $km->emission_factor, ]; - $pdf = PDF::loadView('form.index-adaptasi.pdf', compact('data')) + $pdf = PDF::loadView('modules.form.index-adaptasi-pdf', compact('data')) ->setPaper('a4', 'portrait'); return $pdf->download('bukti-submission-'.$km->nama_kegiatan.'.pdf'); @@ -84,7 +84,7 @@ class FormAdaptasiController extends Controller 'detail_kegiatan' => $ka->detail_kegiatan, ]; - return view('form.index-adaptasi-view', [ + return view('modules.form.index-adaptasi-view', [ 'sessionData' => $sessionData, 'id' => $id, ]); @@ -126,7 +126,7 @@ class FormAdaptasiController extends Controller $sectors = KegiatanAdaptasi::distinct()->pluck('sektor')->toArray(); - return view('form.index-adaptasi-edit', [ + return view('modules.form.index-adaptasi-edit', [ 'sessionData' => $sessionData, 'years' => $years, 'currentYear' => $currentYear, @@ -148,7 +148,7 @@ class FormAdaptasiController extends Controller $years = range($startYear, $currentYear); rsort($years); - return view('form.index-adaptasi', compact('sessionData', 'years', 'currentYear')); + return view('modules.form.index-adaptasi', compact('sessionData', 'years', 'currentYear')); } public function update(Request $request, $id) @@ -195,9 +195,10 @@ class FormAdaptasiController extends Controller return response()->json([ 'success' => true, - 'redirect' => route('formAdaptasi.thankYou', $id), + 'redirect' => route('modules.formAdaptasi.thankYou', $id), ]); } catch(\Exception $e) { + // dd($e->getMessage()); Log::error('Error updating data: ' . $e->getMessage()); return back()->with('error', 'Gagal mengupdate data. Silakan coba lagi.'); } @@ -302,11 +303,12 @@ class FormAdaptasiController extends Controller return response()->json([ 'success' => true, - 'redirect' => route('formAdaptasi.thankYou', $adaptasiId), + 'redirect' => route('modules.formAdaptasi.thankYou', $adaptasiId), ]); } catch (\Exception $e) { - Log::error('Error storing final data: ' . $e->getMessage()); - return back()->with('error', 'Gagal menyimpan data. Silakan coba lagi.'); + dd($e->getMessage()); + // Log::error('Error storing final data: ' . $e->getMessage()); + // return back()->with('error', 'Gagal menyimpan data. Silakan coba lagi.'); } } diff --git a/app/Http/Controllers/Activity/FormMitigasiController.php b/app/Http/Controllers/Activity/FormMitigasiController.php index 4a71293..ce852a5 100644 --- a/app/Http/Controllers/Activity/FormMitigasiController.php +++ b/app/Http/Controllers/Activity/FormMitigasiController.php @@ -64,7 +64,7 @@ class FormMitigasiController extends Controller 'penurunan' => $km->emission_factor, ]; - return view('form.index-mitigasi-thankyou', compact('data', 'km')); + return view('modules.form.index-mitigasi-thankyou', compact('data', 'km')); } public function downloadPDF(string $id) @@ -84,7 +84,7 @@ class FormMitigasiController extends Controller 'penurunan' => $km->emission_factor, ]; - $pdf = PDF::loadView('form.index-mitigasi-pdf', compact('data')) + $pdf = PDF::loadView('modules.form.index-mitigasi-pdf', compact('data')) ->setPaper('a4', 'portrait'); return $pdf->download('bukti-submission-'.$km->nama_kegiatan.'.pdf'); @@ -150,7 +150,7 @@ class FormMitigasiController extends Controller })->toArray(), ]; - return view('form.index-mitigasi-view', [ + return view('modules.form.index-mitigasi-view', [ 'sessionData' => $sessionData, 'id' => $id, ]); @@ -225,7 +225,7 @@ class FormMitigasiController extends Controller $sectors = KegiatanMitigasi::distinct()->pluck('sektor')->toArray(); - return view('form.index-mitigasi-edit', [ + return view('modules.form.index-mitigasi-edit', [ 'sessionData' => $sessionData, 'years' => $years, 'currentYear' => $currentYear, @@ -291,7 +291,7 @@ class FormMitigasiController extends Controller $years = range($startYear, $currentYear); rsort($years); - return view('form.index-mitigasi', compact('sessionData', 'years', 'currentYear')); + return view('modules.form.index-mitigasi', compact('sessionData', 'years', 'currentYear')); } public function update(Request $request, $id) @@ -366,7 +366,7 @@ class FormMitigasiController extends Controller return response()->json([ 'success' => true, - 'redirect' => route('formMitigasi.thankYou', $id), + 'redirect' => route('modules.formMitigasi.thankYou', $id), ]); } catch (\Exception $e) { Log::error('Error updating data: ' . $e->getMessage()); @@ -399,7 +399,7 @@ class FormMitigasiController extends Controller 'am.activity_desc as activity_desc', 'am.activity_type as title' ) - ->join('activity.mitigation as am', 'activity_data_mitigation.mitigation_id', '=', 'am.id') + ->join('mitigation as am', 'activity_data_mitigation.mitigation_id', '=', 'am.id') ->where('activity_data_mitigation.mitigation_id', $mitigation_id) ->orderBy('activity_data_mitigation.sequence') ->get() @@ -591,7 +591,9 @@ class FormMitigasiController extends Controller public function storeFinal(Request $request) { + // dd($request->all()); $sessionData = $request->session()->get('kegiatan_mitigasi'); + if (empty($sessionData)) { return response()->json([ 'success' => false, @@ -665,11 +667,12 @@ class FormMitigasiController extends Controller return response()->json([ 'success' => true, - 'redirect' => route('formMitigasi.thankYou', $mitigasiId), + 'redirect' => route('modules.formMitigasi.thankYou', $mitigasiId), ]); } catch (\Exception $e) { + dd($e->getMessage()); Log::error('Error storing final data: ' . $e->getMessage()); - return back()->with('error', 'Gagal menyimpan data. Silakan coba lagi.'); + // return back()->with('error', 'Gagal menyimpan data. Silakan coba lagi.'); } } diff --git a/app/Models/EmissionReductionMitigation.php b/app/Models/EmissionReductionMitigation.php index 460a2af..ff40c4f 100644 --- a/app/Models/EmissionReductionMitigation.php +++ b/app/Models/EmissionReductionMitigation.php @@ -12,14 +12,7 @@ class EmissionReductionMitigation extends Model protected $table = 'emission_reduction_mitigation'; - protected $fillable = [ - 'mitigation_id', - 'baseline_emission', - 'emission_ton', - 'emission_reduction', - 'type_emission_reduction', - 'method', - ]; + protected $guarded = []; protected $keyType = 'string'; public $incrementing = false; diff --git a/app/Models/KegiatanMitigasi.php b/app/Models/KegiatanMitigasi.php index 4a028aa..f73e6f2 100644 --- a/app/Models/KegiatanMitigasi.php +++ b/app/Models/KegiatanMitigasi.php @@ -14,43 +14,7 @@ class KegiatanMitigasi extends Model protected $keyType = 'string'; public $incrementing = false; - protected $fillable = [ - 'id', - 'tipe_laporan', - 'tipe_kegiatan', - 'tahun_kegiatan', - 'sektor', - 'sub_sektor', - 'kategori_perhitungan', - 'kategori_sub_aktivitas', - 'nama_kegiatan', - 'informasi_lokasi_kegiatan', - 'jenis_kegiatan', - 'pelaksana_kegiatan', - 'tautan_rad', - 'nomenklatur_kemendagri', - 'target', - 'satuan', - 'realisasi', - 'sdg', - 'catatan', - 'mitigation_id', - 'pelaksana_kegiatan_rad', - 'alokasi_apbn', - 'alokasi_apbd', - 'alokasi_swasta', - 'alokasi_sumber_dana_lain', - 'realisasi_apbn', - 'realisasi_apbd', - 'realisasi_swasta', - 'realisasi_sumber_dana_lain', - 'kabupaten_kota_location', - 'kecamatan_location', - 'kelurahan_location', - 'lat_location', - 'long_location', - 'emission_factor', - ]; + protected $guarded = []; protected $casts = [ 'sdg' => 'array', diff --git a/app/Repositories/EmissionReductionRepository.php b/app/Repositories/EmissionReductionRepository.php index f822db5..be5ffcc 100644 --- a/app/Repositories/EmissionReductionRepository.php +++ b/app/Repositories/EmissionReductionRepository.php @@ -4,8 +4,19 @@ namespace App\Repositories; use App\Models\EmissionReductionMitigation; -interface EmissionReductionRepository +class EmissionReductionRepository { - public function findByMitigation(string $mitigationId, ?string $typeEmissionReduction = null): ?EmissionReductionMitigation; - public function findAllByMitigation(string $mitigationId); + public function findByMitigation(string $mitigationId, ?string $typeEmissionReduction = null): ?EmissionReductionMitigation + { + return EmissionReductionMitigation::where('mitigation_id', $mitigationId) + ->when($typeEmissionReduction, function ($q) use ($typeEmissionReduction) { + $q->where('type', $typeEmissionReduction); + }) + ->first(); + } + + public function findAllByMitigation(string $mitigationId) + { + return EmissionReductionMitigation::where('mitigation_id', $mitigationId)->get(); + } } diff --git a/app/Services/Activity/FormMitigasiService.php b/app/Services/Activity/FormMitigasiService.php index 5185c1c..2756a51 100644 --- a/app/Services/Activity/FormMitigasiService.php +++ b/app/Services/Activity/FormMitigasiService.php @@ -131,7 +131,7 @@ class FormMitigasiService logger()->info('TypeEmissionReduction', ['value' => $typeEmissionReduction]); // Build REF_xxx mapping - $contextMaps = DB::table('activity.emission_reduction_context_map') + $contextMaps = DB::table('emission_reduction_context_map') ->where('mitigation_id', $mitigationId) ->get(); diff --git a/composer.json b/composer.json index 4936b0e..2144075 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "license": "MIT", "require": { "php": "^8.2", + "barryvdh/laravel-dompdf": "^3.1", "laravel/framework": "^11.31", "laravel/tinker": "^2.9", "laravel/ui": "^4.6", diff --git a/composer.lock b/composer.lock index 61616ff..f0eab8b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,85 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b1787b324041390419ca8c585a294fd2", + "content-hash": "4a7860bdf856472b69ccfcbf1fe227d6", "packages": [ + { + "name": "barryvdh/laravel-dompdf", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-dompdf.git", + "reference": "ee3b72b19ccdf57d0243116ecb2b90261344dedc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/ee3b72b19ccdf57d0243116ecb2b90261344dedc", + "reference": "ee3b72b19ccdf57d0243116ecb2b90261344dedc", + "shasum": "" + }, + "require": { + "dompdf/dompdf": "^3.0", + "illuminate/support": "^9|^10|^11|^12|^13.0", + "php": "^8.1" + }, + "require-dev": { + "larastan/larastan": "^2.7|^3.0", + "orchestra/testbench": "^7|^8|^9.16|^10|^11.0", + "phpro/grumphp": "^2.5", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "PDF": "Barryvdh\\DomPDF\\Facade\\Pdf", + "Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf" + }, + "providers": [ + "Barryvdh\\DomPDF\\ServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\DomPDF\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "A DOMPDF Wrapper for Laravel", + "keywords": [ + "dompdf", + "laravel", + "pdf" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-dompdf/issues", + "source": "https://github.com/barryvdh/laravel-dompdf/tree/v3.1.2" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2026-02-21T08:51:10+00:00" + }, { "name": "brick/math", "version": "0.14.1", @@ -533,6 +610,161 @@ ], "time": "2024-02-05T11:56:58+00:00" }, + { + "name": "dompdf/dompdf", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "shasum": "" + }, + "require": { + "dompdf/php-font-lib": "^1.0.0", + "dompdf/php-svg-lib": "^1.0.0", + "ext-dom": "*", + "ext-mbstring": "*", + "masterminds/html5": "^2.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ext-gd": "*", + "ext-json": "*", + "ext-zip": "*", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.4 || ^5.4 || ^6.2 || ^7.0" + }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance", + "ext-zlib": "Needed for pdf stream compression" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dompdf\\": "src/" + }, + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "The Dompdf Community", + "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "support": { + "issues": "https://github.com/dompdf/dompdf/issues", + "source": "https://github.com/dompdf/dompdf/tree/v3.1.5" + }, + "time": "2026-03-03T13:54:37+00:00" + }, + { + "name": "dompdf/php-font-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-font-lib.git", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11 || ^12" + }, + "type": "library", + "autoload": { + "psr-4": { + "FontLib\\": "src/FontLib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "The FontLib Community", + "homepage": "https://github.com/dompdf/php-font-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/dompdf/php-font-lib", + "support": { + "issues": "https://github.com/dompdf/php-font-lib/issues", + "source": "https://github.com/dompdf/php-font-lib/tree/1.0.2" + }, + "time": "2026-01-20T14:10:26+00:00" + }, + { + "name": "dompdf/php-svg-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabberworm/php-css-parser": "^8.4 || ^9.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Svg\\": "src/Svg" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "The SvgLib Community", + "homepage": "https://github.com/dompdf/php-svg-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse and export to PDF SVG files.", + "homepage": "https://github.com/dompdf/php-svg-lib", + "support": { + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/1.0.2" + }, + "time": "2026-01-02T16:01:13+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.6.0", @@ -2704,6 +2936,73 @@ }, "time": "2022-12-02T22:17:43+00:00" }, + { + "name": "masterminds/html5", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "fcf91eb64359852f00d921887b219479b4f21251" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251", + "reference": "fcf91eb64359852f00d921887b219479b4f21251", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.10.0" + }, + "time": "2025-07-25T09:04:22+00:00" + }, { "name": "monolog/monolog", "version": "3.10.0", @@ -4264,6 +4563,86 @@ ], "time": "2025-02-25T21:11:49+00:00" }, + { + "name": "sabberworm/php-css-parser", + "version": "v9.3.0", + "source": { + "type": "git", + "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^7.2.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "thecodingmachine/safe": "^1.3 || ^2.5 || ^3.4" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/extension-installer": "1.4.3", + "phpstan/phpstan": "1.12.32 || 2.1.32", + "phpstan/phpstan-phpunit": "1.4.2 || 2.0.8", + "phpstan/phpstan-strict-rules": "1.6.2 || 2.0.7", + "phpunit/phpunit": "8.5.52", + "rawr/phpunit-data-provider": "3.3.1", + "rector/rector": "1.2.10 || 2.2.8", + "rector/type-perfect": "1.0.0 || 2.1.0", + "squizlabs/php_codesniffer": "4.0.1", + "thecodingmachine/phpstan-safe-rule": "1.2.0 || 1.4.1" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.4.x-dev" + } + }, + "autoload": { + "files": [ + "src/Rule/Rule.php", + "src/RuleSet/RuleContainer.php" + ], + "psr-4": { + "Sabberworm\\CSS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "support": { + "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v9.3.0" + }, + "time": "2026-03-03T17:31:43+00:00" + }, { "name": "symfony/clock", "version": "v7.4.0", @@ -6685,6 +7064,149 @@ ], "time": "2025-12-18T07:04:31+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/705683a25bacf0d4860c7dea4d7947bfd09eea19", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "library", + "autoload": { + "files": [ + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rnp.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/OskarStark", + "type": "github" + }, + { + "url": "https://github.com/shish", + "type": "github" + }, + { + "url": "https://github.com/silasjoisten", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2026-02-04T18:08:13+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.4.0", diff --git a/config/dompdf.php b/config/dompdf.php new file mode 100644 index 0000000..677d93c --- /dev/null +++ b/config/dompdf.php @@ -0,0 +1,301 @@ + false, // Throw an Exception on warnings from dompdf + + 'public_path' => null, // Override the public path if needed + + /* + * Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £. + */ + 'convert_entities' => true, + + 'options' => [ + /** + * The location of the DOMPDF font directory + * + * The location of the directory where DOMPDF will store fonts and font metrics + * Note: This directory must exist and be writable by the webserver process. + * *Please note the trailing slash.* + * + * Notes regarding fonts: + * Additional .afm font metrics can be added by executing load_font.php from command line. + * + * Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must + * be embedded in the pdf file or the PDF may not display correctly. This can significantly + * increase file size unless font subsetting is enabled. Before embedding a font please + * review your rights under the font license. + * + * Any font specification in the source HTML is translated to the closest font available + * in the font directory. + * + * The pdf standard "Base 14 fonts" are: + * Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, + * Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, + * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic, + * Symbol, ZapfDingbats. + */ + 'font_dir' => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) + + /** + * The location of the DOMPDF font cache directory + * + * This directory contains the cached font metrics for the fonts used by DOMPDF. + * This directory can be the same as DOMPDF_FONT_DIR + * + * Note: This directory must exist and be writable by the webserver process. + */ + 'font_cache' => storage_path('fonts'), + + /** + * The location of a temporary directory. + * + * The directory specified must be writeable by the webserver process. + * The temporary directory is required to download remote images and when + * using the PDFLib back end. + */ + 'temp_dir' => sys_get_temp_dir(), + + /** + * ==== IMPORTANT ==== + * + * dompdf's "chroot": Prevents dompdf from accessing system files or other + * files on the webserver. All local files opened by dompdf must be in a + * subdirectory of this directory. DO NOT set it to '/' since this could + * allow an attacker to use dompdf to read any files on the server. This + * should be an absolute path. + * This is only checked on command line call by dompdf.php, but not by + * direct class use like: + * $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output(); + */ + 'chroot' => realpath(base_path()), + + /** + * Protocol whitelist + * + * Protocols and PHP wrappers allowed in URIs, and the validation rules + * that determine if a resouce may be loaded. Full support is not guaranteed + * for the protocols/wrappers specified + * by this array. + * + * @var array + */ + 'allowed_protocols' => [ + 'data://' => ['rules' => []], + 'file://' => ['rules' => []], + 'http://' => ['rules' => []], + 'https://' => ['rules' => []], + ], + + /** + * Operational artifact (log files, temporary files) path validation + */ + 'artifactPathValidation' => null, + + /** + * @var string + */ + 'log_output_file' => null, + + /** + * Whether to enable font subsetting or not. + */ + 'enable_font_subsetting' => false, + + /** + * The PDF rendering backend to use + * + * Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and + * 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will + * fall back on CPDF. 'GD' renders PDFs to graphic files. + * {@link * Canvas_Factory} ultimately determines which rendering class to + * instantiate based on this setting. + * + * Both PDFLib & CPDF rendering backends provide sufficient rendering + * capabilities for dompdf, however additional features (e.g. object, + * image and font support, etc.) differ between backends. Please see + * {@link PDFLib_Adapter} for more information on the PDFLib backend + * and {@link CPDF_Adapter} and lib/class.pdf.php for more information + * on CPDF. Also see the documentation for each backend at the links + * below. + * + * The GD rendering backend is a little different than PDFLib and + * CPDF. Several features of CPDF and PDFLib are not supported or do + * not make any sense when creating image files. For example, + * multiple pages are not supported, nor are PDF 'objects'. Have a + * look at {@link GD_Adapter} for more information. GD support is + * experimental, so use it at your own risk. + * + * @link http://www.pdflib.com + * @link http://www.ros.co.nz/pdf + * @link http://www.php.net/image + */ + 'pdf_backend' => 'CPDF', + + /** + * html target media view which should be rendered into pdf. + * List of types and parsing rules for future extensions: + * http://www.w3.org/TR/REC-html40/types.html + * screen, tty, tv, projection, handheld, print, braille, aural, all + * Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3. + * Note, even though the generated pdf file is intended for print output, + * the desired content might be different (e.g. screen or projection view of html file). + * Therefore allow specification of content here. + */ + 'default_media_type' => 'screen', + + /** + * The default paper size. + * + * North America standard is "letter"; other countries generally "a4" + * + * @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.) + */ + 'default_paper_size' => 'a4', + + /** + * The default paper orientation. + * + * The orientation of the page (portrait or landscape). + * + * @var string + */ + 'default_paper_orientation' => 'portrait', + + /** + * The default font family + * + * Used if no suitable fonts can be found. This must exist in the font folder. + * + * @var string + */ + 'default_font' => 'serif', + + /** + * Image DPI setting + * + * This setting determines the default DPI setting for images and fonts. The + * DPI may be overridden for inline images by explictly setting the + * image's width & height style attributes (i.e. if the image's native + * width is 600 pixels and you specify the image's width as 72 points, + * the image will have a DPI of 600 in the rendered PDF. The DPI of + * background images can not be overridden and is controlled entirely + * via this parameter. + * + * For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI). + * If a size in html is given as px (or without unit as image size), + * this tells the corresponding size in pt. + * This adjusts the relative sizes to be similar to the rendering of the + * html page in a reference browser. + * + * In pdf, always 1 pt = 1/72 inch + * + * Rendering resolution of various browsers in px per inch: + * Windows Firefox and Internet Explorer: + * SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:? + * Linux Firefox: + * about:config *resolution: Default:96 + * (xorg screen dimension in mm and Desktop font dpi settings are ignored) + * + * Take care about extra font/image zoom factor of browser. + * + * In images, size in pixel attribute, img css style, are overriding + * the real image dimension in px for rendering. + * + * @var int + */ + 'dpi' => 96, + + /** + * Enable embedded PHP + * + * If this setting is set to true then DOMPDF will automatically evaluate embedded PHP contained + * within tags. + * + * ==== IMPORTANT ==== Enabling this for documents you do not trust (e.g. arbitrary remote html pages) + * is a security risk. + * Embedded scripts are run with the same level of system access available to dompdf. + * Set this option to false (recommended) if you wish to process untrusted documents. + * This setting may increase the risk of system exploit. + * Do not change this settings without understanding the consequences. + * Additional documentation is available on the dompdf wiki at: + * https://github.com/dompdf/dompdf/wiki + * + * @var bool + */ + 'enable_php' => false, + + /** + * Enable inline JavaScript + * + * If this setting is set to true then DOMPDF will automatically insert JavaScript code contained + * within tags as written into the PDF. + * NOTE: This is PDF-based JavaScript to be executed by the PDF viewer, + * not browser-based JavaScript executed by Dompdf. + * + * @var bool + */ + 'enable_javascript' => true, + + /** + * Enable remote file access + * + * If this setting is set to true, DOMPDF will access remote sites for + * images and CSS files as required. + * + * ==== IMPORTANT ==== + * This can be a security risk, in particular in combination with isPhpEnabled and + * allowing remote html code to be passed to $dompdf = new DOMPDF(); $dompdf->load_html(...); + * This allows anonymous users to download legally doubtful internet content which on + * tracing back appears to being downloaded by your server, or allows malicious php code + * in remote html pages to be executed by your server with your account privileges. + * + * This setting may increase the risk of system exploit. Do not change + * this settings without understanding the consequences. Additional + * documentation is available on the dompdf wiki at: + * https://github.com/dompdf/dompdf/wiki + * + * @var bool + */ + 'enable_remote' => false, + + /** + * List of allowed remote hosts + * + * Each value of the array must be a valid hostname. + * + * This will be used to filter which resources can be loaded in combination with + * isRemoteEnabled. If enable_remote is FALSE, then this will have no effect. + * + * Leave to NULL to allow any remote host. + * + * @var array|null + */ + 'allowed_remote_hosts' => null, + + /** + * A ratio applied to the fonts height to be more like browsers' line height + */ + 'font_height_ratio' => 1.1, + + /** + * Use the HTML5 Lib parser + * + * @deprecated This feature is now always on in dompdf 2.x + * + * @var bool + */ + 'enable_html5_parser' => true, + ], + +]; diff --git a/resources/views/auth/dashboard-adaptation.blade.php b/resources/views/auth/dashboard-adaptation.blade.php index b6bfd56..c39e318 100644 --- a/resources/views/auth/dashboard-adaptation.blade.php +++ b/resources/views/auth/dashboard-adaptation.blade.php @@ -72,10 +72,10 @@ {{ $a->sektor }} {{ $a->sub_sektor }} - + - + diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index fdbb94d..9fa6b0a 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -5,6 +5,7 @@ @yield('title',@$title) | SIGD + diff --git a/resources/views/modules/form/index-adaptasi.blade.php b/resources/views/modules/form/index-adaptasi.blade.php index 3988077..ab59230 100644 --- a/resources/views/modules/form/index-adaptasi.blade.php +++ b/resources/views/modules/form/index-adaptasi.blade.php @@ -8,13 +8,12 @@ #scope = $user->getScope(); @endphp -
-
-

ADAPTASI

+
+
+

ADAPTASI

-

@csrf @@ -160,7 +159,7 @@
-
@@ -249,7 +248,7 @@
-
@@ -284,7 +283,7 @@
-
@@ -302,6 +301,7 @@ @section('js')