From 52d924641e7cc05275f8bb704146c15d9f5d6f4d Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Fri, 27 May 2022 14:52:38 +0800 Subject: [PATCH 01/13] Perbaiki dan hapus yang tidak digunakan --- .../Data/ProgramBantuanController.php | 105 +----------------- .../data/program_bantuan/import.blade.php | 2 +- routes/web.php | 7 -- .../template_upload/program_bantuan.zip | Bin 1632 -> 0 bytes .../program_bantuan_22_12_2020_opendk.zip | Bin 0 -> 1689 bytes 5 files changed, 4 insertions(+), 110 deletions(-) delete mode 100644 storage/app/public/template_upload/program_bantuan.zip create mode 100644 storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip diff --git a/app/Http/Controllers/Data/ProgramBantuanController.php b/app/Http/Controllers/Data/ProgramBantuanController.php index 69c6f567b..0b240700c 100644 --- a/app/Http/Controllers/Data/ProgramBantuanController.php +++ b/app/Http/Controllers/Data/ProgramBantuanController.php @@ -70,33 +70,6 @@ public function getaProgramBantuan(Request $request) ->rawColumns(['aksi'])->make(); } - public function create() - { - $page_title = 'Tambah'; - $page_description = 'Tambah Program Bantuan Baru'; - - return view('data.program_bantuan.create', compact('page_title', 'page_description')); - } - - public function store(Request $request) - { - request()->validate([ - 'sasaran' => 'required', - 'nama' => 'required', - 'start_date' => 'required|date', - 'end_date' => 'required|date', - ]); - - try { - Program::create($request->all()); - } catch (\Exception $e) { - report($e); - return back()->withInput()->with('error', 'Data gagal disimpan!'); - } - - return redirect()->route('data.program-bantuan.index')->with('success', 'Data berhasil disimpan!'); - } - public function show($id) { $program = Program::findOrFail($id); @@ -108,78 +81,6 @@ public function show($id) return view('data.program_bantuan.show', compact('page_title', 'page_description', 'program', 'sasaran', 'peserta')); } - public function update(Request $request, $id) - { - request()->validate([ - 'sasaran' => 'required', - 'nama' => 'required', - 'start_date' => 'required|date', - 'end_date' => 'required|date', - ]); - - try { - $program = Program::findOrFail($id); - $program->fill($request->all()); - $program->update(); - } catch (\Exception $e) { - report($e); - return back()->withInput()->with('error', 'Data gagal disimpan!'); - } - - return redirect()->route('data.program-bantuan.index')->with('success', 'Data berhasil disimpan!'); - } - - public function edit($id) - { - $program = Program::findOrFail($id); - $page_title = 'Edit Program'; - $page_description = 'Program Bantuan ' . $program->nama; - $sasaran = [1 => 'Penduduk/Perorangan', 2 => 'Keluarga-KK']; - $peserta = PesertaProgram::where('program_id', $id)->get(); - - return view('data.program_bantuan.edit', compact('page_title', 'page_description', 'program', 'sasaran', 'peserta')); - } - - public function destroy($id) - { - try { - Program::findOrFail($id)->delete(); - PesertaProgram::where('program_id', $id)->delete(); - } catch (\Exception $e) { - report($e); - return back()->withInput()->with('error', 'Data gagal dihapus!'); - } - - return redirect()->route('data.program-bantuan.index')->with('success', 'Data berhasil dihapus!'); - } - - public function createPeserta($id) - { - $program = Program::findOrFail($id); - $page_title = 'Tambah Peserta'; - $page_description = 'Program Bantuan ' . $program->nama; - $sasaran = [1 => 'Penduduk/Perorangan', 2 => 'Keluarga-KK']; - - return view('data.program_bantuan.add_peserta', compact('page_title', 'page_description', 'program', 'sasaran')); - } - - public function add_peserta(Request $request) - { - request()->validate([ - 'peserta' => 'required', - 'tanggal_lahir' => 'date', - ]); - - try { - PesertaProgram::create($request->all()); - } catch (\Exception $e) { - report($e); - return back()->withInput()->with('error', 'Data gagal disimpan!'); - } - - return redirect()->route('data.program-bantuan.show', $request->input('program_id'))->with('success', 'Data berhasil disimpan!'); - } - public function import() { $page_title = 'Impor'; @@ -209,12 +110,12 @@ public function do_import(Request $request) $zip->extractTo($extract); $zip->close(); - $fileExtracted = glob($extract.'*.xlsx'); + glob($extract.'*.xlsx'); (new SinkronBantuan()) - ->queue($extract . $csvName = Str::replaceLast('zip', 'csv', $name)); + ->queue($extract . Str::replaceLast('zip', 'csv', $name)); (new SinkronPesertaBantuan()) - ->queue($extract . $csvName = Str::replaceLast('zip', 'csv', 'peserta+'.$name)); + ->queue($extract . Str::replaceLast('zip', 'csv', 'peserta_'.$name)); } catch (\Exception $e) { report($e); return back()->with('error', 'Import data gagal. '. $e->getMessage()); diff --git a/resources/views/data/program_bantuan/import.blade.php b/resources/views/data/program_bantuan/import.blade.php index a9a8f5da6..541a3a8f0 100644 --- a/resources/views/data/program_bantuan/import.blade.php +++ b/resources/views/data/program_bantuan/import.blade.php @@ -47,7 +47,7 @@

Instruksi Unggah Data:

-

Silahkan unduh template unggah data di sini: Unduh

+

Silahkan unduh template unggah data di sini: Unduh

diff --git a/routes/web.php b/routes/web.php index b10ab7f1e..1a0c9e06f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -405,14 +405,7 @@ Route::group(['prefix' => 'program-bantuan', 'middleware' => ['role:super-admin|administrator-website|admin-desa']], function () { Route::get('/', ['as' => 'data.program-bantuan.index', 'uses' => 'ProgramBantuanController@index']); Route::get('getdata', ['as' => 'data.program-bantuan.getdata', 'uses' => 'ProgramBantuanController@getaProgramBantuan']); - Route::get('create', ['as' => 'data.program-bantuan.create', 'uses' => 'ProgramBantuanController@create']); - Route::post('store', ['as' => 'data.program-bantuan.store', 'uses' => 'ProgramBantuanController@store']); - Route::post('add_peserta', ['as' => 'data.program-bantuan.add_peserta', 'uses' => 'ProgramBantuanController@add_peserta']); - Route::get('edit/{id}', ['as' => 'data.program-bantuan.edit', 'uses' => 'ProgramBantuanController@edit']); Route::get('show/{id}', ['as' => 'data.program-bantuan.show', 'uses' => 'ProgramBantuanController@show']); - Route::get('create-peserta/{id}', ['as' => 'data.program-bantuan.create-peserta', 'uses' => 'ProgramBantuanController@createPeserta']); - Route::put('update/{id}', ['as' => 'data.program-bantuan.update', 'uses' => 'ProgramBantuanController@update']); - Route::delete('destroy/{id}', ['as' => 'data.program-bantuan.destroy', 'uses' => 'ProgramBantuanController@destroy']); Route::get('import', ['as' => 'data.program-bantuan.import', 'uses' => 'ProgramBantuanController@import']); Route::post('do_import', ['as' => 'data.program-bantuan.do_import', 'uses' => 'ProgramBantuanController@do_import']); }); diff --git a/storage/app/public/template_upload/program_bantuan.zip b/storage/app/public/template_upload/program_bantuan.zip deleted file mode 100644 index 0f52afa173bb16029869d9ec2d459590680589ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1632 zcmaKtc{J1u6vuxvlTpT25;KggQDjE8Y@rz@<;`T@WgUaOOd1;TjAb&mK_aq8&n`5@ zWO*g~R(g`ii!_R|MTLiqr}zGPz2)9>?mg$8d%pjC&;49W0%X^I004FapPTO6g8Sr* z*dPFq<^uq!ooOIBh)fOkR0*VB@TGbNxO;h0f-iYeR7pX!`s=MJx3K$9u0`-&+{${c zQhvnW3F&(s>ROm@z7}f><%)_6PL8a28J&ypl+hj?Lx&APO^)brmnTAGwDVa%gAgg^Hq;cQm$+Y=giuwg_TGe=DtgF%iw&0%(=~@ zf^};*75mhWYL41D75IdbirC530eU#mJoyd5Y^;TUHSi%!!Vq6mXKbsc$wI}HIGxA} zl?3^VH}trQc;=j!?lR~$D?pB9=jYgb=otR!FAyay8hNL1Gq6j1Y0viLdQZZPSb(S= z$yh#N-(!V{#Dx1fwe4r(NUCD0zJ>!Wtr+FxQorNe-S6p8fi@xNHD1GY!=+BtlAl8Q zc|lM~VD=0b=#ZM!FZ-PpfWxaRY)qYA@8lvC#7S`zbYvgfeh^={>-+Ay56$f=jcqI=`3C0NIkRP5zL{gmFIPsXXIJd%Ga+(k9s35 z|K{{A&-vjJ2mqw=1Ay2!r~m0N)2=_|H|_o7BB_ybK4gfr!zZoN9Cc?ofc2fh9Y{*MwGU1d=cVP zwA+w z;?jIiqpxvON>lkVD|yUCu?K(Hwu~q_V4kb@VsC=3Js})j3bw9BjwIIJ*w>gAYq_u- z$8>+*u4CLYCCRoo6*>%%%(RXii_3g6?MAuxb;aZ%y+?Mr;YnFHu}>pRK;x;-OBY@{ zH@CU^6}?;__M#4G6_h~7=LlQ|lB4lB9=s)%QHZr#+RN5>glc_jhrFWOd9WyEK&APB z<80Ivu}!Gp9pj5^joxv-L;xDamhM#w)bKhcH%)O!!thfXKnBDvno7Z~A@I0Sio3ao zcE7e04T9rM&xjiIQMY;g@)fH4d?T)w%IB#!^A9cVhYabgC0z-s+A20Kk0)zByI744 zKchsA{5fx0i@9ogoINHn=Y+xW&BDPRFlE2IZ2#E|lgp`;Ub-UQL@3uGq;|3L+~Iqm z_cLLX=}Bwm+bd?#gQEDk4EMBAwgMmnfe}acw$(Sa7wbmjv{;O8jRyM;8P?VhZXx=q z63FN|Ja`qqiWo<&h8`|BM6_f%2nB;dm&u}Z>@Z%QfKH zH4AUtT_)K6*8@`WI(yPP89uoAql^ZP8>|bj{3O%!g)v7ETVfIM%C2bC%g4bWHR}fm z{RKo8+^v)a)YPP37>5!>4~jtNxU?Z@HA7I@OQ$I}hStaA8T{gMM2A?_}am Kf3)*M0N@Y7IL)E} diff --git a/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip b/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip new file mode 100644 index 0000000000000000000000000000000000000000..c8a3af71f5daae8eb8f89654188bd939c6b96428 GIT binary patch literal 1689 zcmWIWW@Zs#U|`^2urAsivdwRXcs3&g!&(*w23??NL27YoQAuKaK~a8sQDSaQjeH)%_lAdi!*xU~QR5ermO?P-tMs;xe_qS6=m+>uv>TE}a<4 z*KRdEQqP)k?h6;~RX=%{qXk+vZr*p0$Kb`*^UW$Py8iEfsP!}?NefF?pB7cA=2py# zJUO{E`{(m_F_DFTqnHzzdh{mjJ`iH+Bypm~jmKqurGWi0uA8}+3iw%WcGOB|7|5Kx zvFbtWP38w1owlw!(s8Icecl1){)$b{8>TugcLXgeJygDL7UMqVF1CzPP8So6Nm&KOrtFKDJ{-Gq>VewH zCz-yI5B|^3SYxMdB=Pxi&d&Ug7JTp5s?>BIiWkz&eWG*|ADM~Nx<9gy_{=hCw&#M&bFaIu-6A{9OlsHpt4lu$ zJ-*?xajoF~wfuiQ|8m=2Z&X=oy~;%Dz)tz+^NMRef1h9f(#vX-if!eq6Q1Fk|J%Qa zvZ{vulHdDE;3;$K3)Mrjx@0_y*IjwfvFzuX39~;_hx4C>QWcwb)mw`kFqEv=1OS$ zv3K+=S){z&SKemT`+FR!{k2D%jaFGVN_Z~{k~yF}+ehs6@uaUiPIWJT_pOfsOPo91Lmro~eT}`c9q5Q=Jek%tz_ayg!P5#b~0Sh!NoOO6Y z|E9#rCJ8LBP*KR(v&q}>OtEc7fqS~8(BI9g&-pnj7BI%?gd1^9`VvyQV&}~_znB`I zrxvQU3ug6<#Jq!R zi!}Jp>h4_c!s%=_|7`m2Y!&6%4=VXvpBza!kijwU>#2UK!;9?`AU9PuY#yRm;-w2*seN#mYX4`qEi+kb5Jnfgz<-@g~+ z=1g+7t~=(Qe}QX~zS-}h{b!DxRgt=veZ}!Q!;!XJwv~Bj{Hs(Nx4pDe&7Si2?$Pb~ zW>JBES3lOC$<4aakHn7>&RtHtF-=+$W$94T`p!9JK0V6>*M{Z>-(ft&KAV}SF2o^y=C%M=-g)U|0 z-WB&2S=_%tdBJPbgi5AO0xsKnYvpBk|6^_FTCi65x!cvt;U14}eVElzTJ^Ew)v@=|5n$W@M6Q zz*QWp0JAm-D1b>43ui8shBvlN4HFA*Fv4hg)kZKM*?P=!1=;#-z&e7cQU=-D gp#GzQAZuatJclD-et Date: Mon, 30 May 2022 12:38:51 +0800 Subject: [PATCH 02/13] Update program_bantuan_22_12_2020_opendk.zip --- .../program_bantuan_22_12_2020_opendk.zip | Bin 1689 -> 1695 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip b/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip index c8a3af71f5daae8eb8f89654188bd939c6b96428..c4f366af6151bab16f682a31c795c9b58c4ca761 100644 GIT binary patch delta 1584 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 gp#GzQAZuatJclD-et Date: Mon, 30 May 2022 12:50:14 +0800 Subject: [PATCH 03/13] Hapus yang tidak digunakan --- app/Imports/SinkronPesertaBantuan.php | 2 - .../program_bantuan/_peserta_kk.blade.php | 117 ----------------- .../_peserta_penduduk.blade.php | 122 ------------------ .../program_bantuan/add_peserta.blade.php | 109 ---------------- .../data/program_bantuan/create.blade.php | 75 ----------- .../views/data/program_bantuan/edit.blade.php | 74 ----------- .../program_bantuan/form_create.blade.php | 35 ----- .../data/program_bantuan/form_edit.blade.php | 35 ----- .../data/program_bantuan/import.blade.php | 101 ++++++++------- .../views/data/program_bantuan/show.blade.php | 64 +++------ .../program_bantuan_22_12_2020_opendk.zip | Bin 1695 -> 1695 bytes 11 files changed, 71 insertions(+), 663 deletions(-) delete mode 100755 resources/views/data/program_bantuan/_peserta_kk.blade.php delete mode 100755 resources/views/data/program_bantuan/_peserta_penduduk.blade.php delete mode 100755 resources/views/data/program_bantuan/add_peserta.blade.php delete mode 100755 resources/views/data/program_bantuan/create.blade.php delete mode 100755 resources/views/data/program_bantuan/edit.blade.php delete mode 100755 resources/views/data/program_bantuan/form_create.blade.php delete mode 100755 resources/views/data/program_bantuan/form_edit.blade.php diff --git a/app/Imports/SinkronPesertaBantuan.php b/app/Imports/SinkronPesertaBantuan.php index 531e69575..8d5ac47a0 100644 --- a/app/Imports/SinkronPesertaBantuan.php +++ b/app/Imports/SinkronPesertaBantuan.php @@ -63,8 +63,6 @@ public function chunkSize(): int */ public function collection(Collection $collection) { - $col_kk = Arr::flatten(Keluarga::pluck('no_kk')); - $col_nik = Arr::flatten(Keluarga::pluck('no_kk')); DB::beginTransaction(); //multai transaction foreach ($collection as $value) { diff --git a/resources/views/data/program_bantuan/_peserta_kk.blade.php b/resources/views/data/program_bantuan/_peserta_kk.blade.php deleted file mode 100755 index 2cd571b8d..000000000 --- a/resources/views/data/program_bantuan/_peserta_kk.blade.php +++ /dev/null @@ -1,117 +0,0 @@ -
- -
- {!! Form::hidden('program_id', $program->id) !!} - {!! Form::hidden('sasaran', $program->sasaran) !!} - {!! Form::select('peserta', [], null, ['class' => 'form-control', 'required'=>true, 'id' => 'peserta']) !!} -
-
-
-
- - -
- {!! Form::text('kartu_peserta', null, ['placeholder' => 'No Kartu', 'class' => 'form-control', 'id' => 'kartu_peserta']) !!} -
-
- -Identitas Pada Kartu Peserta -
- - -
- {!! Form::text('kartu_nik', null, ['placeholder' => 'NIK', 'class' => 'form-control', 'id' => 'kartu_nik']) !!} -
-
-
- - -
- {!! Form::text('kartu_nama', null, ['placeholder' => 'Nama', 'class' => 'form-control', 'id' => 'kartu_nama']) !!} -
-
-
- - -
- {!! Form::text('kartu_tempat_lahir', null, ['placeholder' => 'Tempat Lahir', 'class' => 'form-control', 'id' => 'kartu_tempat_lahir']) !!} -
-
-
- - -
-
- {!! Form::text('kartu_tanggal_lahir', null, ['placeholder' => 'Tanggal Lahir','class' => 'form-control datepicker', 'id' => 'kartu_tanggal_lahir']) !!} -
-
-
-
- -@include('partials.asset_datetimepicker') -@include('partials.asset_select2') -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/data/program_bantuan/_peserta_penduduk.blade.php b/resources/views/data/program_bantuan/_peserta_penduduk.blade.php deleted file mode 100755 index 589cea7a1..000000000 --- a/resources/views/data/program_bantuan/_peserta_penduduk.blade.php +++ /dev/null @@ -1,122 +0,0 @@ -
- - -
- {!! Form::hidden('program_id', $program->id) !!} - {!! Form::hidden('sasaran', $program->sasaran) !!} - {!! Form::select('peserta', [], null, ['class' => 'form-control', 'required'=>true, 'id' => 'peserta']) !!} -
-
-
-
- - -
- {!! Form::text('kartu_peserta', null, ['placeholder' => 'No Kartu', 'class' => 'form-control', 'id' => 'kartu_peserta']) !!} -
-
- -Identitas Pada Kartu Peserta -
- - -
- {!! Form::text('kartu_nik', null, ['placeholder' => 'NIK', 'class' => 'form-control', 'id' => 'kartu_nik']) !!} -
-
-
- - -
- {!! Form::text('kartu_nama', null, ['placeholder' => 'Nama', 'class' => 'form-control', 'id' => 'kartu_nama']) !!} -
-
-
- - -
- {!! Form::text('kartu_tempat_lahir', null, ['placeholder' => 'Tempat Lahir', 'class' => 'form-control', 'id' => 'kartu_tempat_lahir']) !!} -
-
-
- - -
-
- {!! Form::text('kartu_tanggal_lahir', null, ['placeholder' => 'Tanggal Lahir','class' => 'form-control datepicker', 'id' => 'kartu_tanggal_lahir']) !!} -
-
-
-
- -@include('partials.asset_datetimepicker') -@include('partials.asset_select2') -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/data/program_bantuan/add_peserta.blade.php b/resources/views/data/program_bantuan/add_peserta.blade.php deleted file mode 100755 index 524187d16..000000000 --- a/resources/views/data/program_bantuan/add_peserta.blade.php +++ /dev/null @@ -1,109 +0,0 @@ -@extends('layouts.dashboard_template') - -@section('content') -
-

- {{ $page_title ?? "Page Title" }} - {{ $page_description ?? '' }} -

- -
- -
-
-
- @include( 'partials.flash_message' ) - - {!! Form::open( [ 'route' => 'data.program-bantuan.add_peserta', 'method' => 'post','id' => 'form-peserta', 'class' => 'form-horizontal form-label-left'] ) !!} - -
-
-
- Detail Program - - - - - - - - - - - - - - - - - -
Nama{{ $program->nama }}
Sasaran{{ $sasaran[$program->sasaran] }}
Periode Program{{ $program->start_date }} - {{ $program->end_date }}
Keterangan{{ $program->description }}
-
-
- -
- Tambahkan Peserta - @if (count($errors) > 0) -
- Oops! Ada yang salah dengan inputan Anda.

-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - -
- @if($program->sasaran == 1) - @include('data.program_bantuan._peserta_penduduk') - @elseif($program->sasaran == 2) - @include('data.program_bantuan._peserta_kk') - @endif -
- -
- -
- - {!! Form::close() !!} -
-
- -
-@endsection -@include('partials.asset_datetimepicker') -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/data/program_bantuan/create.blade.php b/resources/views/data/program_bantuan/create.blade.php deleted file mode 100755 index e49e7d9ff..000000000 --- a/resources/views/data/program_bantuan/create.blade.php +++ /dev/null @@ -1,75 +0,0 @@ -@extends('layouts.dashboard_template') - -@section('content') -
-

- {{ $page_title ?? "Page Title" }} - {{ $page_description ?? '' }} -

- -
- -
-
-
- @include( 'partials.flash_message' ) - - {!! Form::open( [ 'route' => 'data.program-bantuan.store', 'method' => 'post','id' => 'form-bantuan', 'class' => 'form-horizontal form-label-left'] ) !!} - -
- - @if (count($errors) > 0) -
- Oops! Ada yang salah dengan inputan Anda.

-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - - @include('data.program_bantuan.form_create') - -
- - {!! Form::close() !!} -
-
- -
-@endsection -@include('partials.asset_datetimepicker') -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/data/program_bantuan/edit.blade.php b/resources/views/data/program_bantuan/edit.blade.php deleted file mode 100755 index 6ab2b81cf..000000000 --- a/resources/views/data/program_bantuan/edit.blade.php +++ /dev/null @@ -1,74 +0,0 @@ -@extends('layouts.dashboard_template') - -@section('content') -
-

- {{ $page_title ?? "Page Title" }} - {{ $page_description ?? '' }} -

- -
- -
-
-
- @include('partials.flash_message') - - {!! Form::model($program, [ 'route' => ['data.program-bantuan.update', $program->id], 'method' => 'put','id' => 'form-bantuan', 'class' => 'form-horizontal form-label-left'] ) !!} - -
- - @if (count($errors) > 0) -
- Oops! Ada yang salah dengan inputan Anda.

-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - - @include('data.program_bantuan.form_edit') - -
- - {!! Form::close() !!} -
-
- -
-@endsection -@include('partials.asset_datetimepicker') -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/data/program_bantuan/form_create.blade.php b/resources/views/data/program_bantuan/form_create.blade.php deleted file mode 100755 index 165d29229..000000000 --- a/resources/views/data/program_bantuan/form_create.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -
- - -
- {!! Form::select('sasaran', [1=> 'Penduduk/Perorangan', 2=> 'Keluarga - KK'], null, ['class' => 'form-control', 'required'=>true, 'id' => 'sasaran']) !!} -
-
-
- - -
- {!! Form::text('nama', null, ['placeholder' => 'Nama Program', 'required' => 'required', 'class' => 'form-control', 'id' => 'nama_program']) !!} -
-
- -
- - -
-
- {!! Form::text('start_date', null, ['placeholder' => 'Tanggal Mulai','class' => 'form-control datepicker', 'required'=>true]) !!} -
-
- {!! Form::text('end_date', null, ['placeholder' => 'Tanggal Selesai','class' => 'form-control datepicker', 'required'=>true]) !!} -
-
-
-
- - -
- {!! Form::textarea('description', null, ['rows'=>2, 'class' => 'textarea', 'placeholder' => 'Keterangan', 'class' => 'form-control', 'id' => 'description']) !!} -
-
-
diff --git a/resources/views/data/program_bantuan/form_edit.blade.php b/resources/views/data/program_bantuan/form_edit.blade.php deleted file mode 100755 index 165d29229..000000000 --- a/resources/views/data/program_bantuan/form_edit.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -
- - -
- {!! Form::select('sasaran', [1=> 'Penduduk/Perorangan', 2=> 'Keluarga - KK'], null, ['class' => 'form-control', 'required'=>true, 'id' => 'sasaran']) !!} -
-
-
- - -
- {!! Form::text('nama', null, ['placeholder' => 'Nama Program', 'required' => 'required', 'class' => 'form-control', 'id' => 'nama_program']) !!} -
-
- -
- - -
-
- {!! Form::text('start_date', null, ['placeholder' => 'Tanggal Mulai','class' => 'form-control datepicker', 'required'=>true]) !!} -
-
- {!! Form::text('end_date', null, ['placeholder' => 'Tanggal Selesai','class' => 'form-control datepicker', 'required'=>true]) !!} -
-
-
-
- - -
- {!! Form::textarea('description', null, ['rows'=>2, 'class' => 'textarea', 'placeholder' => 'Keterangan', 'class' => 'form-control', 'id' => 'description']) !!} -
-
-
diff --git a/resources/views/data/program_bantuan/import.blade.php b/resources/views/data/program_bantuan/import.blade.php index 541a3a8f0..9a46a5a3e 100644 --- a/resources/views/data/program_bantuan/import.blade.php +++ b/resources/views/data/program_bantuan/import.blade.php @@ -1,25 +1,25 @@ @extends('layouts.dashboard_template') @section('content') -
-

- {{ $page_title ?? "Page Title" }} - {{ $page_description ?? '' }} -

- -
+
+

+ {{ $page_title ?? 'Page Title' }} + {{ $page_description ?? '' }} +

+ +
-
+
- @include('partials.flash_message') -
-
+ @include('partials.flash_message') +
+
- {!! Form::open( [ 'route' => 'data.program-bantuan.do_import', 'method' => 'post','id' => 'form-import', 'class' => 'form-horizontal form-label-left', 'files' => true ] ) !!} + {!! Form::open(['route' => 'data.program-bantuan.do_import', 'method' => 'post', 'id' => 'form-import', 'class' => 'form-horizontal form-label-left', 'files' => true]) !!}
@@ -37,17 +37,21 @@
- +
- +

Instruksi Unggah Data:

-

Silahkan unduh template unggah data di sini: Unduh

+

Silahkan unduh template unggah data di sini: Unduh +

@@ -56,50 +60,49 @@
- + - +
{!! Form::close() !!}
-
-
+ +
@endsection -@include(('partials.asset_select2')) -@include(('partials.asset_datetimepicker')) +@include('partials.asset_select2') +@include('partials.asset_datetimepicker') @push('scripts') - + //Datetimepicker + $('.datepicker').each(function() { + var $this = $(this); + $this.datetimepicker({ + format: 'YYYY-MM-D' + }); + }); + }) + @endpush diff --git a/resources/views/data/program_bantuan/show.blade.php b/resources/views/data/program_bantuan/show.blade.php index b6b011c95..31bb7d2e3 100644 --- a/resources/views/data/program_bantuan/show.blade.php +++ b/resources/views/data/program_bantuan/show.blade.php @@ -1,6 +1,5 @@ @extends('layouts.dashboard_template') - @section('content')

@@ -15,53 +14,28 @@

- - @include('partials.flash_message') -
- - - - - - - - - - - - - - - - - -
Nama: {{ $program->nama }}
Sasaran: {{ $sasaran[$program->sasaran] }}
Periode Program: {{ $program->start_date }} - {{ $program->end_date }}
Keterangan: {{ $program->description }}
-
-
- Daftar Peserta Program -
- - @if ($program->sasaran == 1) - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +

diff --git a/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip b/storage/app/public/template_upload/program_bantuan_22_12_2020_opendk.zip index c4f366af6151bab16f682a31c795c9b58c4ca761..1b4912313243c365ea27fbd5d8172d4dd71b676c 100644 GIT binary patch delta 43 vcmbQwJD-;)z?+#xgn@y9gP}8SBhPn6rp~y{tW2+%f%N2$tbriPg)JHY?z{{$ delta 43 vcmbQwJD-;)z?+#xgn@y9gTW Date: Mon, 30 May 2022 14:00:39 +0800 Subject: [PATCH 04/13] Update 2022_04_20_115358_alter_programbantuan.php --- .../migrations/2022_04_20_115358_alter_programbantuan.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/database/migrations/2022_04_20_115358_alter_programbantuan.php b/database/migrations/2022_04_20_115358_alter_programbantuan.php index db223692c..fbbffcc4e 100644 --- a/database/migrations/2022_04_20_115358_alter_programbantuan.php +++ b/database/migrations/2022_04_20_115358_alter_programbantuan.php @@ -44,9 +44,6 @@ public function up() { Schema::table('das_program', function (Blueprint $table) { $table->text('description')->nullable()->change(); - $table->integer('id')->nullable(false)->unsigned()->change(); - $table->dropPrimary('id'); - $table->unique(['id', 'desa_id']); }); } @@ -59,7 +56,6 @@ public function down() { Schema::table('das_program', function (Blueprint $table) { $table->string('description', 200)->nullable()->change(); - $table->integer('id', true)->nullable(false)->change(); }); } } From b6a90c5f322b79ea897158c2f59dea30228b0f4e Mon Sep 17 00:00:00 2001 From: andifahruddinakas Date: Mon, 30 May 2022 06:09:30 +0000 Subject: [PATCH 05/13] Fix styling --- app/Imports/SinkronPesertaBantuan.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Imports/SinkronPesertaBantuan.php b/app/Imports/SinkronPesertaBantuan.php index 8d5ac47a0..b0e641137 100644 --- a/app/Imports/SinkronPesertaBantuan.php +++ b/app/Imports/SinkronPesertaBantuan.php @@ -31,12 +31,10 @@ namespace App\Imports; -use App\Models\Keluarga; use App\Models\Penduduk; use App\Models\PesertaProgram; use Exception; use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; From d84c3ee5e9eec63a4a39e7a8b1efe4abf8688872 Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Mon, 30 May 2022 14:40:35 +0800 Subject: [PATCH 06/13] Update 2022_04_20_115358_alter_programbantuan.php --- database/migrations/2022_04_20_115358_alter_programbantuan.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/database/migrations/2022_04_20_115358_alter_programbantuan.php b/database/migrations/2022_04_20_115358_alter_programbantuan.php index fbbffcc4e..31e4cea7e 100644 --- a/database/migrations/2022_04_20_115358_alter_programbantuan.php +++ b/database/migrations/2022_04_20_115358_alter_programbantuan.php @@ -43,6 +43,7 @@ class AlterProgrambantuan extends Migration public function up() { Schema::table('das_program', function (Blueprint $table) { + $table->bigInteger('id_program_desa')->after('id'); $table->text('description')->nullable()->change(); }); } @@ -55,6 +56,7 @@ public function up() public function down() { Schema::table('das_program', function (Blueprint $table) { + $table->dropColumn('id_program_desa'); $table->string('description', 200)->nullable()->change(); }); } From 4bdcbd7f9db37869bba033e5e75fd6d7f5c0ce65 Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 09:17:14 +0800 Subject: [PATCH 07/13] Revert "Update 2022_04_20_115358_alter_programbantuan.php" This reverts commit efbfb3a2991531429e4df0e0d129867de7f31647. --- .../migrations/2022_04_20_115358_alter_programbantuan.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/database/migrations/2022_04_20_115358_alter_programbantuan.php b/database/migrations/2022_04_20_115358_alter_programbantuan.php index 31e4cea7e..9b6b7748b 100644 --- a/database/migrations/2022_04_20_115358_alter_programbantuan.php +++ b/database/migrations/2022_04_20_115358_alter_programbantuan.php @@ -45,6 +45,9 @@ public function up() Schema::table('das_program', function (Blueprint $table) { $table->bigInteger('id_program_desa')->after('id'); $table->text('description')->nullable()->change(); + $table->integer('id')->nullable(false)->unsigned()->change(); + $table->dropPrimary('id'); + $table->unique(['id', 'desa_id']); }); } @@ -58,6 +61,7 @@ public function down() Schema::table('das_program', function (Blueprint $table) { $table->dropColumn('id_program_desa'); $table->string('description', 200)->nullable()->change(); + $table->integer('id', true)->nullable(false)->change(); }); } } From ef93b09ac8796d78f734e05ff5a93b58c4bda258 Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 09:17:24 +0800 Subject: [PATCH 08/13] Revert "Update 2022_04_20_115358_alter_programbantuan.php" This reverts commit d84c3ee5e9eec63a4a39e7a8b1efe4abf8688872. --- database/migrations/2022_04_20_115358_alter_programbantuan.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/database/migrations/2022_04_20_115358_alter_programbantuan.php b/database/migrations/2022_04_20_115358_alter_programbantuan.php index 9b6b7748b..db223692c 100644 --- a/database/migrations/2022_04_20_115358_alter_programbantuan.php +++ b/database/migrations/2022_04_20_115358_alter_programbantuan.php @@ -43,7 +43,6 @@ class AlterProgrambantuan extends Migration public function up() { Schema::table('das_program', function (Blueprint $table) { - $table->bigInteger('id_program_desa')->after('id'); $table->text('description')->nullable()->change(); $table->integer('id')->nullable(false)->unsigned()->change(); $table->dropPrimary('id'); @@ -59,7 +58,6 @@ public function up() public function down() { Schema::table('das_program', function (Blueprint $table) { - $table->dropColumn('id_program_desa'); $table->string('description', 200)->nullable()->change(); $table->integer('id', true)->nullable(false)->change(); }); From ec8a8b27a4e233abdf4c029bcb3c7f3ca2f628ab Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 09:33:27 +0800 Subject: [PATCH 09/13] Update ProgramBantuanController.php --- app/Http/Controllers/Data/ProgramBantuanController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Data/ProgramBantuanController.php b/app/Http/Controllers/Data/ProgramBantuanController.php index 01456ec32..55ad1a860 100644 --- a/app/Http/Controllers/Data/ProgramBantuanController.php +++ b/app/Http/Controllers/Data/ProgramBantuanController.php @@ -70,7 +70,7 @@ public function getaProgramBantuan(Request $request) ->rawColumns(['aksi'])->make(); } - public function show($id) + public function show($id, $desa_id) { $program = Program::with('desa')->findOrFail($id); $page_title = 'Detail Program'; From b06996baf5ab02a89c860a812ff5298e17550969 Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 10:11:35 +0800 Subject: [PATCH 10/13] Ganti kode_desa jadi desa_id --- .../Data/DataPembangunanController.php | 12 +++++------ app/Imports/SinkronBantuan.php | 2 +- app/Imports/SinkronPembangunan.php | 4 ++-- app/Imports/SinkronPembangunanDokumentasi.php | 20 +++++++++---------- app/Imports/SinkronPesertaBantuan.php | 6 +++--- ...17_225617_create_table_das_pembangunan.php | 4 ++-- ...eate_table_das_pembangunan_dokumentasi.php | 4 ++-- .../views/data/pembangunan/rincian.blade.php | 2 +- routes/web.php | 4 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/Http/Controllers/Data/DataPembangunanController.php b/app/Http/Controllers/Data/DataPembangunanController.php index e8337c89f..723d2cb40 100644 --- a/app/Http/Controllers/Data/DataPembangunanController.php +++ b/app/Http/Controllers/Data/DataPembangunanController.php @@ -56,31 +56,31 @@ public function getPembangunan(Request $request) $pembangunan = Pembangunan::when($desa, function ($q) use ($desa) { return $desa === 'Semua' - ? $q : $q->where('kode_desa', $desa); + ? $q : $q->where('desa_id', $desa); }) ->with('dokumentasi'); return DataTables::of($pembangunan) ->addColumn('aksi', function ($row) { - $data['detail_url'] = route('data.pembangunan.rincian', ['id' => $row->id,'kode_desa' => $row->kode_desa]); + $data['detail_url'] = route('data.pembangunan.rincian', ['id' => $row->id,'desa_id' => $row->desa_id]); return view('forms.aksi', $data); })->make(); } } - public function rincian($id, $kode_desa) + public function rincian($id, $desa_id) { $page_title = 'Pembangunan'; $page_description = 'Rincian Pembangunan'; - $pembangunan = Pembangunan::where('id', $id)->where('kode_desa', $kode_desa)->first(); + $pembangunan = Pembangunan::where('id', $id)->where('desa_id', $desa_id)->first(); return view('data.pembangunan.rincian', compact('page_title', 'page_description', 'pembangunan')); } - public function getrinciandata($id, $kode_desa) + public function getrinciandata($id, $desa_id) { if (request()->ajax()) { - $pembangunanDokumentasi = PembangunanDokumentasi::where('kode_desa', $kode_desa)->where('id_pembangunan', $id)->get(); + $pembangunanDokumentasi = PembangunanDokumentasi::where('desa_id', $desa_id)->where('id_pembangunan', $id)->get(); return DataTables::of($pembangunanDokumentasi) ->addIndexColumn() ->make(); diff --git a/app/Imports/SinkronBantuan.php b/app/Imports/SinkronBantuan.php index d8202359e..121b59c33 100644 --- a/app/Imports/SinkronBantuan.php +++ b/app/Imports/SinkronBantuan.php @@ -58,6 +58,7 @@ public function collection(Collection $collection) { foreach ($collection as $value) { $insert = [ + 'desa_id' => $value['desa_id'], 'id' => $value['id'], 'nama' => $value['nama'], 'sasaran' => $value['sasaran'], @@ -65,7 +66,6 @@ public function collection(Collection $collection) 'start_date' => $value['sdate'], 'end_date' => $value['edate'], 'description' => $value['ndesc'], - 'desa_id' => $value['kode_desa'] ]; Program::updateOrCreate([ diff --git a/app/Imports/SinkronPembangunan.php b/app/Imports/SinkronPembangunan.php index 364f32457..fa0420691 100644 --- a/app/Imports/SinkronPembangunan.php +++ b/app/Imports/SinkronPembangunan.php @@ -58,6 +58,7 @@ public function collection(Collection $collection) { foreach ($collection as $value) { $insert = [ + "desa_id" => $value['desa_id'], "id" => $value['id'], "sumber_dana" => $value['sumber_dana'], "lokasi" => $value['lokasi'], @@ -77,11 +78,10 @@ public function collection(Collection $collection) "manfaat" => $value['manfaat'], "waktu" => $value['waktu'], "foto" => $value['foto'], - "kode_desa" => (string) $value['desa_id'], ]; Pembangunan::updateOrCreate([ - 'kode_desa' => $insert['kode_desa'], + 'desa_id' => $insert['desa_id'], 'id' => $insert['id'] ], $insert); } diff --git a/app/Imports/SinkronPembangunanDokumentasi.php b/app/Imports/SinkronPembangunanDokumentasi.php index a4df5f52f..dc0eaa45d 100644 --- a/app/Imports/SinkronPembangunanDokumentasi.php +++ b/app/Imports/SinkronPembangunanDokumentasi.php @@ -58,20 +58,20 @@ public function collection(Collection $collection) { foreach ($collection as $value) { $insert = [ - "id" => $value['id'], + "desa_id" => $value['desa_id'], + "id" => $value['id'], "id_pembangunan" => $value['id_pembangunan'], - "gambar" => $value['gambar'], - "persentase" => $value['persentase'], - "keterangan" => $value['keterangan'], - "created_at" => $value['created_at'], - "updated_at" => $value['updated_at'], - "kode_desa" => (string) $value['desa_id'], + "gambar" => $value['gambar'], + "persentase" => $value['persentase'], + "keterangan" => $value['keterangan'], + "created_at" => $value['created_at'], + "updated_at" => $value['updated_at'], ]; PembangunanDokumentasi::updateOrCreate([ - 'kode_desa' => $insert['kode_desa'], - 'id' => $insert['id'], - 'id_pembangunan' => $insert['id_pembangunan'] + 'desa_id' => $insert['desa_id'], + 'id' => $insert['id'], + 'id_pembangunan' => $insert['id_pembangunan'] ], $insert); } } diff --git a/app/Imports/SinkronPesertaBantuan.php b/app/Imports/SinkronPesertaBantuan.php index b0e641137..e07145ea1 100644 --- a/app/Imports/SinkronPesertaBantuan.php +++ b/app/Imports/SinkronPesertaBantuan.php @@ -83,6 +83,7 @@ public function collection(Collection $collection) } $insert = [ + 'desa_id' => $value['kode_desa'], 'id' => $value['id'], 'peserta' => $value['peserta'], 'program_id' => $value['program_id'], @@ -94,13 +95,12 @@ public function collection(Collection $collection) 'kartu_tanggal_lahir' => $value['kartu_tanggal_lahir'], 'kartu_alamat' => $value['kartu_alamat'], 'kartu_peserta' => $value['kartu_peserta'], - 'desa_id' => $value['kode_desa'], ]; PesertaProgram::updateOrCreate([ - 'kartu_nik' => $insert['kartu_nik'], + 'desa_id' => $insert['desa_id'], 'program_id' => $insert['program_id'], - 'desa_id' => $insert['desa_id'] + 'kartu_nik' => $insert['kartu_nik'], ], $insert); } diff --git a/database/migrations/2022_04_17_225617_create_table_das_pembangunan.php b/database/migrations/2022_04_17_225617_create_table_das_pembangunan.php index 828b358d0..bd9f3bc5e 100644 --- a/database/migrations/2022_04_17_225617_create_table_das_pembangunan.php +++ b/database/migrations/2022_04_17_225617_create_table_das_pembangunan.php @@ -44,7 +44,7 @@ public function up() { Schema::create('das_pembangunan', function (Blueprint $table) { $table->integer('id', false); - $table->char('kode_desa', 13); + $table->char('desa_id', 13); $table->string('lokasi', 255)->nullable(); $table->string('sumber_dana', 255)->nullable(); $table->string('judul', 255)->nullable(); @@ -65,7 +65,7 @@ public function up() $table->string('manfaat', 100)->nullable(); $table->integer('waktu')->nullable(); $table->timestamps(); - $table->unique(['id', 'kode_desa']); + $table->unique(['id', 'desa_id']); }); } diff --git a/database/migrations/2022_04_18_070823_create_table_das_pembangunan_dokumentasi.php b/database/migrations/2022_04_18_070823_create_table_das_pembangunan_dokumentasi.php index 8e86f5b64..d8e20e90f 100644 --- a/database/migrations/2022_04_18_070823_create_table_das_pembangunan_dokumentasi.php +++ b/database/migrations/2022_04_18_070823_create_table_das_pembangunan_dokumentasi.php @@ -45,12 +45,12 @@ public function up() Schema::create('das_pembangunan_dokumentasi', function (Blueprint $table) { $table->integer('id'); $table->integer('id_pembangunan'); - $table->char('kode_desa', 13); + $table->char('desa_id', 13); $table->string('gambar', 255)->nullable(); $table->string('persentase', 255)->nullable(); $table->string('keterangan', 255)->nullable(); $table->timestamps(); - $table->unique(['id', 'kode_desa', 'id_pembangunan']); + $table->unique(['id', 'desa_id', 'id_pembangunan']); }); } diff --git a/resources/views/data/pembangunan/rincian.blade.php b/resources/views/data/pembangunan/rincian.blade.php index 1e3296844..22963b28c 100644 --- a/resources/views/data/pembangunan/rincian.blade.php +++ b/resources/views/data/pembangunan/rincian.blade.php @@ -73,7 +73,7 @@ processing: true, serverSide: true, ajax: { - url: "{!! route( 'data.pembangunan.getrinciandata', ['id' => $pembangunan->id, 'kode_desa' => $pembangunan->kode_desa ] ) !!}" + url: "{!! route( 'data.pembangunan.getrinciandata', ['id' => $pembangunan->id, 'desa_id' => $pembangunan->desa_id ] ) !!}" }, columns: [ {data: 'DT_RowIndex', name: 'DT_RowIndex', class: 'text-center', searchable: false, orderable: true}, diff --git a/routes/web.php b/routes/web.php index a544f78f9..408dacd3a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -445,8 +445,8 @@ Route::group(['prefix' => 'pembangunan', 'middleware' => ['role:super-admin|administrator-website|admin-desa']], function () { Route::get('/', ['as' => 'data.pembangunan.index', 'uses' => 'DataPembangunanController@index']); Route::get('getdata', ['as' => 'data.pembangunan.getdata', 'uses' => 'DataPembangunanController@getPembangunan']); - Route::get('rincian/{id}/{kode_desa}', ['as' => 'data.pembangunan.rincian', 'uses' => 'DataPembangunanController@rincian']); - Route::get('getrinciandata/{id}/{kode_desa}', ['as' => 'data.pembangunan.getrinciandata', 'uses' => 'DataPembangunanController@getrinciandata']); + Route::get('rincian/{id}/{desa_id}', ['as' => 'data.pembangunan.rincian', 'uses' => 'DataPembangunanController@rincian']); + Route::get('getrinciandata/{id}/{desa_id}', ['as' => 'data.pembangunan.getrinciandata', 'uses' => 'DataPembangunanController@getrinciandata']); }); }); From 6f818b2a7f5a7819527dbc9516eb32d143612b5e Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 10:22:33 +0800 Subject: [PATCH 11/13] Update SinkronPesertaBantuan.php --- app/Imports/SinkronPesertaBantuan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Imports/SinkronPesertaBantuan.php b/app/Imports/SinkronPesertaBantuan.php index e07145ea1..74640dddf 100644 --- a/app/Imports/SinkronPesertaBantuan.php +++ b/app/Imports/SinkronPesertaBantuan.php @@ -83,7 +83,7 @@ public function collection(Collection $collection) } $insert = [ - 'desa_id' => $value['kode_desa'], + 'desa_id' => $value['desa_id'], 'id' => $value['id'], 'peserta' => $value['peserta'], 'program_id' => $value['program_id'], From 40500371dfbc2d240d5d8b27e808a2e7d5257865 Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 10:28:07 +0800 Subject: [PATCH 12/13] Update SinkronPembangunan.php --- app/Imports/SinkronPembangunan.php | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Imports/SinkronPembangunan.php b/app/Imports/SinkronPembangunan.php index fa0420691..31c1f472c 100644 --- a/app/Imports/SinkronPembangunan.php +++ b/app/Imports/SinkronPembangunan.php @@ -58,31 +58,31 @@ public function collection(Collection $collection) { foreach ($collection as $value) { $insert = [ - "desa_id" => $value['desa_id'], - "id" => $value['id'], - "sumber_dana" => $value['sumber_dana'], - "lokasi" => $value['lokasi'], - "keterangan" => $value['keterangan'], - "judul" => $value['judul'], - "volume" => $value['volume'], - "tahun_anggaran" => $value['tahun_anggaran'], - "pelaksana_kegiatan" => $value['pelaksana_kegiatan'], - "status" => $value['status'], - "anggaran" => $value['anggaran'], - "perubahan_anggaran" => $value['perubahan_anggaran'], + "desa_id" => $value['desa_id'], + "id" => $value['id'], + "sumber_dana" => $value['sumber_dana'], + "lokasi" => $value['lokasi'], + "keterangan" => $value['keterangan'], + "judul" => $value['judul'], + "volume" => $value['volume'], + "tahun_anggaran" => $value['tahun_anggaran'], + "pelaksana_kegiatan" => $value['pelaksana_kegiatan'], + "status" => $value['status'], + "anggaran" => $value['anggaran'], + "perubahan_anggaran" => $value['perubahan_anggaran'], "sumber_biaya_pemerintah" => $value['sumber_biaya_pemerintah'], - "sumber_biaya_provinsi" => $value['sumber_biaya_provinsi'], - "sumber_biaya_kab_kota" => $value['sumber_biaya_kab_kota'], - "sumber_biaya_swadaya" => $value['sumber_biaya_swadaya'], - "sumber_biaya_jumlah" => $value['sumber_biaya_jumlah'], - "manfaat" => $value['manfaat'], - "waktu" => $value['waktu'], - "foto" => $value['foto'], + "sumber_biaya_provinsi" => $value['sumber_biaya_provinsi'], + "sumber_biaya_kab_kota" => $value['sumber_biaya_kab_kota'], + "sumber_biaya_swadaya" => $value['sumber_biaya_swadaya'], + "sumber_biaya_jumlah" => $value['sumber_biaya_jumlah'], + "manfaat" => $value['manfaat'], + "waktu" => $value['waktu'], + "foto" => $value['foto'], ]; Pembangunan::updateOrCreate([ 'desa_id' => $insert['desa_id'], - 'id' => $insert['id'] + 'id' => $insert['id'] ], $insert); } } From 5d3fca6f6dbaf36c6c811769736c70fbb4a30c2e Mon Sep 17 00:00:00 2001 From: Andi Fahruddin Akas Date: Tue, 31 May 2022 10:43:10 +0800 Subject: [PATCH 13/13] Update PembangunanController.php --- app/Http/Controllers/Api/PembangunanController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/PembangunanController.php b/app/Http/Controllers/Api/PembangunanController.php index c8bd7ef33..88c7a469b 100644 --- a/app/Http/Controllers/Api/PembangunanController.php +++ b/app/Http/Controllers/Api/PembangunanController.php @@ -73,7 +73,7 @@ public function store(PembangunanRequest $request) return response()->json([ "message" => "Proses Sinkronisasi Data gagal. Error : " . $e->getMessage(), "status" => "danger" - ]); + ]); } // Hapus folder temp ketika sudah selesai @@ -82,8 +82,8 @@ public function store(PembangunanRequest $request) Storage::disk('public')->delete('pembangunan/' . $filecsv); return response()->json([ - "message" => "Proses Sinkronisasi Data Pembangunan OpenSID sedang berjalan", - "status" => "success" + "message" => "Proses Sinkronisasi Data Pembangunan OpenSID sedang berjalan", + "status" => "success" ]); } @@ -118,8 +118,8 @@ public function storeDokumentasi(PembangunanDokumentasiRequest $request) Storage::disk('public')->delete('pembangunan/' . $filecsv); return response()->json([ - "message" => "Proses Sinkronisasi Data Pembangunan OpenSID sedang berjalan", - "status" => "success" + "message" => "Proses Sinkronisasi Data Pembangunan OpenSID sedang berjalan", + "status" => "success" ]); } }