From b1dbd6c997a97c737fc7c05228e3e4a9b3a9feaf Mon Sep 17 00:00:00 2001 From: ilhamwara Date: Fri, 7 Mar 2025 11:39:52 +0700 Subject: [PATCH] update --- app/Helpers/custom.php | 15 + .../Master/FormKriteriaController.php | 29 +- .../views/modules/dashboard/admin.blade.php | 709 +++--------------- .../master/form-kriteria/form.blade.php | 68 +- .../master/form-kriteria/index.blade.php | 3 +- 5 files changed, 194 insertions(+), 630 deletions(-) diff --git a/app/Helpers/custom.php b/app/Helpers/custom.php index 1feefdf..ddf8c92 100644 --- a/app/Helpers/custom.php +++ b/app/Helpers/custom.php @@ -68,6 +68,21 @@ if (!function_exists('formKriteria')) { $html .= ''; $html .= ''; + + if($data->active_lainnya == 1){ + $nameOptionLainnya = 'lainnya_number_'.$keyKriteria; + $html .= '
'; + $html .= '
'; + $html .= '
'.$data->judul_lainnya.'
'; + + for($i = 1; $i <= $data->number_answer_lainnya; $i++){ + $html .= '
'; + $html .= ''; + $html .= '
'; + } + $html .= '
'; + $html .= '
'; + } } return $html; diff --git a/app/Http/Controllers/Master/FormKriteriaController.php b/app/Http/Controllers/Master/FormKriteriaController.php index 8b7a571..cd591ac 100644 --- a/app/Http/Controllers/Master/FormKriteriaController.php +++ b/app/Http/Controllers/Master/FormKriteriaController.php @@ -38,6 +38,9 @@ class FormKriteriaController extends Controller ]; $data['title'] = $this->title; $data['route'] = $this->route; + $keyId = decode_id($id); + $data['item'] = FormKriteria::find($keyId); + $data['keyId'] = $id; return view($this->template.'.form',$data); } @@ -55,17 +58,19 @@ class FormKriteriaController extends Controller $action = ''; if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){ - $action .= ''; + $action .= ''; if(session('group_id') == 1){ - $action .= ''; + $action .= ''; } } $_data[] = [ 'no' => $key+1, - 'id' => encode_id($row->id), + 'id' => encode_id($row->MsFormKriteriaId), + 'kategori' => @$row->kategori, 'page_number' => @$row->page_number, 'judul' => @$row->judul, + 'type' => \Str::title(str_replace('_',' ',@$row->type)), 'created_at' => dateTime(@$row->created_at), 'action' => @$action, ]; @@ -103,8 +108,24 @@ class FormKriteriaController extends Controller $insert->number_answer_lainnya = $request->number_answer_lainnya; $insert->active = 1; $insert->save(); + + logActivity($request, __('Create',['val' => strtolower(__('Title',['val' => 'Form Kriteria']))])); + }else{ + $insert = FormKriteria::find($keyId); + $insert->page_number = $request->page_number; + $insert->key = $request->key; + $insert->kategori = $request->kategori; + $insert->judul = $request->judul; + $insert->type = $request->type; + $insert->option = json_encode($request->jawaban); + $insert->active_lainnya = $request->active_lainnya; + $insert->judul_lainnya = $request->judul_lainnya; + $insert->number_answer_lainnya = $request->number_answer_lainnya; + // $insert->active = 1; + $insert->save(); + + logActivity($request, __('Update',['val' => strtolower(__('Title',['val' => 'Form Kriteria User ID => '.auth()->user()->id.' Form ID => '.$keyId]))])); } - logActivity($request, __('Create',['val' => strtolower(__('Title',['val' => 'Form Kriteria']))])); return redirect()->back()->with([ 'message' => 'Berhasil update data', 'type' => 'success', diff --git a/resources/views/modules/dashboard/admin.blade.php b/resources/views/modules/dashboard/admin.blade.php index b66940b..0c7c6c0 100644 --- a/resources/views/modules/dashboard/admin.blade.php +++ b/resources/views/modules/dashboard/admin.blade.php @@ -13,21 +13,21 @@
-

- 21.5k - users signed up -

+

+ 21 +

+ Total Usulan Adiwiyata Kota
-
+

- $10,203 - Visual Index Figure + 21

+ Total Usulan Adiwiyata Provinsi
@@ -36,9 +36,9 @@

- - 103.72 - Offset Balance Ratio + 99

+ Total Usulan Adiwiyata Nasional
@@ -47,183 +47,109 @@

- +40% - Product level increase + 20

+ Total Usulan Adiwiyata Mandiri
-
-
-
-

- Marketing profits -

-
-
-
-
-
- - -
-
- - -
-
- - -
-
-
-
+
+
+
+

+ 21 +

+ Total Sekolah Adiwiyata Kota
+
+
+
+
+

+ 21 +

+ Total Sekolah Adiwiyata Provinsi +
+ +
+
+
+
+
+

+ 99 +

+ Total Sekolah Adiwiyata Nasional +
+ +
+
+
+
+
+

+ 20 +

+ Total Sekolah Adiwiyata Mandiri +
+ +
+
+
+
-

- Sale Records -

+

Usulan Adiwiyata Tahun 2024

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CustomerIDNamePurchaseDateCustomerEmailCustomerCVVCountryInvoiceAmountControls
268410636Cooley, Walker J.03-13-19odio.auctor@orcilobortis.edu717Timor-Leste$7,0071
077610947Wise, Ruby R.04-10-19mi.Aliquam@afeugiat.edu715Burkina Faso$7,0521
959104621Orr, Isabella V.05-14-20amet.lorem@risus.edu256Sri Lanka$6,6971
756590147Schwartz, Xander P.11-05-18sagittis.placerat.Cras@nonlaciniaat.com963Liberia$8,1171
533801387Gilmore, Cedric O.01-16-20consectetuer.adipiscing@semegestasblandit.co.uk754Svalbard and Jan Mayen Islands$5,3281
403080948Foley, Cynthia M.07-14-18a.auctor.non@nuncrisus.net826Afghanistan$6,8231
114290869Marshall, Carter V.08-30-18porttitor.interdum@dolordolortempus.com256Singapore$6,6791
033182882Reilly, Jacob K.09-19-18vestibulum.lorem@adipiscing.ca703Chile$5,2521
471026559Barlow, Jena S.12-16-19mollis@lacusUtnec.org998Botswana$5,5421
223467911Huber, Warren Z.05-30-20Nulla@ipsumdolorsit.edu127Equatorial Guinea$7,3311
CustomerIDNamePurchaseDateCustomerEmailCustomerCVVCountryInvoiceAmountControls
- +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NoNPSNNama SekolahTahunTingkat SekolahStatus Sekolah
1312344SDN 01 Makasar2024SDNegeri
28872638SDN 02 Makasar2024SDNegeri
3912377SMA 14 Jakarta2024SDNegeri
+
@@ -236,454 +162,11 @@ diff --git a/resources/views/modules/master/form-kriteria/form.blade.php b/resources/views/modules/master/form-kriteria/form.blade.php index d194da4..75394a0 100644 --- a/resources/views/modules/master/form-kriteria/form.blade.php +++ b/resources/views/modules/master/form-kriteria/form.blade.php @@ -32,9 +32,9 @@
@error('kategori') {{$message}} @@ -70,11 +70,11 @@
@error('type') {{$message}} @@ -82,12 +82,45 @@
+ type == 'checkbox') || (@$item->type == 'radio_button')){ + $hide = ''; + }else{ + $hide = 'style="display:none;"'; + } + }else{ + $hide = 'style="display:none;"'; + } + + ?>
- + + type == 'checkbox') || (@$item->type == 'radio_button')){ + $option = json_decode($item->option); + } + ?> + @if(@$option) + @foreach($option as $dataOption) + + + + + @endforeach + @endif
Jawaban  Tambah Jawaban
+
+ +
+
+ +
@@ -95,8 +128,8 @@
@error('active_lainnya') {{$message}} @@ -104,7 +137,18 @@
-