penambahan menu activity dan perbaikan menu assingment
This commit is contained in:
@@ -32,6 +32,7 @@ class PenilaianController extends Controller
|
||||
*/
|
||||
public function store(PenilaianRequest $request)
|
||||
{
|
||||
//print_r($request->all());exit;
|
||||
$validatedData = $request->validated();
|
||||
if ($validatedData) {
|
||||
try {
|
||||
@@ -80,14 +81,6 @@ class PenilaianController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('lpj::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
@@ -116,21 +109,40 @@ class PenilaianController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function revisi(Request $request, $nomor_registrasi)
|
||||
|
||||
public function revisi(PenilaianRequest $request, $nomor_registrasi)
|
||||
{
|
||||
$validate = $request->validate([
|
||||
'keterangan_revisi' => 'required',
|
||||
'dokumen_revisi' => 'required|file',
|
||||
]);
|
||||
if ($validate) {
|
||||
$permohonan = Permohonan::where('nomor_registrasi',
|
||||
$nomor_registrasi);
|
||||
$validatedData = $request->validated();
|
||||
if ($validatedData) {
|
||||
|
||||
$permohonan->update($validate);
|
||||
try {
|
||||
|
||||
if (isset($validatedData['dokumen']) && $request->hasFile('dokumen')) {
|
||||
$file_name = $validatedData['dokumen']->getClientOriginalName();
|
||||
$validatedData['dokumen']->storeAs('public/dokumen_revisi', $file_name);
|
||||
}
|
||||
|
||||
$dataToUpdate = [
|
||||
'keterangan' => $validatedData['keterangan'],
|
||||
'dokumen' => 'dokumen_revisi/' . $file_name,
|
||||
'status' => 'revisi',
|
||||
];
|
||||
|
||||
// dump($dataToUpdate);
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $nomor_registrasi)->first();
|
||||
|
||||
$permohonan->update($dataToUpdate);
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil direvisi');
|
||||
} catch (Exception $e) {
|
||||
dump($e->getMessage());
|
||||
// return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
|
||||
Reference in New Issue
Block a user