-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 305d48e Author: afa28 <[email protected]> Date: Thu Jul 29 19:37:31 2021 +0800 Catatan Rilis commit 4f271d2 Author: afa28 <[email protected]> Date: Thu Jul 29 19:05:52 2021 +0800 Template Catatan Rilis commit f1a51b7 Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu Jul 29 09:47:05 2021 +0800 docs: add nurisakbar as a contributor for code commit b94724f Merge: 892489d 8e07be0 Author: Andi Fahruddin Akas <[email protected]> Date: Wed Jul 28 23:31:09 2021 +0800 Merge pull request #204 : Penambahan opsi luas wilayah kecamatan commit 892489d Merge: f894741 262e623 Author: Andi Fahruddin Akas <[email protected]> Date: Wed Jul 28 23:06:45 2021 +0800 Merge pull request #196 : Laporan APBDes dari OpenSID commit 262e623 Author: afa28 <[email protected]> Date: Wed Jul 28 22:36:37 2021 +0800 Rules cek desa_id commit 8e07be0 Author: afa28 <[email protected]> Date: Wed Jul 28 19:37:55 2021 +0800 Riview - Sesuaikan migrasi - Sesuaikan view commit c4fd4e5 Author: Nuris Akbar <[email protected]> Date: Thu Jul 15 16:18:04 2021 +0100 Luas wilayah kecamatan commit f894741 Author: afa28 <[email protected]> Date: Wed Jul 28 19:19:51 2021 +0800 das_setting commit ae7aa62 Author: afa28 <[email protected]> Date: Wed Jul 28 19:17:39 2021 +0800 https://demo.opendk.or.id commit 7a7e92a Author: afa28 <[email protected]> Date: Wed Jul 28 18:22:22 2021 +0800 Perbaikan commit d6efa10 Author: Eddie Ridwan <[email protected]> Date: Sun Jul 25 16:17:13 2021 +1000 Filter berita desa menggunakan ajax commit acaa9f7 Author: Eddie Ridwan <[email protected]> Date: Wed Jul 21 22:55:09 2021 +1000 #109 Filter desa di berita commit 3f9e942 Author: afa28 <[email protected]> Date: Sun Jul 11 04:24:41 2021 +0800 Laporan APBDes
- Loading branch information
1 parent
249d040
commit 9a4c0b2
Showing
36 changed files
with
1,222 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ OpenDK (https://github.com/OpenSID/OpenDK) adalah aplikasi yang bisa digunakan o | |
Pedoman pemasangan dan penggunaan OpenDK dapat dilihat di wiki OpenDK di https://github.com/opensid/opendk/wiki. | ||
|
||
### 💻 DEMO | ||
Demo aplikasi OpenDK dapat dilihat di https://demo.opendk.my.id. Versi yang terlihat di demo itu adalah rilis terkini. | ||
Demo aplikasi OpenDK dapat dilihat di https://demo.opendk.or.id. Versi yang terlihat di demo itu adalah rilis terkini. | ||
|
||
Modul administrasi OpenDK demo dapat diaskses pada https://demo.opendk.my.id/index.php/login. Masukkan Username = [email protected] dan Password = password. | ||
Modul administrasi OpenDK demo dapat diaskses pada https://demo.opendk.or.id/index.php/login. Masukkan Username = [email protected] dan Password = password. | ||
|
||
### 💬 FORUM | ||
|
||
|
@@ -44,6 +44,7 @@ Berikut adalah teman-teman luar biasa yang telah berkontribusi langsung mengemba | |
<td align="center"><a href="https://facebook.com/faizulamaly"><img src="https://avatars.githubusercontent.com/u/31075119?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Faizul Amali</b></sub></a><br /><a href="https://github.com/OpenSID/OpenDK/commits?author=ilamazuliaf" title="Code">💻</a></td> | ||
<td align="center"><a href="https://ibnuis.dev"><img src="https://avatars.githubusercontent.com/u/14322078?v=4?s=100" width="100px;" alt=""/><br /><sub><b>IBNU HALIM MUSTOFA</b></sub></a><br /><a href="https://github.com/OpenSID/OpenDK/commits?author=ibnuhalimm" title="Code">💻</a></td> | ||
<td align="center"><a href="https://ahmadrosid.com"><img src="https://avatars.githubusercontent.com/u/29406408?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ahmadrosid</b></sub></a><br /><a href="https://github.com/OpenSID/OpenDK/commits?author=ahmadrosid" title="Code">💻</a></td> | ||
<td align="center"><a href="http://belajarphp.net"><img src="https://avatars.githubusercontent.com/u/5483330?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nuris Akbar</b></sub></a><br /><a href="https://github.com/OpenSID/OpenDK/commits?author=nurisakbar" title="Code">💻</a></td> | ||
</tr> | ||
</table> | ||
|
||
|
@@ -55,5 +56,5 @@ Berikut adalah teman-teman luar biasa yang telah berkontribusi langsung mengemba | |
Daftar kontributor sesuai spesifikasi [all-contributors](https://github.com/all-contributors/all-contributors), menggunakan @all-contributors Bot. | ||
|
||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors-) | ||
<!-- ALL-CONTRIBUTORS-BADGE:END --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\LaporanApbdesRequest; | ||
use App\Jobs\LaporanApbdesQueueJob; | ||
|
||
use function response; | ||
|
||
class LaporanApbdesController extends Controller | ||
{ | ||
/** | ||
* Create a new AuthController instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('auth:api'); | ||
} | ||
|
||
/** | ||
* Tambah / Ubah Data Apbdes Sesuai OpenSID | ||
* | ||
* @param ApbdesRequest $request | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function store(LaporanApbdesRequest $request) | ||
{ | ||
// dispatch queue job apbdes | ||
LaporanApbdesQueueJob::dispatch($request->only(['desa_id', 'laporan_apbdes'])); | ||
|
||
return response()->json([ | ||
'status' => 'success', | ||
'message' => 'Proses sync data APBDes OpenSID sedang berjalan', | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Data; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Imports\ImporLaporanApbdes; | ||
use App\Models\DataDesa; | ||
use App\Models\LaporanApbdes; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Response; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Storage; | ||
use Illuminate\Support\Str; | ||
use Yajra\DataTables\DataTables; | ||
|
||
use Exception; | ||
use ZipArchive; | ||
|
||
use function back; | ||
use function compact; | ||
use function redirect; | ||
use function route; | ||
use function view; | ||
|
||
class LaporanApbdesController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return Response | ||
*/ | ||
public function index(LaporanApbdes $apbdes) | ||
{ | ||
$page_title = 'Laporan APBDes'; | ||
$page_description = 'Data APBDes'; | ||
$list_desa = DataDesa::get(); | ||
|
||
return view('data.laporan-apbdes.index', compact('page_title', 'page_description', 'list_desa')); | ||
} | ||
|
||
/** | ||
* Return datatable Data Apbdes. | ||
* | ||
* @param Request $request | ||
* @return DataTables | ||
*/ | ||
public function getApbdes(Request $request) | ||
{ | ||
$desa = $request->input('desa'); | ||
|
||
$query = DB::table('das_apbdes') | ||
->leftJoin('das_data_desa', 'das_apbdes.desa_id', '=', 'das_data_desa.desa_id') | ||
->select([ | ||
'das_apbdes.id', | ||
'das_data_desa.nama as nama_desa', | ||
'das_apbdes.judul', | ||
'das_apbdes.tahun', | ||
'das_apbdes.semester', | ||
'das_apbdes.nama_file', | ||
'das_apbdes.imported_at', | ||
]) | ||
->when($desa, function ($query) use ($desa) { | ||
return $desa === 'ALL' | ||
? $query | ||
: $query->where('das_data_desa.desa_id', $desa); | ||
}); | ||
|
||
return DataTables::of($query) | ||
->addColumn('action', function ($row) { | ||
$delete_url = route('data.laporan-apbdes.destroy', $row->id); | ||
$download_url = asset('storage/apbdes/' . $row->nama_file); | ||
|
||
$data['delete_url'] = $delete_url; | ||
$data['download_url'] = $download_url; | ||
|
||
return view('forms.action', $data); | ||
})->make(); | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @return Response | ||
*/ | ||
public function destroy($id) | ||
{ | ||
try { | ||
$apbdes = LaporanApbdes::findOrFail($id); | ||
|
||
// Hapus file apbdes | ||
Storage::disk('public')->delete('apbdes/' . $apbdes->nama_file); | ||
|
||
$apbdes->delete(); | ||
|
||
return redirect()->route('data.laporan-apbdes.index')->with('success', 'Data sukses dihapus!'); | ||
} catch (\Illuminate\Database\QueryException $e) { | ||
return redirect()->route('data.laporan-apbdes.index')->with('error', 'Data gagal dihapus!'); | ||
} | ||
} | ||
|
||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return Response | ||
*/ | ||
public function import() | ||
{ | ||
$page_title = 'Laporan APBDes'; | ||
$page_description = 'Import Data'; | ||
|
||
return view('data.laporan-apbdes.import', compact('page_title', 'page_description')); | ||
} | ||
|
||
/** | ||
* Impor data apbdes dari file Excel. | ||
* Kalau apbdes sudah ada (berdasarkan NIK), update dengan data yg diimpor | ||
* | ||
* @return Response | ||
*/ | ||
public function do_import(Request $request) | ||
{ | ||
$this->validate($request, [ | ||
'file' => 'file|mimes:zip|max:51200', | ||
]); | ||
|
||
try { | ||
// Upload file zip temporary. | ||
$file = $request->file('file'); | ||
$file->storeAs('temp', $name = $file->getClientOriginalName()); | ||
|
||
// Temporary path file | ||
$path = storage_path("app/temp/{$name}"); | ||
$extract = storage_path('app/temp/apbdes/'); | ||
|
||
// Ekstrak file | ||
$zip = new ZipArchive; | ||
$zip->open($path); | ||
$zip->extractTo($extract); | ||
$zip->close(); | ||
|
||
// Proses impor excell | ||
(new ImporLaporanApbdes()) | ||
->queue($extract . Str::replaceLast('zip', 'xlsx', $name)); | ||
} catch (Exception $e) { | ||
return back()->with('error', 'Import data gagal. ' . $e->getMessage()); | ||
} | ||
|
||
return back()->with('success', 'Import data sukses.'); | ||
} | ||
|
||
} |
Oops, something went wrong.