This commit is contained in:
Pusdatin BPKD Jkt
2022-07-13 15:27:31 +07:00
parent 2624b4e1e6
commit 26bdde4442
24 changed files with 337 additions and 793 deletions
@@ -1,128 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstGolongan;
use Illuminate\Http\Request;
use Config;
class MstGolonganController extends Controller
{
public function __construct(Request $request){
$this->siteTitle = "Data Golongan";
parent::__construct();
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$data = MstGolongan::latest()->paginate(10);
return view('admin.mst_golongan.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_golongan.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'nama_golongan' => 'required',
'nama_pangkat' => 'required',
'golongan_besar' => 'required',
'alias' => 'required',
]);
$requestAll = $request->all();
MstGolongan::create($requestAll);
return redirect()->route('mst-golongan.index')
->with('success','Post created successfully.');
}
/**
* Display the specified resource.
*
* @param \App\Models\MstGolongan $MstGolongan
* @return \Illuminate\Http\Response
*/
public function show(MstGolongan $MstGolongan)
{
$this->setSubtitle("Detail Data");
return view('admin.mst_golongan.show',compact('MstGolongan'));
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\MstGolongan $MstGolongan
* @return \Illuminate\Http\Response
*/
public function edit(MstGolongan $MstGolongan)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_golongan.edit',compact('MstGolongan'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\MstGolongan $MstGolongan
* @return \Illuminate\Http\Response
*/
public function update(Request $request, MstGolongan $MstGolongan)
{
$request->validate([
'nama_golongan' => 'required',
'nama_pangkat' => 'required',
'golongan_besar' => 'required',
'alias' => 'required',
]);
$requestAll = $request->all();
$MstGolongan->update($requestAll);
return redirect()->route('mst-golongan.index')
->with('success','Golongan berhasil diubah!');
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\MstGolongan $MstGolongan
* @return \Illuminate\Http\Response
*/
public function destroy(MstGolongan $MstGolongan)
{
$MstGolongan->delete();
return redirect()->route('mst-golongan.index')
->with('success','Golongan berhasil dihapus!');
}
public function golonganList()
{
$mstGolongan = MstGolongan::select(["id","nama_golongan","nama_pangkat","alias"])->get();
return response()->json($mstGolongan);
}
}
@@ -1,81 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstHak;
use Illuminate\Http\Request;
class MstHakController extends Controller
{
public function __construct(){
$this->siteTitle = "Data Hak";
parent::__construct();
}
public function index()
{
$data = MstHak::latest()->paginate(10);
return view('admin.mst_hak.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_hak.create');
}
public function store(Request $request)
{
$request->validate([
'nama_hak' => 'required',
]);
$requestAll = $request->all();
MstHak::create($requestAll);
return redirect()->route('mst-hak.index')
->with('success','Hak berhasil dibuat.');
}
public function show(MstHak $MstHak)
{
$this->setSubtitle("Detail Data");
return view('admin.mst_hak.show',compact('MstHak'));
}
public function edit(MstHak $MstHak)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_hak.edit',compact('MstHak'));
}
public function update(Request $request, MstHak $MstHak)
{
$request->validate([
'nama_hak' => 'required',
]);
$requestAll = $request->all();
$MstHak->update($requestAll);
return redirect()->route('mst-hak.index')
->with('success','Hak berhasil diubah!');
}
public function destroy(MstHak $MstHak)
{
$MstHak->delete();
return redirect()->route('mst-hak.index')
->with('success','Hak berhasil dihapus!');
}
public function hakList()
{
$mstKantor = MstHak::select(["id","nama_hak"])->get();
return response()->json($mstKantor);
}
}
@@ -1,123 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstKantor;
use Illuminate\Http\Request;
class MstKantorController extends Controller
{
public function __construct(){
$this->siteTitle = "Data Kantor";
parent::__construct();
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$data = MstKantor::latest()->paginate(10);
return view('admin.mst_kantor.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_kantor.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'nama_kantor' => 'required',
'wilayah' => 'required',
]);
$requestAll = $request->all();
MstKantor::create($requestAll);
return redirect()->route('mst-kantor.index')
->with('success','Post created successfully.');
}
/**
* Display the specified resource.
*
* @param \App\Models\MstKantor $MstKantor
* @return \Illuminate\Http\Response
*/
public function show(MstKantor $MstKantor)
{
$this->setSubtitle("Detail Data");
return view('admin.mst_kantor.show',compact('MstKantor'));
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\MstKantor $MstKantor
* @return \Illuminate\Http\Response
*/
public function edit(MstKantor $MstKantor)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_kantor.edit',compact('MstKantor'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\MstKantor $MstKantor
* @return \Illuminate\Http\Response
*/
public function update(Request $request, MstKantor $MstKantor)
{
$request->validate([
'nama_kantor' => 'required',
'wilayah' => 'required',
]);
$requestAll = $request->all();
$MstKantor->update($requestAll);
return redirect()->route('mst-kantor.index')
->with('success','Tempat Kerja berhasil diubah!');
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\MstKantor $MstKantor
* @return \Illuminate\Http\Response
*/
public function destroy(MstKantor $MstKantor)
{
$MstKantor->delete();
return redirect()->route('mst-kantor.index')
->with('success','Tempat Kerja berhasil dihapus!');
}
public function kantorList()
{
$mstKantor = MstKantor::select(["id","nama_kantor","wilayah"])->get();
return response()->json($mstKantor);
}
}
@@ -1,122 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstKeputusan;
use Illuminate\Http\Request;
class MstKeputusanController extends Controller
{
public function __construct(){
$this->siteTitle = "Data Keputusan";
parent::__construct();
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$data = MstKeputusan::latest()->paginate(10);
return view('admin.mst_keputusan.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_keputusan.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'nama_keputusan' => 'required',
]);
$requestAll = $request->all();
MstKeputusan::create($requestAll);
return redirect()->route('mst-keputusan.index')
->with('success','Post created successfully.');
}
/**
* Display the specified resource.
*
* @param \App\Models\MstKeputusan $mstKeputusan
* @return \Illuminate\Http\Response
*/
public function show(MstKeputusan $mstKeputusan)
{
// var_dump($mstKeputusan); exit;
$this->setSubtitle("Detail Data");
return view('admin.mst_keputusan.show',compact('mstKeputusan'));
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\MstKeputusan $mstKeputusan
* @return \Illuminate\Http\Response
*/
public function edit(MstKeputusan $mstKeputusan)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_keputusan.edit',compact('mstKeputusan'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\MstKeputusan $mstKeputusan
* @return \Illuminate\Http\Response
*/
public function update(Request $request, MstKeputusan $mstKeputusan)
{
$request->validate([
'nama_keputusan' => 'required',
]);
$requestAll = $request->all();
$mstKeputusan->update($requestAll);
return redirect()->route('mst-keputusan.index')
->with('success','Keputusan berhasil diubah!');
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\MstKeputusan $mstKeputusan
* @return \Illuminate\Http\Response
*/
public function destroy(MstKeputusan $mstKeputusan)
{
$mstKeputusan->delete();
return redirect()->route('mst-keputusan.index')
->with('success','Keputusan berhasil dihapus!');
}
public function keputusanList()
{
$mstKeputusan = MstKeputusan::select(["id","nama_keputusan"])->get();
return response()->json($mstKeputusan);
}
}
@@ -1,85 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstKpkd;
use Illuminate\Http\Request;
class MstKpkdController extends Controller
{
public function __construct(){
$this->siteTitle = "Data KPKD";
parent::__construct();
}
public function index()
{
$data = MstKpkd::latest()->paginate(10);
return view('admin.mst_kpkd.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_kpkd.create');
}
public function store(Request $request)
{
$request->validate([
'nama' => 'required',
'nip' => 'required',
'nrk' => 'required',
]);
$requestAll = $request->all();
MstKpkd::create($requestAll);
return redirect()->route('mst-kpkd.index')
->with('success','Data KPKD berhasil dibuat.');
}
public function show(MstKpkd $mstKpkd)
{
$this->setSubtitle("Detail Data");
return view('admin.mst_kpkd.show',compact('mstKpkd'));
}
public function edit(MstKpkd $mstKpkd)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_kpkd.edit',compact('mstKpkd'));
}
public function update(Request $request, MstKpkd $mstKpkd)
{
$request->validate([
'nama' => 'required',
'nip' => 'required',
'nrk' => 'required',
]);
$requestAll = $request->all();
$mstKpkd->update($requestAll);
return redirect()->route('mst-kpkd.index')
->with('success','Data KPKD berhasil diubah!');
}
public function destroy(MstKpkd $mstKpkd)
{
$mstKpkd->delete();
return redirect()->route('mst-kpkd.index')
->with('success','Data KPKD berhasil dihapus!');
}
public function kpkdList()
{
$mstKpkd = MstKpkd::where("status_aktif", 1)->select(["id","nama"])->get();
return response()->json($mstKpkd);
}
}
@@ -1,94 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\MstTempatKerja;
use App\Models\Tropd;
use Illuminate\Http\Request;
class MstTempatKerjaController extends Controller
{
public function __construct(){
$this->siteTitle = "Data Tempat Kerja";
parent::__construct();
}
public function index()
{
$data = MstTempatKerja::latest()->paginate(10);
return view('admin.mst_tempatkerja.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_tempatkerja.create');
}
public function store(Request $request)
{
$request->validate([
'skpd_id' => 'required',
'tempat_kerja' => 'required',
]);
$skpd = Tropd::where('I_ID', $request->skpd_id)->first();
$requestAll = $request->all();
$requestAll["skpd_name"] = $skpd->n_opd;
MstTempatKerja::create($requestAll);
return redirect()->route('mst-tempat_kerja.index')
->with('success','Post created successfully.');
}
public function show(MstTempatKerja $MstTempatKerja)
{
$this->setSubtitle("Detail Data");
return view('admin.mst_tempatkerja.show',compact('MstTempatKerja'));
}
public function edit(MstTempatKerja $MstTempatKerja)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_tempatkerja.edit',compact('MstTempatKerja'));
}
public function update(Request $request, MstTempatKerja $MstTempatKerja)
{
$request->validate([
'skpd_id' => 'required',
'tempat_kerja' => 'required',
]);
$skpd = Tropd::where('I_ID', $request->skpd_id)->first();
$requestAll = $request->all();
$requestAll["skpd_name"] = $skpd->n_opd;
$MstTempatKerja->update($requestAll);
return redirect()->route('mst-tempat_kerja.index')
->with('success','Tempat Kerja berhasil diubah!');
}
public function destroy(MstTempatKerja $MstTempatKerja)
{
$MstTempatKerja->delete();
return redirect()->route('mst-tempat_kerja.index')
->with('success','Tempat Kerja berhasil dihapus!');
}
public function tempatKerjaList($idUnit){
$tempatKerja = MstTempatKerja::select("tempat_kerja")
->distinct()
->where("id_unit",$idUnit)
->get()->toArray();
$arrColumn = array_column($tempatKerja,"tempat_kerja");
return response()->json($arrColumn);
}
}