From d57e82196aa3cebed1c3dcba2596874270386d31 Mon Sep 17 00:00:00 2001 From: Pusdatin BPKD Jkt Date: Thu, 21 Jul 2022 11:23:32 +0700 Subject: [PATCH] Notifikasi --- .../Controllers/JadwalSalurdanaController.php | 3 +- app/Http/Controllers/NotifikasiController.php | 76 +++++++- .../RealisasiBelanjaController.php | 3 +- resources/views/notifikasi/create.blade.php | 24 +++ resources/views/notifikasi/edit.blade.php | 42 ++++ resources/views/notifikasi/form.blade.php | 180 ++++++++++++++++++ resources/views/notifikasi/index.blade.php | 142 ++++++++++++++ resources/views/notifikasi/show.blade.php | 117 ++++++++++++ resources/views/partials/menu.blade.php | 4 +- routes/web.php | 6 +- 10 files changed, 583 insertions(+), 14 deletions(-) create mode 100644 resources/views/notifikasi/create.blade.php create mode 100644 resources/views/notifikasi/edit.blade.php create mode 100644 resources/views/notifikasi/form.blade.php create mode 100644 resources/views/notifikasi/index.blade.php create mode 100644 resources/views/notifikasi/show.blade.php diff --git a/app/Http/Controllers/JadwalSalurdanaController.php b/app/Http/Controllers/JadwalSalurdanaController.php index e4eebf3..03b5931 100644 --- a/app/Http/Controllers/JadwalSalurdanaController.php +++ b/app/Http/Controllers/JadwalSalurdanaController.php @@ -18,8 +18,7 @@ class JadwalSalurdanaController extends Controller public function index() { - return view('jadwal_salurdana.index') - ->with('i', (request()->input('page', 1) - 1) * 10); + return view('jadwal_salurdana.index'); } public function datatable(Request $request) diff --git a/app/Http/Controllers/NotifikasiController.php b/app/Http/Controllers/NotifikasiController.php index 7369ce4..c0754aa 100644 --- a/app/Http/Controllers/NotifikasiController.php +++ b/app/Http/Controllers/NotifikasiController.php @@ -9,14 +9,78 @@ use Illuminate\Support\Facades\Auth; class NotifikasiController extends Controller { - /** - * Display a listing of the resource. - * - * @return \Illuminate\Http\Response - */ + public function __construct(){ + $this->siteTitle = "Notifikasi"; + parent::__construct(); + } + public function index() { - // + return view('notifikasi.index'); + } + + public function create() + { + } + + public function store(Request $request) + { + } + + public function edit(DbhBelanjaRealisasi $realisasi_belanja) + { + } + + public function update(Request $request, DbhBelanjaRealisasi $realisasi_belanja) + { + } + + public function datatable(Request $request) + { + $post = $request->all(); + $offset = $post["start"]; + $limit = $post["length"]; + $src = $post["src"]; + + $dataFilter=0; + $data = Notifikasi::where("userid",Auth::user()->id)->orderBy("created_at","DESC"); + if (!empty($src)){ + $data->whereRaw("(LOWER(message) LIKE '%".strtolower($src)."%')"); + } + $dataFilter = $data->count(); + $dataTotal = Notifikasi::where("userid",Auth::user()->id)->count(); + + return response()->json([ + "recordsTotal" => $dataTotal, + "recordsFiltered" => $dataFilter, + "data"=> $data->skip($offset)->take($limit)->get() + ]); + } + + public function destroy(DbhBelanjaRealisasi $realisasi_belanja) + { + // try{ + // DB::beginTransaction(); + // $realisasi_belanja->delete(); + // DB::commit(); + // return redirect()->route('realisasi-pendapatan.index') + // ->with('success','Data Realisasi Pendapatan berhasil dihapus!'); + + // }catch(Throwable $e){ + + // DB::rollBack(); + // return redirect()->route('realisasi-pendapatan.index') + // ->with('error','Data Realisasi Pendapatan gagal dihapus.'); + // } + } + + public function show(DbhBelanjaRealisasi $realisasi_belanja) + { + // if (!Auth::user()->can("Lihat SKPP")){ + // abort(403, 'Youre not allowed to visit this page!'); + // } + // $this->setSubtitle("Detail Data"); + // return view('realisasi_belanja.show',compact("realisasi_belanja")); } public function getNotif(Request $request) diff --git a/app/Http/Controllers/RealisasiBelanjaController.php b/app/Http/Controllers/RealisasiBelanjaController.php index 29f9f7c..4667cd1 100644 --- a/app/Http/Controllers/RealisasiBelanjaController.php +++ b/app/Http/Controllers/RealisasiBelanjaController.php @@ -21,8 +21,7 @@ class RealisasiBelanjaController extends Controller public function index() { - return view('realisasi_belanja.index') - ->with('i', (request()->input('page', 1) - 1) * 10); + return view('realisasi_belanja.index'); } public function create() diff --git a/resources/views/notifikasi/create.blade.php b/resources/views/notifikasi/create.blade.php new file mode 100644 index 0000000..0516a1e --- /dev/null +++ b/resources/views/notifikasi/create.blade.php @@ -0,0 +1,24 @@ +@php + $siteBreadcumb = [ + ["url"=>"/realisasi-pendapatan","label"=>$siteTitle], + ["url"=>"/realisasi-pendapatan/create","label"=>$sitesubTitle] + ]; +@endphp + +@extends('layouts.app') + +@section('content') + @section('card_header') +
+

{{ $sitesubTitle }}

+
+ {{-- @if(auth()->user()->can('Tambah SKPP')) --}} + + {{-- @endif --}} +
+
+ @stop +
+ @csrf + @include('realisasi_pendapatan.form') +@endsection \ No newline at end of file diff --git a/resources/views/notifikasi/edit.blade.php b/resources/views/notifikasi/edit.blade.php new file mode 100644 index 0000000..30a3c8a --- /dev/null +++ b/resources/views/notifikasi/edit.blade.php @@ -0,0 +1,42 @@ +@php + $siteBreadcumb = [ + ["url"=>"/realisasi-pendapatan","label"=>$siteTitle], + ["url"=>"/realisasi-pendapatan/$realisasi_pendapatan->id/edit","label"=>$sitesubTitle] + ]; +@endphp + +@extends('layouts.app') + +@section('content') + @section('card_header') +
+

{{ $sitesubTitle }}

+
+ {{-- @if(auth()->user()->can('Tambah SKPP')) --}} + + {{-- @endif --}} +
+
+ @stop + + @csrf + @include('realisasi_pendapatan.form') + @method('PUT') +@stop + +@section('scripts2') + +@endsection \ No newline at end of file diff --git a/resources/views/notifikasi/form.blade.php b/resources/views/notifikasi/form.blade.php new file mode 100644 index 0000000..ec80491 --- /dev/null +++ b/resources/views/notifikasi/form.blade.php @@ -0,0 +1,180 @@ +
+
+
+ + +
+
+ + + +
+
+
RINCIAN
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + +@section('scripts') + +@endsection \ No newline at end of file diff --git a/resources/views/notifikasi/index.blade.php b/resources/views/notifikasi/index.blade.php new file mode 100644 index 0000000..6c337d6 --- /dev/null +++ b/resources/views/notifikasi/index.blade.php @@ -0,0 +1,142 @@ +@php + $siteBreadcumb = [ + ["url"=>"/realisasi-pendapatan","label"=>$siteTitle], + ]; +@endphp + +@extends('layouts.app') + +@section('styles') + + + + + +@endsection + +@section('card_header') +
+

{{ $sitesubTitle }}

+
+ +
+
+@stop + +@section('content') +
+
+
+ + +
+
+
+ + + + + + + + + + + + + +
NoDariUntukJudulPesanStatusAksi
+@stop +@section('scripts') + + + + + + + + + + + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/notifikasi/show.blade.php b/resources/views/notifikasi/show.blade.php new file mode 100644 index 0000000..4fe0232 --- /dev/null +++ b/resources/views/notifikasi/show.blade.php @@ -0,0 +1,117 @@ +@php + $siteBreadcumb = [ + ["url"=>"/realisasi-pendapatan","label"=>$siteTitle], + ]; +@endphp + +@extends('layouts.empty') + +@section('styles') +@endsection + +@section('content') +
+
+

{{ $sitesubTitle }}

+
+ +
+
+
+ @include('realisasi_pendapatan.form') +
+
+
+
+

STS

+
+
+ id/sts") }}" method="POST" autocomplete="off"> + @csrf +
+ +
+ +
+
+
+ +
+ rkud_tgl)):"" }}" readonly> +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ can("Input STS DBH Realisasi Pendapatan")){ ?> +
+ +
+ + +
+
+@stop +@section('scripts2') + +@endsection \ No newline at end of file diff --git a/resources/views/partials/menu.blade.php b/resources/views/partials/menu.blade.php index ffb950b..79f1808 100644 --- a/resources/views/partials/menu.blade.php +++ b/resources/views/partials/menu.blade.php @@ -13,6 +13,7 @@ - @if(auth()->user()->can('Cetak Laporan SKPP')) - - @endif @if ($role == "admin" || $role == "superadmin") diff --git a/routes/web.php b/routes/web.php index 1e684ac..f52106c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -71,5 +71,9 @@ Route::group(['middleware' => 'auth'], function () { Route::post('role-list', [MstPenggunaController::class,'roleList']); Route::get('logout', [AuthController::class, 'logout'])->name('logout'); - Route::post('notif/get-notif', [NotifikasiController::class, 'getNotif']); + Route::group(['prefix' => 'notif'], function () { + Route::post('/datatable', [NotifikasiController::class,'datatable']); + Route::post('/get-notif', [NotifikasiController::class, 'getNotif']); + }); + Route::resource('notif', NotifikasiController::class); }); \ No newline at end of file