diff --git a/app/Http/Controllers/AdminBackend/AdminResultController.php b/app/Http/Controllers/AdminBackend/AdminResultController.php
index 77b8c63..6cb9310 100644
--- a/app/Http/Controllers/AdminBackend/AdminResultController.php
+++ b/app/Http/Controllers/AdminBackend/AdminResultController.php
@@ -4,15 +4,17 @@
use App\Http\Controllers\Controller;
use App\Models\Hasil;
+use Barryvdh\DomPDF\Facade\Pdf as FacadePdf;
+use Barryvdh\DomPDF\PDF as DomPDFPDF;
use Illuminate\Http\Request;
use Carbon\Carbon;
+
class AdminResultController extends Controller
{
public function index()
{
$results = Hasil::with('user')->get();
-
$results = $results->map(function ($result) {
$result->formatted_created_at = Carbon::parse($result->created_at)->format('M d, Y');
return $result;
@@ -20,4 +22,14 @@ public function index()
return view('admin_backend.admin_result', compact('results'));
}
+
+ public function show($id)
+ {
+ $result = Hasil::with('user')->findOrFail($id);
+ $result->formatted_created_at = Carbon::parse($result->created_at)->format('M d, Y');
+ return view('admin_backend.admin_pdf_result', compact('result'));
+ }
+ public function cetak_pdf($id)
+ {
+ }
}
diff --git a/composer.lock b/composer.lock
index 041a2ee..9a9b557 100644
--- a/composer.lock
+++ b/composer.lock
@@ -7848,5 +7848,5 @@
"php": "^7.3|^8.0"
},
"platform-dev": [],
- "plugin-api-version": "2.2.0"
+ "plugin-api-version": "2.3.0"
}
diff --git a/config/app.php b/config/app.php
index a8d1a82..6105c87 100644
--- a/config/app.php
+++ b/config/app.php
@@ -161,6 +161,7 @@
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
+ // Barryvdh\DomPDF\ServiceProvider::class,
/*
* Package Service Providers...
@@ -229,6 +230,7 @@
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
+ // 'PDF' => Barryvdh\DomPDF\Facade::class,
],
diff --git a/resources/views/admin_backend/admin_pdf_result.blade.php b/resources/views/admin_backend/admin_pdf_result.blade.php
new file mode 100644
index 0000000..057bd2b
--- /dev/null
+++ b/resources/views/admin_backend/admin_pdf_result.blade.php
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+ {{config('app.name')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Nama
+
:
+
{{ $result->user->nama_lengkap }}
+
+
+
Nim
+
:
+
{{ $result->user->nim }}
+
+
+
Golongan
+
:
+
{{ $result->user->kelas_user }}
+
+
+
Jurusan
+
:
+
Teknologi Informasi
+
+
Knowledge of Metacognitif(KM)
+
+
+
+ Total skor : {{ $result->km_total }} |
+
+
+ Kelas skor : {{ $result->km_class }} |
+
+
+ No |
+ Kategori |
+ Nilai |
+
+
+
+ 1 |
+ Declarative Knowledge |
+ {{ $result->declarative_knowledge }} |
+
+
+ 2 |
+ Procedural Knowledge |
+ {{ $result->procedural_knowledge }} |
+
+
+ 3 |
+ Conditional Knowledge |
+ {{ $result->conditional_knowledge }} |
+
+
+
+
+
Regulation of Metacognitif(RM)
+
+
+
+ Total skor : {{ $result->rm_total }} |
+
+
+ Kelas skor : {{ $result->rm_class }} |
+
+
+ No |
+ Kategori |
+ Nilai |
+
+
+
+ 1 |
+ Planning |
+ {{ $result->planning }} |
+
+
+ 2 |
+ Information Management |
+ {{ $result->information_management }} |
+
+
+ 3 |
+ Monitoring |
+ {{ $result->monitoring }} |
+
+
+ 4 |
+ Debugging |
+ {{ $result->debugging }} |
+
+
+ 5 |
+ Evaluation |
+ {{ $result->evaluation }} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/admin_backend/admin_period.blade.php b/resources/views/admin_backend/admin_period.blade.php
index b5c3ee7..6951089 100644
--- a/resources/views/admin_backend/admin_period.blade.php
+++ b/resources/views/admin_backend/admin_period.blade.php
@@ -62,7 +62,7 @@
diff --git a/resources/views/admin_backend/admin_result.blade.php b/resources/views/admin_backend/admin_result.blade.php
index b0ffd54..e174126 100644
--- a/resources/views/admin_backend/admin_result.blade.php
+++ b/resources/views/admin_backend/admin_result.blade.php
@@ -11,8 +11,8 @@
NAMA |
ANGKATAN |
TANGGAL |
- RM |
KM |
+ RM |
ACTION |
@@ -21,9 +21,9 @@
{{ $result->user->nama_lengkap }} |
{{ $result->user->angkatan }} |
{{ $result->formatted_created_at }} |
- {{ $result->rm_total }} |
- {{ $result->km_total }} |
- |
+ {{ $result->km_class }} |
+ {{ $result->rm_class }} |
+ Download |
@endforeach
diff --git a/resources/views/admin_backend/layouts/sidebar.blade.php b/resources/views/admin_backend/layouts/sidebar.blade.php
index 3165f5e..86b5811 100644
--- a/resources/views/admin_backend/layouts/sidebar.blade.php
+++ b/resources/views/admin_backend/layouts/sidebar.blade.php
@@ -20,16 +20,16 @@
-
-
- Hasil
+
+
+ Periode
-
-
- Periode
+
+
+ Hasil
diff --git a/routes/web.php b/routes/web.php
index 1f7fae8..3e09782 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -50,9 +50,12 @@
Route::resource('listuser', 'ListUserController')->names('adminListUser');
Route::resource('listadmin', 'ListAdminController')->names('adminListAdmin');
Route::resource('admin-questionnaire', 'AdminQuestionnaireController')->names('adminQuestionnaire');
- Route::resource('admin-result', 'AdminResultController')->names('adminResult');
Route::resource('admin-period', 'AdminPeriodController')->names('adminPeriod');
+ Route::resource('admin-result', 'AdminResultController')->names('adminResult');
+ // Route::get('admin-result', 'AdminResultController@index')->name('adminResult.index');
+ // Route::get('admin-result/cetak', 'AdminResultController@index');
+ Route::get('/hasil/cetak-pdf', 'AdminResultController@cetak_pdf')->name('userQuestionnaire.cetak');
Route::post('/select-period', 'SelectPeriodController@update')->name('adminSelectPeriod');
Route::post('/select-period/active', 'SelectPeriodController@active')->name('adminSelectPeriod.active');