prerbaikan export dan penambahan role di team penilai
This commit is contained in:
parent
0ae0374e5e
commit
53ccf7de11
@ -10,6 +10,7 @@ use Modules\Lpj\Models\JenisPenilaian;
|
|||||||
use Modules\Lpj\Http\Requests\JenisPenilaianRequest;
|
use Modules\Lpj\Http\Requests\JenisPenilaianRequest;
|
||||||
use Modules\Lpj\Exports\JenisPenilaianExport;
|
use Modules\Lpj\Exports\JenisPenilaianExport;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
|
||||||
class JenisPenilaianController extends Controller
|
class JenisPenilaianController extends Controller
|
||||||
{
|
{
|
||||||
public $user;
|
public $user;
|
||||||
@ -59,14 +60,13 @@ class JenisPenilaianController extends Controller
|
|||||||
public function update(JenisPenilaianRequest $request, $id)
|
public function update(JenisPenilaianRequest $request, $id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$validate = $request->validate();
|
$validated = $request->validated();
|
||||||
|
|
||||||
// dump($validate);
|
|
||||||
|
|
||||||
if ($validate) {
|
if ($validated) {
|
||||||
try {
|
try {
|
||||||
$jenisPenilaian = JenisPenilaian::find($id);
|
$jenisPenilaian = JenisPenilaian::find($id);
|
||||||
$jenisPenilaian->update($validate);
|
$jenisPenilaian->update($validated);
|
||||||
return redirect()->route('basicdata.jenis-penilaian.index')->with('success', 'Jenis Penilaian updated successfully');
|
return redirect()->route('basicdata.jenis-penilaian.index')->with('success', 'Jenis Penilaian updated successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->route('basicdata.jenis-penilaian.edit', $id)->with('error', $e->getMessage());
|
return redirect()->route('basicdata.jenis-penilaian.edit', $id)->with('error', $e->getMessage());
|
||||||
|
@ -6,6 +6,18 @@ use App\Http\Controllers\Controller;
|
|||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Modules\Lpj\Models\StatusPermohonan;
|
||||||
|
use Modules\Lpj\Models\Branch;
|
||||||
|
use Modules\Lpj\Models\Debiture;
|
||||||
|
use Modules\Lpj\Models\Permohonan;
|
||||||
|
use Modules\Lpj\Models\TujuanPenilaian;
|
||||||
|
use Modules\Lpj\Models\JenisPenilaian;
|
||||||
|
use Modules\Lpj\Models\Teams;
|
||||||
|
use Modules\Lpj\Models\JenisJaminan;
|
||||||
|
use Modules\Lpj\Models\NilaiPlafond;
|
||||||
|
use Modules\Lpj\Models\JenisFasilitasKredit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PenilaianController extends Controller
|
class PenilaianController extends Controller
|
||||||
{
|
{
|
||||||
@ -14,15 +26,17 @@ class PenilaianController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('lpj::penilaian.index');
|
$status_permohonan = StatusPermohonan::all();
|
||||||
|
|
||||||
|
return view('lpj::penilaian.index', compact('status_permohonan'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form for creating a new resource.
|
* Show the form for creating a new resource.
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create($id)
|
||||||
{
|
{
|
||||||
return view('lpj::create');
|
return view('lpj::penilaian.form');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +60,22 @@ class PenilaianController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
return view('lpj::edit');
|
|
||||||
|
$permohonan = Permohonan::with(['user', 'debiture.province','debiture.city','debiture.district','debiture.village','branch', 'tujuanPenilaian'])->findOrFail($id);
|
||||||
|
|
||||||
|
$jenisPenilaian = JenisPenilaian::all();
|
||||||
|
$teamPenilai = Teams::with(['regions', 'teamsUsers'])->get();
|
||||||
|
|
||||||
|
$jenisJaminan = JenisJaminan::all();
|
||||||
|
|
||||||
|
$nilaiPlafond = NilaiPlafond::all();
|
||||||
|
$jenisFasilitas = JenisFasilitasKredit::all();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return view('lpj::penilaian.form', compact('permohonan', 'jenisPenilaian', 'teamPenilai', 'jenisJaminan', 'nilaiPlafond', 'jenisFasilitas'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,4 +93,70 @@ class PenilaianController extends Controller
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dataForDatatables(Request $request)
|
||||||
|
{
|
||||||
|
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||||
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve data from the database
|
||||||
|
$query = Permohonan::query();
|
||||||
|
|
||||||
|
// Apply search filter if provided
|
||||||
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
|
$search = $request->get('search');
|
||||||
|
$query->where(function ($q) use ($search) {
|
||||||
|
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply sorting if provided
|
||||||
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
|
$order = $request->get('sortOrder');
|
||||||
|
$column = $request->get('sortField');
|
||||||
|
$query->orderBy($column, $order);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the total count of records
|
||||||
|
$totalRecords = $query->count();
|
||||||
|
|
||||||
|
// Apply pagination if provided
|
||||||
|
if ($request->has('page') && $request->has('size')) {
|
||||||
|
$page = $request->get('page');
|
||||||
|
$size = $request->get('size');
|
||||||
|
$offset = ($page - 1) * $size; // Calculate the offset
|
||||||
|
|
||||||
|
$query->skip($offset)->take($size);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the filtered count of records
|
||||||
|
$filteredRecords = $query->count();
|
||||||
|
|
||||||
|
// Get the data for the current page
|
||||||
|
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||||
|
|
||||||
|
// Calculate the page count
|
||||||
|
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||||
|
|
||||||
|
// Calculate the current page number
|
||||||
|
$currentPage = 0 + 1;
|
||||||
|
|
||||||
|
// Return the response data as a JSON object
|
||||||
|
return response()->json([
|
||||||
|
'draw' => $request->get('draw'),
|
||||||
|
'recordsTotal' => $totalRecords,
|
||||||
|
'recordsFiltered' => $filteredRecords,
|
||||||
|
'pageCount' => $pageCount,
|
||||||
|
'page' => $currentPage,
|
||||||
|
'totalCount' => $totalRecords,
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,182 +1,184 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Lpj\Http\Controllers;
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Modules\Lpj\Exports\PermohonanExport;
|
use Modules\Lpj\Exports\PermohonanExport;
|
||||||
use Modules\Lpj\Http\Requests\PermohonanRequest;
|
use Modules\Lpj\Http\Requests\PermohonanRequest;
|
||||||
use Modules\Lpj\Models\Branch;
|
use Modules\Lpj\Models\Branch;
|
||||||
use Modules\Lpj\Models\Debiture;
|
use Modules\Lpj\Models\Debiture;
|
||||||
use Modules\Lpj\Models\Permohonan;
|
use Modules\Lpj\Models\Permohonan;
|
||||||
use Modules\Lpj\Models\StatusPermohonan;
|
use Modules\Lpj\Models\StatusPermohonan;
|
||||||
use Modules\Lpj\Models\TujuanPenilaian;
|
use Modules\Lpj\Models\TujuanPenilaian;
|
||||||
|
|
||||||
class PermohonanController extends Controller
|
class PermohonanController extends Controller
|
||||||
|
{
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public function index()
|
||||||
{
|
{
|
||||||
public $user;
|
return view('lpj::permohonan.index');
|
||||||
|
}
|
||||||
|
|
||||||
public function index()
|
public function store(PermohonanRequest $request)
|
||||||
{
|
{
|
||||||
return view('lpj::permohonan.index');
|
$validate = $request->validated();
|
||||||
}
|
|
||||||
|
|
||||||
public function store(PermohonanRequest $request)
|
// dump($validate);
|
||||||
{
|
if ($validate) {
|
||||||
$validate = $request->validated();
|
try {
|
||||||
|
// Save to database qq
|
||||||
if ($validate) {
|
Permohonan::create($validate);
|
||||||
try {
|
return redirect()
|
||||||
// Save to database qq
|
->route('permohonan.index')
|
||||||
Permohonan::create($validate);
|
->with('success', 'Permohonan created successfully');
|
||||||
return redirect()
|
} catch (Exception $e) {
|
||||||
->route('permohonan.index')
|
|
||||||
->with('success', 'Permohonan created successfully');
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return redirect()
|
|
||||||
->route('permohonan.create')
|
|
||||||
->with('error', 'Failed to create permohonan' . $e->getMessage());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('permohonan.create')
|
->route('permohonan.create')
|
||||||
->with('success', 'error naon iye')
|
->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||||
->withInput();
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
return redirect()
|
||||||
public function create(){
|
->route('permohonan.create')
|
||||||
|
->with('success', 'error naon iye')
|
||||||
return view('lpj::permohonan.create');
|
->withInput();
|
||||||
}
|
|
||||||
|
|
||||||
public function createPermohonan($debitur)
|
|
||||||
{
|
|
||||||
$branches = Branch::all();
|
|
||||||
$debitur = Debiture::find($debitur);
|
|
||||||
$tujuanPenilaian = TujuanPenilaian::all();
|
|
||||||
$status = StatusPermohonan::all();
|
|
||||||
|
|
||||||
return view('lpj::permohonan.form', compact('branches', 'debitur', 'tujuanPenilaian', 'status'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
$permohonan = Permohonan::find($id);
|
|
||||||
$branches = Branch::all();
|
|
||||||
$debitur = Debiture::find($permohonan->debiture_id);
|
|
||||||
$tujuanPenilaian = TujuanPenilaian::all();
|
|
||||||
$status = StatusPermohonan::all();
|
|
||||||
|
|
||||||
return view(
|
|
||||||
'lpj::permohonan.form',
|
|
||||||
compact('permohonan', 'branches', 'debitur', 'tujuanPenilaian', 'status'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update(PermohonanRequest $request, $id)
|
|
||||||
{
|
|
||||||
$validate = $request->validated();
|
|
||||||
|
|
||||||
if ($validate) {
|
|
||||||
try {
|
|
||||||
// Update in database
|
|
||||||
$permohonan = Permohonan::find($id);
|
|
||||||
$permohonan->update($validate);
|
|
||||||
return redirect()
|
|
||||||
->route('permohonan.index')
|
|
||||||
->with('success', 'Permohonan updated successfully');
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return redirect()
|
|
||||||
->route('permohonan.edit', $id)
|
|
||||||
->with('error', 'Failed to update permohonan');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
// Delete from database
|
|
||||||
$permohonan = Permohonan::find($id);
|
|
||||||
$permohonan->delete();
|
|
||||||
|
|
||||||
echo json_encode(['success' => true, 'message' => 'Permohonan deleted successfully']);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
echo json_encode(['success' => false, 'message' => 'Failed to delete permohonan']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
|
||||||
{
|
|
||||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
|
||||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retrieve data from the database
|
|
||||||
$query = Permohonan::query();
|
|
||||||
|
|
||||||
// Apply search filter if provided
|
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
|
||||||
$search = $request->get('search');
|
|
||||||
$query->where(function ($q) use ($search) {
|
|
||||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
|
||||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply sorting if provided
|
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
|
||||||
$order = $request->get('sortOrder');
|
|
||||||
$column = $request->get('sortField');
|
|
||||||
$query->orderBy($column, $order);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the total count of records
|
|
||||||
$totalRecords = $query->count();
|
|
||||||
|
|
||||||
// Apply pagination if provided
|
|
||||||
if ($request->has('page') && $request->has('size')) {
|
|
||||||
$page = $request->get('page');
|
|
||||||
$size = $request->get('size');
|
|
||||||
$offset = ($page - 1) * $size; // Calculate the offset
|
|
||||||
|
|
||||||
$query->skip($offset)->take($size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the filtered count of records
|
|
||||||
$filteredRecords = $query->count();
|
|
||||||
|
|
||||||
// Get the data for the current page
|
|
||||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
|
||||||
|
|
||||||
// Calculate the page count
|
|
||||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
|
||||||
|
|
||||||
// Calculate the current page number
|
|
||||||
$currentPage = 0 + 1;
|
|
||||||
|
|
||||||
// Return the response data as a JSON object
|
|
||||||
return response()->json([
|
|
||||||
'draw' => $request->get('draw'),
|
|
||||||
'recordsTotal' => $totalRecords,
|
|
||||||
'recordsFiltered' => $filteredRecords,
|
|
||||||
'pageCount' => $pageCount,
|
|
||||||
'page' => $currentPage,
|
|
||||||
'totalCount' => $totalRecords,
|
|
||||||
'data' => $data,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function export()
|
|
||||||
{
|
|
||||||
return Excel::download(new PermohonanExport, 'permohonan.xlsx');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
|
||||||
|
return view('lpj::permohonan.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createPermohonan($debitur)
|
||||||
|
{
|
||||||
|
$branches = Branch::all();
|
||||||
|
$debitur = Debiture::find($debitur);
|
||||||
|
$tujuanPenilaian = TujuanPenilaian::all();
|
||||||
|
$status = StatusPermohonan::all();
|
||||||
|
|
||||||
|
return view('lpj::permohonan.form', compact('branches', 'debitur', 'tujuanPenilaian', 'status'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$permohonan = Permohonan::find($id);
|
||||||
|
$branches = Branch::all();
|
||||||
|
$debitur = Debiture::find($permohonan->debiture_id);
|
||||||
|
$tujuanPenilaian = TujuanPenilaian::all();
|
||||||
|
$status = StatusPermohonan::all();
|
||||||
|
|
||||||
|
return view(
|
||||||
|
'lpj::permohonan.form',
|
||||||
|
compact('permohonan', 'branches', 'debitur', 'tujuanPenilaian', 'status'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(PermohonanRequest $request, $id)
|
||||||
|
{
|
||||||
|
$validate = $request->validated();
|
||||||
|
|
||||||
|
if ($validate) {
|
||||||
|
try {
|
||||||
|
// Update in database
|
||||||
|
$permohonan = Permohonan::find($id);
|
||||||
|
$permohonan->update($validate);
|
||||||
|
return redirect()
|
||||||
|
->route('permohonan.index')
|
||||||
|
->with('success', 'Permohonan updated successfully');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return redirect()
|
||||||
|
->route('permohonan.edit', $id)
|
||||||
|
->with('error', 'Failed to update permohonan');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
// Delete from database
|
||||||
|
$permohonan = Permohonan::find($id);
|
||||||
|
$permohonan->delete();
|
||||||
|
|
||||||
|
echo json_encode(['success' => true, 'message' => 'Permohonan deleted successfully']);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo json_encode(['success' => false, 'message' => 'Failed to delete permohonan']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dataForDatatables(Request $request)
|
||||||
|
{
|
||||||
|
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||||
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve data from the database
|
||||||
|
$query = Permohonan::query();
|
||||||
|
|
||||||
|
// Apply search filter if provided
|
||||||
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
|
$search = $request->get('search');
|
||||||
|
$query->where(function ($q) use ($search) {
|
||||||
|
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply sorting if provided
|
||||||
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
|
$order = $request->get('sortOrder');
|
||||||
|
$column = $request->get('sortField');
|
||||||
|
$query->orderBy($column, $order);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the total count of records
|
||||||
|
$totalRecords = $query->count();
|
||||||
|
|
||||||
|
// Apply pagination if provided
|
||||||
|
if ($request->has('page') && $request->has('size')) {
|
||||||
|
$page = $request->get('page');
|
||||||
|
$size = $request->get('size');
|
||||||
|
$offset = ($page - 1) * $size; // Calculate the offset
|
||||||
|
|
||||||
|
$query->skip($offset)->take($size);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the filtered count of records
|
||||||
|
$filteredRecords = $query->count();
|
||||||
|
|
||||||
|
// Get the data for the current page
|
||||||
|
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||||
|
|
||||||
|
// Calculate the page count
|
||||||
|
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||||
|
|
||||||
|
// Calculate the current page number
|
||||||
|
$currentPage = 0 + 1;
|
||||||
|
|
||||||
|
// Return the response data as a JSON object
|
||||||
|
return response()->json([
|
||||||
|
'draw' => $request->get('draw'),
|
||||||
|
'recordsTotal' => $totalRecords,
|
||||||
|
'recordsFiltered' => $filteredRecords,
|
||||||
|
'pageCount' => $pageCount,
|
||||||
|
'page' => $currentPage,
|
||||||
|
'totalCount' => $totalRecords,
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function export()
|
||||||
|
{
|
||||||
|
return Excel::download(new PermohonanExport(), 'permohonan.xlsx');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -38,7 +38,9 @@ class TeamsController extends Controller
|
|||||||
|
|
||||||
// cek user apakah sudah ada di tabel teams_users
|
// cek user apakah sudah ada di tabel teams_users
|
||||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||||
$user = User::whereNotIn('id', $userTeam)->get();
|
$user = User::whereNotIn('id', $userTeam)
|
||||||
|
->with('roles')
|
||||||
|
->get();
|
||||||
|
|
||||||
return view('lpj::teams.form', compact('region', 'user'));
|
return view('lpj::teams.form', compact('region', 'user'));
|
||||||
}
|
}
|
||||||
@ -97,8 +99,9 @@ class TeamsController extends Controller
|
|||||||
|
|
||||||
$region = Regions::all();
|
$region = Regions::all();
|
||||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||||
|
$user = User::whereNotIn('id', $usedUsers)
|
||||||
$user = User::whereNotIn('id', $usedUsers)->get();
|
->with('roles')
|
||||||
|
->get();
|
||||||
// Ambil user yang sudah ada di tim ini
|
// Ambil user yang sudah ada di tim ini
|
||||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||||
|
|
||||||
@ -169,20 +172,20 @@ class TeamsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
if (is_null($this->user) || !$this->user->can('teams.view')) {
|
||||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inisialisasi query
|
||||||
$query = Teams::select('teams.id as id', 'teams.name as team_name', 'regions.name as region_name')
|
$query = Teams::select('teams.id as id', 'teams.name as team_name', 'regions.name as region_name')
|
||||||
->join('regions', 'teams.regions_id', '=', 'regions.id')
|
->join('regions', 'teams.regions_id', '=', 'regions.id')
|
||||||
->leftJoin('teams_users', 'teams.id', '=', 'teams_users.teams_id')
|
->leftJoin('teams_users', 'teams.id', '=', 'teams_users.teams_id')
|
||||||
->leftJoin('users', 'teams_users.user_id', '=', 'users.id')
|
->leftJoin('users', 'teams_users.user_id', '=', 'users.id')
|
||||||
->addSelect('users.name as user_name');
|
->addSelect('users.id as user_id', 'users.name as user_name');
|
||||||
|
|
||||||
// search filter
|
// Filter pencarian
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
$query->where(function ($q) use ($search) {
|
$query->where(function ($q) use ($search) {
|
||||||
@ -192,41 +195,43 @@ class TeamsController extends Controller
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// sorting
|
// Sorting
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
$order = $request->get('sortOrder');
|
$order = $request->get('sortOrder');
|
||||||
$column = $request->get('sortField');
|
$column = $request->get('sortField');
|
||||||
$query->orderBy($column, $order);
|
$query->orderBy($column, $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hitung total records
|
||||||
$totalRecords = $query->count();
|
$totalRecords = $query->count();
|
||||||
|
|
||||||
$size = $request->get('size');
|
// Pagination
|
||||||
$pageCount = 1;
|
$size = $request->get('size', 10);
|
||||||
|
$page = $request->get('page', 1);
|
||||||
|
$offset = ($page - 1) * $size;
|
||||||
|
|
||||||
if ($size > 0) {
|
// Ambil data dengan pagination
|
||||||
if ($request->has('page') && $request->has('size')) {
|
$data = $query->skip($offset)->take($size)->get();
|
||||||
$page = $request->get('page');
|
$filteredRecords = $data->count();
|
||||||
$offset = ($page - 1) * $size;
|
$pageCount = ceil($totalRecords / $size);
|
||||||
$query->skip($offset)->take($size);
|
|
||||||
$filteredRecords = $query->count();
|
|
||||||
$pageCount = ceil($totalRecords / $size);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = $query->get();
|
// Ambil ID pengguna dari hasil query
|
||||||
} else {
|
$userIds = $data->pluck('user_id')->unique();
|
||||||
$filteredRecords = $totalRecords;
|
|
||||||
$data = $query->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
$currentPage = $request->get('page') ?? 1;
|
// Ambil data pengguna dengan peran mereka
|
||||||
|
$users = User::whereIn('id', $userIds)
|
||||||
|
->with('roles')
|
||||||
|
->get()
|
||||||
|
->keyBy('id');
|
||||||
|
|
||||||
$formattedData = $data->groupBy('id')->map(function ($group) {
|
// Format data
|
||||||
|
$formattedData = $data->groupBy('id')->map(function ($group) use ($users) {
|
||||||
$team = $group->first();
|
$team = $group->first();
|
||||||
$team->user_team = $group->map(function ($item) {
|
$team->user_team = $group->map(function ($item) use ($users) {
|
||||||
|
$user = $users->get($item->user_id);
|
||||||
return [
|
return [
|
||||||
'nama' => $item->user_name,
|
'nama' => $item->user_name,
|
||||||
// 'role' => $item->role_name,
|
'roles' => $user ? $user->roles->pluck('name')->toArray() : [],
|
||||||
];
|
];
|
||||||
})->toArray();
|
})->toArray();
|
||||||
return $team;
|
return $team;
|
||||||
@ -237,16 +242,18 @@ class TeamsController extends Controller
|
|||||||
'recordsTotal' => $totalRecords,
|
'recordsTotal' => $totalRecords,
|
||||||
'recordsFiltered' => $filteredRecords,
|
'recordsFiltered' => $filteredRecords,
|
||||||
'pageCount' => $pageCount,
|
'pageCount' => $pageCount,
|
||||||
'page' => $currentPage,
|
'page' => $page,
|
||||||
'totalCount' => $totalRecords,
|
'totalCount' => $totalRecords,
|
||||||
'data' => $formattedData
|
'data' => $formattedData
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function export()
|
public function export()
|
||||||
{
|
{
|
||||||
return Excel::download(new TeamPenilaianExport, 'team-penilai.xlsx');
|
return Excel::download(new TeamPenilaianExport(), 'team-penilai.xlsx');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class TeamsRequest extends FormRequest
|
|||||||
$rules = [
|
$rules = [
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:255',
|
||||||
'status' => 'nullable|boolean',
|
'status' => 'nullable|boolean',
|
||||||
'regions_id' => 'nullable|exists:regions,id',
|
'regions_id' => 'required|nullable|exists:regions,id',
|
||||||
'user.*' => 'nullable|exists:users,id',
|
'user.*' => 'nullable|exists:users,id',
|
||||||
'authorized_at' => 'nullable|datetime',
|
'authorized_at' => 'nullable|datetime',
|
||||||
'authorized_status' => 'nullable|string|max:1',
|
'authorized_status' => 'nullable|string|max:1',
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Modules\Lpj\Database\Factories\PenilaianFactory;
|
use Modules\Lpj\Database\Factories\PenilaianFactory;
|
||||||
use Modules\Lpj\Models\JenisPenilaian;
|
use Modules\Lpj\Models\JenisPenilaian;
|
||||||
use Modules\Lpj\Models\Teams;
|
use Modules\Lpj\Models\Teams;
|
||||||
// use Modules\Usermanagement\Models\User;
|
use Modules\Usermanagement\Models\User;
|
||||||
|
|
||||||
class Penilaian extends Model
|
class Penilaian extends Model
|
||||||
{
|
{
|
||||||
@ -30,9 +30,9 @@ class Penilaian extends Model
|
|||||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function users(){
|
public function users(){
|
||||||
// return $this->belongsTo(User::class, 'user_id', 'id');
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Modules\Lpj\Models\Branch;
|
|
||||||
|
|
||||||
return new class extends Migration {
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
Schema::create('debitures', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->foreignIdFor(Branch::class)->constrained()->onDelete('cascade');
|
|
||||||
$table->string('cif', 10)->unique();
|
|
||||||
$table->string('name');
|
|
||||||
$table->date('registered_at')->nullable();
|
|
||||||
$table->string('npwp', 16)->nullable();
|
|
||||||
$table->string('nomor_id', 16)->nullable();
|
|
||||||
$table->string('email', 100)->nullable();
|
|
||||||
$table->string('phone', 15)->nullable();
|
|
||||||
$table->string('nomor_rekening', 50)->nullable();
|
|
||||||
$table->string('province_code')->nullable()->index();
|
|
||||||
$table->string('city_code')->nullable()->index();
|
|
||||||
$table->string('district_code')->nullable()->index();
|
|
||||||
$table->string('village_code')->nullable()->index();
|
|
||||||
$table->string('postal_code', 5)->nullable();
|
|
||||||
$table->text('address')->nullable();
|
|
||||||
|
|
||||||
$table->boolean('status')->default(true)->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
$table->timestamp('authorized_at')->nullable();
|
|
||||||
$table->char('authorized_status', 1)->nullable();
|
|
||||||
$table->softDeletes();
|
|
||||||
|
|
||||||
$table->unsignedBigInteger('created_by')->nullable();
|
|
||||||
$table->unsignedBigInteger('updated_by')->nullable();
|
|
||||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
|
||||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('debitures');
|
|
||||||
}
|
|
||||||
};
|
|
@ -20,6 +20,7 @@
|
|||||||
"permission": "",
|
"permission": "",
|
||||||
"roles": [
|
"roles": [
|
||||||
"Administrator"
|
"Administrator"
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
@if (isset($jenisPenilaian->id))
|
@if (isset($jenisPenilaian->id))
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<input type="text" name="id" value="{{ $jenisPenilaian->id }}">
|
<input type="hidden" name="id" value="{{ $jenisPenilaian->id }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@csrf
|
@csrf
|
||||||
|
511
resources/views/penilaian/form.blade.php
Normal file
511
resources/views/penilaian/form.blade.php
Normal file
@ -0,0 +1,511 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('styles')
|
||||||
|
<style>
|
||||||
|
.divider {
|
||||||
|
border: none;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #ddd;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h1 {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
|
|
||||||
|
<div class="card pb-2.5">
|
||||||
|
<div class="card-header" id="basic_settings">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Form Data Jaminan
|
||||||
|
</h3>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<a href="{{ route('basicdata.penilaian.index') }}" class="btn btn-xs btn-info"><i
|
||||||
|
class="ki-filled ki-exit-left"></i>
|
||||||
|
Back</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<form action="" method="POST" class="">
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-5 lg:gap-7.5">
|
||||||
|
<div class="grid gap-2.5">
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-24">
|
||||||
|
Nomor Registrasi
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
|
||||||
|
<input class="input @error('nomor_registrasi') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-12">
|
||||||
|
Nama Pemohon
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="cif" value="{{ $permohonan->user->name }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-12">
|
||||||
|
Tanggal Pemohon
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="date" name="cif" value="{{ $permohonan->tanggal_permohonan }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid gap-2.5">
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label ">
|
||||||
|
Status
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="cif" value="{{ $permohonan->status }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label">
|
||||||
|
Cabang Pemohon
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="cif" value="{{ $permohonan->branch->name }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-24">
|
||||||
|
Cabang Penilai
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="grid gap-2.5">
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-24">
|
||||||
|
Nomor Registrasi cabang
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-24">
|
||||||
|
Nama Bagian
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
<div class="divider"></div>
|
||||||
|
<div class="grid gap-5">
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">1. IDENTITAS DEBITUR</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama Debitur
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="cif" value="{{ $permohonan->debiture->name }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Alamat
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p>
|
||||||
|
{{ $permohonan->debiture->address . ' ' . $permohonan->debiture->village->name . ', ' . $permohonan->debiture->district->name . ', ' . $permohonan->debiture->city->name . ', ' . $permohonan->debiture->province->name . ' ' . '(' . $permohonan->debiture->postal_code . ')' }}
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor Cif
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="{{ $permohonan->debiture->cif }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">2. LETAK JAMINAN</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Alamat jaminan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<textarea class="textarea @error('cif') border-danger bg-danger-light @enderror" rows="3" type="number"
|
||||||
|
name="cif" value=""></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Kode Dati II
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<section class="input w-full">
|
||||||
|
<option value="">1</option>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Debitur/Wakil Debitur
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Telepon
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('cif') border-danger bg-danger-light @enderror"
|
||||||
|
type="number" name="cif" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">3. FASILITAS KREDIT</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Jenis Fasilitas
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($jenisFasilitas as $item)
|
||||||
|
<option value="">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nilai Plafond
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($nilaiPlafond as $item)
|
||||||
|
<option value="">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">4. TUJUAN PENILAIAN</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Jenis jaminan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
<option value="">{{ $permohonan->tujuanPenilaian->name }}</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">5. JENIS JAMINAN</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Jenis jaminan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($jenisJaminan as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">6. TIPE JAMINAN</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5">
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
tipe jaminan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($jenisJaminan as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">7. DATA-DATA</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 border">
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"">
|
||||||
|
<label class="form-label max-w-56 ">
|
||||||
|
Update By
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||||
|
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('user') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="user" value="">
|
||||||
|
@error('province_code')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('update_at') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="update_at" value="">
|
||||||
|
@error('city_code')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1 class="h1">6. TIPE JAMINAN</h1>
|
||||||
|
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 p-5">
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Penilai yang Dilakukan oleh
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($jenisPenilaian as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Tim Penilai yang di tunjuk
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<select
|
||||||
|
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||||
|
@foreach ($teamPenilai as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@error('tujuan_penilaian_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Penilai yang di tunjuk
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="penilai_tunjuk" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Jadwal Kunjungan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
|
||||||
|
type="date" name="tanggal_kunjungan" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Tanggal
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('tanggal_kunjungan') border-danger bg-danger-light @enderror"
|
||||||
|
type="date" name="tanggal_kunjungan" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Catatan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<textarea class="textarea @error('keterangan') border-danger bg-danger-light @enderror" rows="3"
|
||||||
|
type="text" name="keterangan" value=""></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"">
|
||||||
|
<label class="form-label max-w-56 ">
|
||||||
|
Update By
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||||
|
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('user') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="user" value="">
|
||||||
|
@error('province_code')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input
|
||||||
|
class="input @error('update_at') border-danger bg-danger-light @enderror"
|
||||||
|
type="text" name="update_at" value="">
|
||||||
|
@error('city_code')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<div class="flex justify-end gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-info">
|
||||||
|
Assign
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-light">
|
||||||
|
Print From
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -1,128 +1,262 @@
|
|||||||
@extends('layouts.main')
|
@extends('layouts.main')
|
||||||
|
|
||||||
@section('breadcrumbs')
|
@section('breadcrumbs')
|
||||||
{{-- {{ Breadcrumbs::render('penilaian') }} --}}
|
{{ Breadcrumbs::render('basicdata.penilaian') }}
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
|
|
||||||
<div class="card pb-2.5">
|
<div class="card pb-2.5">
|
||||||
<div class="card-header" id="basic_settings">
|
<div class="card-header" id="basic_settings">
|
||||||
<h3 class="card-title">
|
<div class="card-title flex flex-row gap-1.5">
|
||||||
{{ isset($debitur->id) ? 'Edit' : 'Tambah' }} Debitur
|
@if (isset($status_permohonan))
|
||||||
</h3>
|
@foreach ($status_permohonan as $item)
|
||||||
<div class="flex items-center gap-2">
|
<a href="" class="btn btn-xs btn-outline btn-primary"> {{ $item->name }} </a>
|
||||||
@if (isset($debitur->id))
|
@endforeach
|
||||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat
|
|
||||||
Permohonan </a>
|
|
||||||
@endif
|
@endif
|
||||||
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
</div>
|
||||||
Back</a>
|
</div>
|
||||||
|
|
||||||
|
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
|
||||||
|
<div class="card-header py-5 flex-wrap">
|
||||||
|
<h3 class="card-title">
|
||||||
|
{{-- Daftar {{}} --}}
|
||||||
|
</h3>
|
||||||
|
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||||
|
<div class="flex">
|
||||||
|
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||||
|
<input placeholder="Search Permohonan" id="search" type="text" value="">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap gap-2.5">
|
||||||
|
<div class="h-[24px] border border-r-gray-200"></div>
|
||||||
|
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
|
||||||
|
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="scrollable-x-auto">
|
||||||
|
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-14">
|
||||||
|
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||||
|
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||||
|
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||||
|
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||||
|
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||||
|
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||||
|
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="status">
|
||||||
|
<span class="sort"> <span class="sort-label"> Status </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
Show
|
||||||
|
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
|
<span data-datatable-info="true"> </span>
|
||||||
|
<div class="pagination" data-datatable-pagination="true">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
{{-- @section('content')
|
||||||
|
<div class="grid">
|
||||||
|
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="penilaian-table" data-api-url="{{ route('basicdata.penilaian.datatables') }}">
|
||||||
|
<div class="card-header py-5 flex-wrap">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Daftar penilaian
|
||||||
|
</h3>
|
||||||
|
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||||
|
<div class="flex">
|
||||||
|
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||||
|
<input placeholder="Search penilaian" id="search" type="text" value="">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap gap-2.5">
|
||||||
|
<div class="h-[24px] border border-r-gray-200"></div>
|
||||||
|
<a class="btn btn-sm btn-light" href="{{ route('basicdata.penilaian.export') }}"> Export to Excel </a>
|
||||||
|
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.penilaian.create') }}"> Tambah penilaian </a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
<div class="scrollable-x-auto">
|
||||||
<form action="" method="POST" class="grid gap-5">
|
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||||
{{-- @if (isset($debitur->id))
|
<thead>
|
||||||
@method('PUT')
|
<tr>
|
||||||
@endif
|
<th class="w-14">
|
||||||
@csrf --}}
|
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
</th>
|
||||||
<label class="form-label max-w-56">
|
<th class="min-w-[250px]" data-datatable-column="code">
|
||||||
Cabang
|
<span class="sort"> <span class="sort-label"> Code </span>
|
||||||
</label>
|
<span class="sort-icon"> </span> </span>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
</th>
|
||||||
<select
|
<th class="min-w-[250px]" data-datatable-column="name">
|
||||||
class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
<span class="sort"> <span class="sort-label"> penilaian </span>
|
||||||
name="branch_id" id="branch_id">
|
<span class="sort-icon"> </span> </span>
|
||||||
<option value="">Pilih Cabang</option>
|
</th>
|
||||||
|
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||||
</select>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
Show
|
||||||
|
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
|
<span data-datatable-info="true"> </span>
|
||||||
|
<div class="pagination" data-datatable-pagination="true">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
</div>
|
||||||
<label class="form-label max-w-56">
|
|
||||||
CIF
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number"
|
|
||||||
name="cif" value="">
|
|
||||||
@error('cif')
|
|
||||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
|
||||||
<label class="form-label max-w-56">
|
|
||||||
Nomor Rekening
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('nomor_rekening') border-danger bg-danger-light @enderror"
|
|
||||||
type="number" name="nomor_rekening" value=""
|
|
||||||
@error('nomor_rekening')
|
|
||||||
<em class="alert text-danger text-sm"></em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
|
||||||
<label class="form-label max-w-56">
|
|
||||||
Nama Debitur
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
|
||||||
name="name" value="">
|
|
||||||
@error('name')
|
|
||||||
<em class="alert text-danger text-sm"></em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
|
||||||
<label class="form-label max-w-56">
|
|
||||||
NPWP
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number"
|
|
||||||
name="npwp" value="{{ $debitur->npwp ?? '' }}">
|
|
||||||
@error('npwp')
|
|
||||||
<em class="alert text-danger text-sm"></em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
|
||||||
<label class="form-label max-w-56">
|
|
||||||
Email
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email"
|
|
||||||
name="email" value="{{ $debitur->email ?? '' }}">
|
|
||||||
@error('email')
|
|
||||||
<em class="alert text-danger text-sm"></em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
|
||||||
<label class="form-label max-w-56">
|
|
||||||
No Handphone
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number"
|
|
||||||
name="phone" value="">
|
|
||||||
@error('phone')
|
|
||||||
<em class="alert text-danger text-sm"></em>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex justify-end">
|
|
||||||
<button type="submit" class="btn btn-primary">
|
|
||||||
Save
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection --}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function deleteData(data) {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Are you sure?',
|
||||||
|
text: "You won't be able to revert this!",
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: '#3085d6',
|
||||||
|
cancelButtonColor: '#d33',
|
||||||
|
confirmButtonText: 'Yes, delete it!'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
$.ajaxSetup({
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.ajax(`basic-data/penilaian/${data}`, {
|
||||||
|
type: 'DELETE'
|
||||||
|
}).then((response) => {
|
||||||
|
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
const element = document.querySelector('#permohonan-table');
|
||||||
|
const searchInput = document.getElementById('search');
|
||||||
|
|
||||||
|
const apiUrl = element.getAttribute('data-api-url');
|
||||||
|
const dataTableOptions = {
|
||||||
|
apiEndpoint: apiUrl,
|
||||||
|
pageSize: 5,
|
||||||
|
columns: {
|
||||||
|
select: {
|
||||||
|
render: (item, data, context) => {
|
||||||
|
const checkbox = document.createElement('input');
|
||||||
|
checkbox.className = 'checkbox checkbox-sm';
|
||||||
|
checkbox.type = 'checkbox';
|
||||||
|
checkbox.value = data.id.toString();
|
||||||
|
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||||
|
return checkbox.outerHTML.trim();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
nomor_registrasi: {
|
||||||
|
title: 'Nomor Registrasi',
|
||||||
|
},
|
||||||
|
tanggal_permohonan: {
|
||||||
|
title: 'Tanggal Permohonan'
|
||||||
|
},
|
||||||
|
user_id: {
|
||||||
|
title: 'User Pemohon',
|
||||||
|
render: (item, data) => {
|
||||||
|
return `${data.user.name}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
branch_id: {
|
||||||
|
title: 'Cabang Pemohon',
|
||||||
|
render: (item, data) => {
|
||||||
|
return `${data.branch.name}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
debitur_id: {
|
||||||
|
title: 'Debitur',
|
||||||
|
render: (item, data) => {
|
||||||
|
return `${data.debiture.name}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tujuan_penilaian_id: {
|
||||||
|
title: 'Tujuan Penilaian',
|
||||||
|
render: (item, data) => {
|
||||||
|
return `${data.tujuan_penilaian.name}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
title: 'Status'
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
title: 'Status',
|
||||||
|
render: (item, data) => {
|
||||||
|
return `<div class="flex flex-nowrap justify-center">
|
||||||
|
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/penilaian/${data.id}/edit">
|
||||||
|
<i class="ki-outline ki-notepad-edit"></i>
|
||||||
|
</a>
|
||||||
|
</div>`;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||||
|
// Custom search functionality
|
||||||
|
searchInput.addEventListener('input', function () {
|
||||||
|
const searchValue = this.value.trim();
|
||||||
|
dataTable.search(searchValue, true);
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@ -57,9 +57,10 @@
|
|||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">Region</label>
|
<label class="form-label max-w-56">Region</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select class="input tomselect w-full border-danger bg-danger-light" name="regions_id">
|
<select
|
||||||
|
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
|
||||||
|
name="regions_id">
|
||||||
<option value="">Select Region</option>
|
<option value="">Select Region</option>
|
||||||
|
|
||||||
@if (isset($region))
|
@if (isset($region))
|
||||||
@foreach ($region as $regions)
|
@foreach ($region as $regions)
|
||||||
@if (isset($teams))
|
@if (isset($teams))
|
||||||
@ -71,31 +72,45 @@
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@error('regions_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">Users</label>
|
<label class="form-label max-w-56">Users</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select class="input tomselect w-full border-danger bg-danger-light select2" name="user[]"
|
<select
|
||||||
multiple="multiple">
|
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror select2"
|
||||||
|
name="user[]" multiple="multiple">
|
||||||
<option value="">Select Team Group</option>
|
<option value="">Select Team Group</option>
|
||||||
@if (isset($user))
|
@if (isset($user))
|
||||||
@foreach ($user as $users)
|
@foreach ($user as $users)
|
||||||
@if (isset($teams))
|
@if (isset($teams))
|
||||||
<option value="{{ $users->id }}"
|
<option value="{{ $users->id }}"
|
||||||
{{ in_array($users->id, $selectedUsers) ? 'selected' : '' }}>
|
{{ in_array($users->id, $selectedUsers) ? 'selected' : '' }}>
|
||||||
{{ $users->name }}</option>
|
{{ $users->name . ' | ' }}
|
||||||
|
@foreach ($users->roles as $role)
|
||||||
|
{{ $role->name }}
|
||||||
|
@endforeach
|
||||||
|
</option>
|
||||||
@else
|
@else
|
||||||
<option value="{{ $users->id }}">{{ $users->name }}</option>
|
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||||
|
|
||||||
|
@foreach ($users->roles as $role)
|
||||||
|
{{ $role->name }}
|
||||||
|
@endforeach
|
||||||
|
</option>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
@error('user')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -141,7 +141,9 @@
|
|||||||
title: 'User Team',
|
title: 'User Team',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
if (data.user_team && data.user_team.length) {
|
if (data.user_team && data.user_team.length) {
|
||||||
return `<ul>${data.user_team.map(user => `<li>${user.nama}</li>`).join('')}</ul>`;
|
return `<ul>${data.user_team.map(user =>
|
||||||
|
`<li>${user.nama} | ${user.roles.join(', ')}</li>`
|
||||||
|
).join('')}</ul>`;
|
||||||
} else {
|
} else {
|
||||||
return '<ul><li>N/A</li></ul>';
|
return '<ul><li>N/A</li></ul>';
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,12 @@
|
|||||||
$trail->push('Edit Jenis Penilaian');
|
$trail->push('Edit Jenis Penilaian');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Breadcrumbs::for('basicdata.penilaian', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('basicdata.penilaian', function (BreadcrumbTrail $trail) {
|
||||||
$trail->parent('basicdata');
|
$trail->parent('basicdata');
|
||||||
$trail->push('Jenis Penilaian', route('basicdata.penilaian.index'));
|
$trail->push('Penilaian', route('basicdata.penilaian.index'));
|
||||||
|
});
|
||||||
|
Breadcrumbs::for('basicdata.penilaian.edit', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('basicdata.penilaian');
|
||||||
|
$trail->push('Buat Penilaian');
|
||||||
});
|
});
|
||||||
|
@ -285,4 +285,5 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Route::resource('debitur', DebitureController::class);
|
Route::resource('debitur', DebitureController::class);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user