From 982fdbde395fb55ac090c4359d5112079bb5ba1b Mon Sep 17 00:00:00 2001 From: blukang25 Date: Mon, 8 Nov 2021 17:19:32 +0700 Subject: [PATCH] some fundamental change --- .env copy.example | 46 +++++++++++++ .env.example | 46 ------------- .../Controllers/Backend/backendpController.php | 72 ++++++++++++++++++-- app/Http/Controllers/Backend/eofficeController.php | 21 ++---- .../2021_10_07_144619_create_kategoris_table.php | 38 +++++++++++ .../2021_10_07_154619_create_kategoris_table.php | 38 ----------- .../2021_10_08_110118_create_formals_table.php | 1 + .../2021_10_19_091721_create_eoffices_table.php | 1 - resources/views/backend/backendp/ajax.blade.php | 76 ++++++++++++++++++++++ .../views/backend/backendp/datatables.blade.php | 51 +++++++++++++++ .../backend/backendp/datatables_detail.blade.php | 49 ++++++++++++++ resources/views/backend/backendp/detail.blade.php | 33 ++++++++++ resources/views/backend/backendp/hapus.blade.php | 24 +++++++ resources/views/backend/backendp/index.blade.php | 39 +++++++++++ resources/views/backend/backendp/jquery.blade.php | 75 +++++++++++++++++++++ resources/views/backend/backendp/tambah.blade.php | 45 +++++++++++++ resources/views/backend/backendp/ubah.blade.php | 55 ++++++++++++++++ resources/views/backend/beprog/ajax.blade.php | 76 ---------------------- .../views/backend/beprog/datatables.blade.php | 51 --------------- .../backend/beprog/datatables_detail.blade.php | 49 -------------- resources/views/backend/beprog/detail.blade.php | 33 ---------- resources/views/backend/beprog/hapus.blade.php | 24 ------- resources/views/backend/beprog/index.blade.php | 39 ----------- resources/views/backend/beprog/jquery.blade.php | 75 --------------------- resources/views/backend/beprog/tambah.blade.php | 55 ---------------- resources/views/backend/beprog/ubah.blade.php | 58 ----------------- resources/views/backend/eoffice/ubah.blade.php | 5 +- routes/backend.php | 10 +-- 28 files changed, 610 insertions(+), 575 deletions(-) create mode 100644 .env copy.example delete mode 100644 .env.example create mode 100644 database/migrations/2021_10_07_144619_create_kategoris_table.php delete mode 100644 database/migrations/2021_10_07_154619_create_kategoris_table.php create mode 100644 resources/views/backend/backendp/ajax.blade.php create mode 100644 resources/views/backend/backendp/datatables.blade.php create mode 100644 resources/views/backend/backendp/datatables_detail.blade.php create mode 100644 resources/views/backend/backendp/detail.blade.php create mode 100644 resources/views/backend/backendp/hapus.blade.php create mode 100644 resources/views/backend/backendp/index.blade.php create mode 100644 resources/views/backend/backendp/jquery.blade.php create mode 100644 resources/views/backend/backendp/tambah.blade.php create mode 100644 resources/views/backend/backendp/ubah.blade.php delete mode 100644 resources/views/backend/beprog/ajax.blade.php delete mode 100644 resources/views/backend/beprog/datatables.blade.php delete mode 100644 resources/views/backend/beprog/datatables_detail.blade.php delete mode 100644 resources/views/backend/beprog/detail.blade.php delete mode 100644 resources/views/backend/beprog/hapus.blade.php delete mode 100644 resources/views/backend/beprog/index.blade.php delete mode 100644 resources/views/backend/beprog/jquery.blade.php delete mode 100644 resources/views/backend/beprog/tambah.blade.php delete mode 100644 resources/views/backend/beprog/ubah.blade.php diff --git a/.env copy.example b/.env copy.example new file mode 100644 index 0000000..c3aec94 --- /dev/null +++ b/.env copy.example @@ -0,0 +1,46 @@ +APP_NAME=GrandMaster +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost/grandmaster + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=gmoji +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.env.example b/.env.example deleted file mode 100644 index 2051f85..0000000 --- a/.env.example +++ /dev/null @@ -1,46 +0,0 @@ -APP_NAME=GrandMaster -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost/grandmaster - -LOG_CHANNEL=stack - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=grandmaster -DB_USERNAME=root -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS=null -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/app/Http/Controllers/Backend/backendpController.php b/app/Http/Controllers/Backend/backendpController.php index b643b40..f51aaf3 100644 --- a/app/Http/Controllers/Backend/backendpController.php +++ b/app/Http/Controllers/Backend/backendpController.php @@ -5,23 +5,24 @@ namespace App\Http\Controllers\Backend; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Yajra\DataTables\Facades\DataTables; -use Validator; +use Illuminate\Support\Facades\Validator; use App\Backendp; use App\Katartikel; use App\User; +use Illuminate\Support\Facades\Validator as FacadesValidator; class backendpController extends Controller { public function index() { - - return view('backend.beprog.index'); + $backendp = Backendp::all(); + return view('backend.backendp.index', compact('backendp')); } public function data(Request $request) { if ($request->ajax()) { - $backendp = Backendp::orderBy('id'); + $backendp = Backendp::orderBy('id','desc'); return Datatables::of($backendp) ->addIndexColumn() // ->addColumn('lampiran', function($backendp){ @@ -65,7 +66,7 @@ class backendpController extends Controller public function create() { - return view('backend.beprog.tambah'); + return view('backend.backendp.tambah'); } /** @@ -85,8 +86,8 @@ class backendpController extends Controller public function store(Request $request) { $validator = Validator::make($request->all(), [ - 'id' => 'required', - 'kategori_id' => 'required', + + 'judul' => 'required', 'konten' => 'required', @@ -104,6 +105,63 @@ class backendpController extends Controller return response()->json($respon); } + public function edit($id) + { + $backendp = Backendp::find($id); + + return view('backend.backendp.ubah', compact('backendp')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $validator = Validator::make($request->all(), [ + + 'judul' => 'required', + 'konten' => 'required', + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (backendp::find($id)->update($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil diubah']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal diubah']); + } + } + return response()->json($respon); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + + public function hapus($id) + { + $backendp = backendp::find($id); + return view('backend.backendp.hapus', ['backendp' => $backendp]); + } + + public function destroy($id) + { + $backendp = backendp::find($id); + if ($backendp->delete()) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil dihapus']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal dihapus']); + } + return response()->json($respon); + } } diff --git a/app/Http/Controllers/Backend/eofficeController.php b/app/Http/Controllers/Backend/eofficeController.php index 591ecc8..c73d779 100644 --- a/app/Http/Controllers/Backend/eofficeController.php +++ b/app/Http/Controllers/Backend/eofficeController.php @@ -6,11 +6,10 @@ use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Yajra\DataTables\Facades\DataTables; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Validator; use App\Eoffice; use App\Katartikel; use App\User; -use Validator; - class eofficeController extends Controller { @@ -58,17 +57,9 @@ class eofficeController extends Controller public function create(Request $request) { - // $eoffice = Eoffice::create(); - // $katartikel_id = Katartikel::pluck('katartikel_id', 'id'); - // $eoffice = Eoffice::whith('katartikel')->where - // dd($eoffice); - - // $request->request->add(['user_id' => auth()->user()->id]); - // dd($request->all()); - //$eoffice = Eoffice::create($request->all()); - + return view('backend.eoffice.tambah'); - // [ 'eoffices' => Eoffice::with('katartikel')] + } @@ -105,8 +96,8 @@ class eofficeController extends Controller public function edit($id) { $eoffice = Eoffice::find($id); - $katartikel_id = Eoffice::pluck('id','katartikel_id'); - return view('backend.eoffice.ubah', compact('eoffice','katartikel_id')); + + return view('backend.eoffice.ubah', compact('eoffice')); } /** @@ -119,7 +110,7 @@ class eofficeController extends Controller public function update(Request $request, $id) { $validator = Validator::make($request->all(), [ - // 'katartikel_id' => 'required', + 'judul' => 'required', 'konten' => 'required', diff --git a/database/migrations/2021_10_07_144619_create_kategoris_table.php b/database/migrations/2021_10_07_144619_create_kategoris_table.php new file mode 100644 index 0000000..68d38ba --- /dev/null +++ b/database/migrations/2021_10_07_144619_create_kategoris_table.php @@ -0,0 +1,38 @@ +bigIncrements('id'); + + $table->string('kode', 90)->nulllable(); + $table->string('nama')->nulllable(); + $table->text('keterangan')->nullable(); + + $table->timestamp('created_at')->nullable(); + $table->date('updated_at')->nullable(); + $table->timestamp('deleted_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('kategoris'); + } +} diff --git a/database/migrations/2021_10_07_154619_create_kategoris_table.php b/database/migrations/2021_10_07_154619_create_kategoris_table.php deleted file mode 100644 index 68d38ba..0000000 --- a/database/migrations/2021_10_07_154619_create_kategoris_table.php +++ /dev/null @@ -1,38 +0,0 @@ -bigIncrements('id'); - - $table->string('kode', 90)->nulllable(); - $table->string('nama')->nulllable(); - $table->text('keterangan')->nullable(); - - $table->timestamp('created_at')->nullable(); - $table->date('updated_at')->nullable(); - $table->timestamp('deleted_at')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('kategoris'); - } -} diff --git a/database/migrations/2021_10_08_110118_create_formals_table.php b/database/migrations/2021_10_08_110118_create_formals_table.php index 8e0ff3c..74b5cf6 100644 --- a/database/migrations/2021_10_08_110118_create_formals_table.php +++ b/database/migrations/2021_10_08_110118_create_formals_table.php @@ -16,6 +16,7 @@ class CreateFormalsTable extends Migration Schema::create('formals', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('dokumen_id')->nullable(); + $table->foreignId('kategori_id')->references('id')->on('kategoris'); $table->string('nomor')->nullable(false); $table->string('tahun')->nullable(false); diff --git a/database/migrations/2021_10_19_091721_create_eoffices_table.php b/database/migrations/2021_10_19_091721_create_eoffices_table.php index 6ed70df..e854dce 100644 --- a/database/migrations/2021_10_19_091721_create_eoffices_table.php +++ b/database/migrations/2021_10_19_091721_create_eoffices_table.php @@ -15,7 +15,6 @@ class CreateEofficesTable extends Migration { Schema::create('eoffices', function (Blueprint $table) { $table->bigIncrements('id'); - $table->foreignId('katartikel_id')->references('kategori_id')->on('katartikels'); $table->string('judul')->nulllable(); $table->text('konten')->nullable(); $table->string('image')->nullable(); diff --git a/resources/views/backend/backendp/ajax.blade.php b/resources/views/backend/backendp/ajax.blade.php new file mode 100644 index 0000000..452b0e7 --- /dev/null +++ b/resources/views/backend/backendp/ajax.blade.php @@ -0,0 +1,76 @@ +var nextUrl=$("#url").val(); +function errorMsg(pesan){ + $(".pesan").html(''); + $("input").prop('disabled', false); + $(".loading").hide(); + $(".modal-footer").show(); +} + +function successMsg(data){ + if(data.status == true){ + if (typeof data.url !== 'undefined') { + location.href= data.url; + } else { + $('#datatable').DataTable().ajax.reload(); + $('.modal').modal('hide'); + Swal.fire({ + title: 'Okay...', + text: 'Berhasil proses data', + type: 'success', + timer: 1500 + }); + } + }else{ + $("button").prop("disabled", false); + $("input").prop('disabled', false); + $.each(data.pesan, function(i, item) { + $('#'+i).closest('.form-group').addClass('has-error'); + $('#'+i).focus(); + $(".pesan").html(''); + return false; + }); + } + $(".loading").hide(); + {{-- $(".pesan").html(''); --}} + $(".modal-footer").show(); + +} +function sebelumKirim(){ + $(".pesan").html(''); + $("input").prop('disabled', true); + $(".loading").show(); + $(".modal-footer").hide(); +} + +function goAjax(targetUrl, dataString, methodType = 'POST'){ + $.ajax({ + type: methodType, + url: targetUrl, + data: dataString, + enctype: 'multipart/form-data', + dataType: 'json', + cache: false, + beforeSend: function(){ + sebelumKirim(); + }, + success: function(data){ + successMsg(data); + }, + error: function(x, e){ + // errorMsg(x.status); + } + }); +} + +function addCommas(nStr) +{ + nStr += ''; + x = nStr.split('.'); + x1 = x[0]; + x2 = x.length > 1 ? '.' + x[1] : ''; + var rgx = /(\d+)(\d{3})/; + while (rgx.test(x1)) { + x1 = x1.replace(rgx, '$1' + ',' + '$2'); + } + return x1 + x2; +} diff --git a/resources/views/backend/backendp/datatables.blade.php b/resources/views/backend/backendp/datatables.blade.php new file mode 100644 index 0000000..3a27893 --- /dev/null +++ b/resources/views/backend/backendp/datatables.blade.php @@ -0,0 +1,51 @@ +$(document).ready(function () { + $('#datatable').DataTable({ + responsive: true, + lengthChange: false, + language: { + url: "{{ asset('resources/vendor/datatables/js/indonesian.json') }}" + }, + dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 d-flex align-items-center justify-content-end'lB>>" + + "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", + buttons: [ + { + extend: 'pdfHtml5', + text: 'PDF', + titleAttr: 'Generate PDF', + className: 'btn-outline-danger btn-sm mr-1', + exportOptions: { + columns: [0, 1,2,3] + } + }, + { + extend: 'excelHtml5', + text: 'Excel', + titleAttr: 'Generate Excel', + className: 'btn-outline-success btn-sm mr-1', + exportOptions: { + columns: [0, 1,2,3] + } + }, + { + extend: 'print', + text: 'Print', + titleAttr: 'Print Table', + className: 'btn-outline-primary btn-sm', + exportOptions: { + columns: [0, 1,2,3] + } + } + ], + processing: true, + serverSide: true, + ajax: "{{ url($url_admin.'/backendp/data') }}", + columns: [ + +, { data: 'judul'}, + { data: 'konten'}, + + { data: 'action', orderable: false, searchable: false }, + ] + }); +}); \ No newline at end of file diff --git a/resources/views/backend/backendp/datatables_detail.blade.php b/resources/views/backend/backendp/datatables_detail.blade.php new file mode 100644 index 0000000..d3783ed --- /dev/null +++ b/resources/views/backend/backendp/datatables_detail.blade.php @@ -0,0 +1,49 @@ +$(document).ready(function () { + $('#datatable').DataTable({ + responsive: true, + lengthChange: false, + language: { + url: "{{ asset('resources/vendor/datatables/js/indonesian.json') }}" + }, + dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 d-flex align-items-center justify-content-end'lB>>" + + "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", + buttons: [ + { + extend: 'pdfHtml5', + text: 'PDF', + titleAttr: 'Generate PDF', + className: 'btn-outline-danger btn-sm mr-1', + exportOptions: { + columns: [0, 1, 2, 3, 4] + } + }, + { + extend: 'excelHtml5', + text: 'Excel', + titleAttr: 'Generate Excel', + className: 'btn-outline-success btn-sm mr-1', + exportOptions: { + columns: [0, 1, 2, 3, 4] + } + }, + { + extend: 'print', + text: 'Print', + titleAttr: 'Print Table', + className: 'btn-outline-primary btn-sm', + exportOptions: { + columns: [0, 1, 2, 3, 4] + } + } + ], + processing: true, + serverSide: true, + ajax: "{{ url($url_admin.'/unor/detail/data/'.$id) }}", + columns: [ + { data: 'nama' }, + { data: 'email' }, + { data: 'username' } + ] + }); +}); \ No newline at end of file diff --git a/resources/views/backend/backendp/detail.blade.php b/resources/views/backend/backendp/detail.blade.php new file mode 100644 index 0000000..7bde327 --- /dev/null +++ b/resources/views/backend/backendp/detail.blade.php @@ -0,0 +1,33 @@ +@extends('backend.home.index') +@push('title', 'Detail '. $halaman->nama . ' '. $aksesgrup->nama) +@push('header', 'Detail '. $halaman->nama . ' '.$aksesgrup->nama) +@push('tombol') +
+ + Kembali + +
+@endpush +@section('content') +
+
+ + + + + + + + +
NamaEmailUsername
+
+
+@endsection +@push('js') +@include('backend.home.datatable-js') + + +@endpush +@push('css') +@include('backend.home.datatable-css') +@endpush \ No newline at end of file diff --git a/resources/views/backend/backendp/hapus.blade.php b/resources/views/backend/backendp/hapus.blade.php new file mode 100644 index 0000000..ea1943b --- /dev/null +++ b/resources/views/backend/backendp/hapus.blade.php @@ -0,0 +1,24 @@ +{!! Form::open(array('id' => 'frmOji', 'route' => ['backendp.destroy', $backendp->id], 'class' => 'form account-form', 'method' => 'DELETE')) !!} +
+
+ +

+ +

+
+ {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} +
+
+
+ +
+
+
+
0%
+
+
+
+
+{!! Form::close() !!} + + diff --git a/resources/views/backend/backendp/index.blade.php b/resources/views/backend/backendp/index.blade.php new file mode 100644 index 0000000..ad9bdca --- /dev/null +++ b/resources/views/backend/backendp/index.blade.php @@ -0,0 +1,39 @@ +@extends('backend.home.index') +@push('title', $halaman->nama) +@push('header', $halaman->nama) +@push('tombol') + + Tambah + +@endpush +@section('content') +
+ +
+ + + + + + + + + + + +
JudulKontenAksi
+ +
+ +
+@endsection +@push('js') +@include('backend.home.datatable-js') + + + + +@endpush +@push('css') +@include('backend.home.datatable-css') +@endpush diff --git a/resources/views/backend/backendp/jquery.blade.php b/resources/views/backend/backendp/jquery.blade.php new file mode 100644 index 0000000..22c86c0 --- /dev/null +++ b/resources/views/backend/backendp/jquery.blade.php @@ -0,0 +1,75 @@ +$(document).ready(function(){ + $('.tambah').click(function(){ + ojisatrianiLoadingFadeIn(); + $.loadmodal({ + url: "{{ url($url_admin.'/backendp/create') }}", + id: 'responsive', + dlgClass: 'fade', + bgClass: 'primary', + title: 'Tambah', + width: 'whatever', + modal: { + keyboard: true, + // any other options from the regular $().modal call (see Bootstrap docs) + }, + ajax: { + dataType: 'html', + method: 'GET', + success: function(data, status, xhr){ + ojisatrianiLoadingFadeOut(); + }, + + }, + }); + }); + + $(document).on("click",".ubah",function() { + ojisatrianiLoadingFadeIn(); + var id = $(this).attr('backendp-id'); + $.loadmodal({ + url: "{{ url($url_admin.'/backendp') }}/"+ id +"/edit", + id: 'responsive', + dlgClass: 'fade', + bgClass: 'warning', + title: 'Ubah', + width: 'whatever', + modal: { + keyboard: true, + // any other options from the regular $().modal call (see Bootstrap docs) + }, + ajax: { + dataType: 'html', + method: 'GET', + success: function(data, status, xhr){ + ojisatrianiLoadingFadeOut(); + }, + }, + }); + }); + + $(document).on("click",".hapus",function() { + ojisatrianiLoadingFadeIn(); + var id = $(this).attr('backendp-id'); + $.loadmodal({ + url: "{{ url($url_admin.'/backendp') }}/hapus/"+ id, + id: 'responsive', + dlgClass: 'fade', + bgClass: 'danger', + title: 'Hapus', + width: 'whatever', + modal: { + keyboard: true, + // any other options from the regular $().modal call (see Bootstrap docs) + //$('#uraian').val(id), + }, + ajax: { + dataType: 'html', + method: 'GET', + success: function(data, status, xhr){ + ojisatrianiLoadingFadeOut(); + }, + }, + }); + }); + +}); diff --git a/resources/views/backend/backendp/tambah.blade.php b/resources/views/backend/backendp/tambah.blade.php new file mode 100644 index 0000000..af268e3 --- /dev/null +++ b/resources/views/backend/backendp/tambah.blade.php @@ -0,0 +1,45 @@ +{!! Form::open(array('id' => 'frmOji', 'route' => ['backendp.store'], 'class' => 'form account-form', 'method' => 'post' )) !!} +
+
+ +

+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +

+

+ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +

+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} +
+
+
+ +
+
+
+
0%
+
+
+
+
+{!! Form::close() !!} + + + + + + + + + diff --git a/resources/views/backend/backendp/ubah.blade.php b/resources/views/backend/backendp/ubah.blade.php new file mode 100644 index 0000000..e2cb7a8 --- /dev/null +++ b/resources/views/backend/backendp/ubah.blade.php @@ -0,0 +1,55 @@ +{!! Form::open(array('id' => 'frmOji', 'route' => ['backendp.update', $backendp->id], 'class' => 'form account-form', 'method' => 'PUT', 'files' => TRUE )) !!} +
+
+ + +

+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $backendp->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +

+

+ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $backendp->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Konten')) !!} +

+ + +
+ {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} +
+
+
+ +
+
+
+
0%
+
+
+
+
+{!! Form::close() !!} + + + + + + + + + diff --git a/resources/views/backend/beprog/ajax.blade.php b/resources/views/backend/beprog/ajax.blade.php deleted file mode 100644 index 452b0e7..0000000 --- a/resources/views/backend/beprog/ajax.blade.php +++ /dev/null @@ -1,76 +0,0 @@ -var nextUrl=$("#url").val(); -function errorMsg(pesan){ - $(".pesan").html(''); - $("input").prop('disabled', false); - $(".loading").hide(); - $(".modal-footer").show(); -} - -function successMsg(data){ - if(data.status == true){ - if (typeof data.url !== 'undefined') { - location.href= data.url; - } else { - $('#datatable').DataTable().ajax.reload(); - $('.modal').modal('hide'); - Swal.fire({ - title: 'Okay...', - text: 'Berhasil proses data', - type: 'success', - timer: 1500 - }); - } - }else{ - $("button").prop("disabled", false); - $("input").prop('disabled', false); - $.each(data.pesan, function(i, item) { - $('#'+i).closest('.form-group').addClass('has-error'); - $('#'+i).focus(); - $(".pesan").html(''); - return false; - }); - } - $(".loading").hide(); - {{-- $(".pesan").html(''); --}} - $(".modal-footer").show(); - -} -function sebelumKirim(){ - $(".pesan").html(''); - $("input").prop('disabled', true); - $(".loading").show(); - $(".modal-footer").hide(); -} - -function goAjax(targetUrl, dataString, methodType = 'POST'){ - $.ajax({ - type: methodType, - url: targetUrl, - data: dataString, - enctype: 'multipart/form-data', - dataType: 'json', - cache: false, - beforeSend: function(){ - sebelumKirim(); - }, - success: function(data){ - successMsg(data); - }, - error: function(x, e){ - // errorMsg(x.status); - } - }); -} - -function addCommas(nStr) -{ - nStr += ''; - x = nStr.split('.'); - x1 = x[0]; - x2 = x.length > 1 ? '.' + x[1] : ''; - var rgx = /(\d+)(\d{3})/; - while (rgx.test(x1)) { - x1 = x1.replace(rgx, '$1' + ',' + '$2'); - } - return x1 + x2; -} diff --git a/resources/views/backend/beprog/datatables.blade.php b/resources/views/backend/beprog/datatables.blade.php deleted file mode 100644 index 2f2cb67..0000000 --- a/resources/views/backend/beprog/datatables.blade.php +++ /dev/null @@ -1,51 +0,0 @@ -$(document).ready(function () { - $('#datatable').DataTable({ - responsive: true, - lengthChange: false, - language: { - url: "{{ asset('resources/vendor/datatables/js/indonesian.json') }}" - }, - dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 d-flex align-items-center justify-content-end'lB>>" + - "<'row'<'col-sm-12'tr>>" + - "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", - buttons: [ - { - extend: 'pdfHtml5', - text: 'PDF', - titleAttr: 'Generate PDF', - className: 'btn-outline-danger btn-sm mr-1', - exportOptions: { - columns: [0, 1,2,3] - } - }, - { - extend: 'excelHtml5', - text: 'Excel', - titleAttr: 'Generate Excel', - className: 'btn-outline-success btn-sm mr-1', - exportOptions: { - columns: [0, 1,2,3] - } - }, - { - extend: 'print', - text: 'Print', - titleAttr: 'Print Table', - className: 'btn-outline-primary btn-sm', - exportOptions: { - columns: [0, 1,2,3] - } - } - ], - processing: true, - serverSide: true, - ajax: "{{ url($url_admin.'/beprog/data') }}", - columns: [ - -, {!! data: 'judul'!!}, - {!! data: 'konten'!!}, - - { data: 'action', orderable: false, searchable: false }, - ] - }); -}); \ No newline at end of file diff --git a/resources/views/backend/beprog/datatables_detail.blade.php b/resources/views/backend/beprog/datatables_detail.blade.php deleted file mode 100644 index d3783ed..0000000 --- a/resources/views/backend/beprog/datatables_detail.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -$(document).ready(function () { - $('#datatable').DataTable({ - responsive: true, - lengthChange: false, - language: { - url: "{{ asset('resources/vendor/datatables/js/indonesian.json') }}" - }, - dom: "<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f><'col-sm-12 col-md-6 d-flex align-items-center justify-content-end'lB>>" + - "<'row'<'col-sm-12'tr>>" + - "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>", - buttons: [ - { - extend: 'pdfHtml5', - text: 'PDF', - titleAttr: 'Generate PDF', - className: 'btn-outline-danger btn-sm mr-1', - exportOptions: { - columns: [0, 1, 2, 3, 4] - } - }, - { - extend: 'excelHtml5', - text: 'Excel', - titleAttr: 'Generate Excel', - className: 'btn-outline-success btn-sm mr-1', - exportOptions: { - columns: [0, 1, 2, 3, 4] - } - }, - { - extend: 'print', - text: 'Print', - titleAttr: 'Print Table', - className: 'btn-outline-primary btn-sm', - exportOptions: { - columns: [0, 1, 2, 3, 4] - } - } - ], - processing: true, - serverSide: true, - ajax: "{{ url($url_admin.'/unor/detail/data/'.$id) }}", - columns: [ - { data: 'nama' }, - { data: 'email' }, - { data: 'username' } - ] - }); -}); \ No newline at end of file diff --git a/resources/views/backend/beprog/detail.blade.php b/resources/views/backend/beprog/detail.blade.php deleted file mode 100644 index 7bde327..0000000 --- a/resources/views/backend/beprog/detail.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -@extends('backend.home.index') -@push('title', 'Detail '. $halaman->nama . ' '. $aksesgrup->nama) -@push('header', 'Detail '. $halaman->nama . ' '.$aksesgrup->nama) -@push('tombol') - -@endpush -@section('content') -
-
- - - - - - - - -
NamaEmailUsername
-
-
-@endsection -@push('js') -@include('backend.home.datatable-js') - - -@endpush -@push('css') -@include('backend.home.datatable-css') -@endpush \ No newline at end of file diff --git a/resources/views/backend/beprog/hapus.blade.php b/resources/views/backend/beprog/hapus.blade.php deleted file mode 100644 index 4cd36b6..0000000 --- a/resources/views/backend/beprog/hapus.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -{!! Form::open(array('id' => 'frmOji', 'route' => ['eoffice.destroy', $eoffice->id], 'class' => 'form account-form', 'method' => 'DELETE')) !!} -
-
- -

- -

-
- {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} -
-
-
- -
-
-
-
0%
-
-
-
-
-{!! Form::close() !!} - - diff --git a/resources/views/backend/beprog/index.blade.php b/resources/views/backend/beprog/index.blade.php deleted file mode 100644 index ad9bdca..0000000 --- a/resources/views/backend/beprog/index.blade.php +++ /dev/null @@ -1,39 +0,0 @@ -@extends('backend.home.index') -@push('title', $halaman->nama) -@push('header', $halaman->nama) -@push('tombol') - - Tambah - -@endpush -@section('content') -
- -
- - - - - - - - - - - -
JudulKontenAksi
- -
- -
-@endsection -@push('js') -@include('backend.home.datatable-js') - - - - -@endpush -@push('css') -@include('backend.home.datatable-css') -@endpush diff --git a/resources/views/backend/beprog/jquery.blade.php b/resources/views/backend/beprog/jquery.blade.php deleted file mode 100644 index 8541acc..0000000 --- a/resources/views/backend/beprog/jquery.blade.php +++ /dev/null @@ -1,75 +0,0 @@ -$(document).ready(function(){ - $('.tambah').click(function(){ - ojisatrianiLoadingFadeIn(); - $.loadmodal({ - url: "{{ url($url_admin.'/beprog/create') }}", - id: 'responsive', - dlgClass: 'fade', - bgClass: 'primary', - title: 'Tambah', - width: 'whatever', - modal: { - keyboard: true, - // any other options from the regular $().modal call (see Bootstrap docs) - }, - ajax: { - dataType: 'html', - method: 'GET', - success: function(data, status, xhr){ - ojisatrianiLoadingFadeOut(); - }, - - }, - }); - }); - - $(document).on("click",".ubah",function() { - ojisatrianiLoadingFadeIn(); - var id = $(this).attr('beprog-id'); - $.loadmodal({ - url: "{{ url($url_admin.'/beprog') }}/"+ id +"/edit", - id: 'responsive', - dlgClass: 'fade', - bgClass: 'warning', - title: 'Ubah', - width: 'whatever', - modal: { - keyboard: true, - // any other options from the regular $().modal call (see Bootstrap docs) - }, - ajax: { - dataType: 'html', - method: 'GET', - success: function(data, status, xhr){ - ojisatrianiLoadingFadeOut(); - }, - }, - }); - }); - - $(document).on("click",".hapus",function() { - ojisatrianiLoadingFadeIn(); - var id = $(this).attr('beprog-id'); - $.loadmodal({ - url: "{{ url($url_admin.'/beprog') }}/hapus/"+ id, - id: 'responsive', - dlgClass: 'fade', - bgClass: 'danger', - title: 'Hapus', - width: 'whatever', - modal: { - keyboard: true, - // any other options from the regular $().modal call (see Bootstrap docs) - //$('#uraian').val(id), - }, - ajax: { - dataType: 'html', - method: 'GET', - success: function(data, status, xhr){ - ojisatrianiLoadingFadeOut(); - }, - }, - }); - }); - -}); diff --git a/resources/views/backend/beprog/tambah.blade.php b/resources/views/backend/beprog/tambah.blade.php deleted file mode 100644 index 9ee2c1f..0000000 --- a/resources/views/backend/beprog/tambah.blade.php +++ /dev/null @@ -1,55 +0,0 @@ -{!! Form::open(array('id' => 'frmOji', 'route' => ['eoffice.store'], 'class' => 'form account-form', 'method' => 'post' )) !!} -
-
- - - - -

- {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} - {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} -

-

- {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} - {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} -

- - - {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} -
-
-
- -
-
-
-
0%
-
-
-
-
-{!! Form::close() !!} - - - - - - - - - diff --git a/resources/views/backend/beprog/ubah.blade.php b/resources/views/backend/beprog/ubah.blade.php deleted file mode 100644 index a442f71..0000000 --- a/resources/views/backend/beprog/ubah.blade.php +++ /dev/null @@ -1,58 +0,0 @@ -{!! Form::open(array('id' => 'frmOji', 'route' => ['eoffice.update', $eoffice->id], 'class' => 'form account-form', 'method' => 'PUT', 'files' => TRUE )) !!} -
-
- -

- {!! Form::label('Kategori', 'Kategori', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('katartikel_id', $eoffice->katartikel_id, array('id' => 'katartikel_id', 'class' => 'form-control')) !!} -

-

- {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('judul', $eoffice->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} -

-

- {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} - {!! Form::textarea('konten', $eoffice->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Konten')) !!} -

- - -
- {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} -
-
-
- -
-
-
-
0%
-
-
-
-
-{!! Form::close() !!} - - - - - - - - - diff --git a/resources/views/backend/eoffice/ubah.blade.php b/resources/views/backend/eoffice/ubah.blade.php index a442f71..a04560d 100644 --- a/resources/views/backend/eoffice/ubah.blade.php +++ b/resources/views/backend/eoffice/ubah.blade.php @@ -2,10 +2,7 @@
-

- {!! Form::label('Kategori', 'Kategori', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('katartikel_id', $eoffice->katartikel_id, array('id' => 'katartikel_id', 'class' => 'form-control')) !!} -

+

{!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} {!! Form::text('judul', $eoffice->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} diff --git a/routes/backend.php b/routes/backend.php index 0973354..387f4c1 100644 --- a/routes/backend.php +++ b/routes/backend.php @@ -1,5 +1,7 @@ config('master.url.admin')], function () { Route::get('dataon', 'pencarianController@dataOnly'); // Artikel Backend Programming - Route::get('beprog/data', 'backendpController@data')->name('beprog.data'); - Route::get('beprog/hapus/{id}', 'backendpController@hapus')->name('beprog.hapus'); - Route::get('beprog/create/{id}', 'backendpController@create')->name('beprog.create_id'); - Route::resource('beprog', 'backendpController'); + Route::get('backendp/data', 'backendpController@data')->name('backendp.data'); + Route::get('backendp/hapus/{id}', 'backendpController@hapus')->name('backendp.hapus'); + Route::get('backendp/create/{id}', 'backendpController@create')->name('backendp.create_id'); + Route::resource('backendp', 'backendpController'); // Laravel Artikel Route::get('laravel/data', 'laravelController@data')->name('laravel.data'); -- 2.7.4