Memperbaiki Conflict Staging dan Tender
This commit is contained in:
46
app/Exports/JenisPenilaianExport.php
Normal file
46
app/Exports/JenisPenilaianExport.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class JenisPenilaianExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return JenisPenilaian::all();
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
return [
|
||||
$row->id,
|
||||
$row->code,
|
||||
$row->name,
|
||||
$row->created_at
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Code',
|
||||
'Jenis Penilaian',
|
||||
'Created At'
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'D' => NumberFormat::FORMAT_DATE_DATETIME
|
||||
];
|
||||
}
|
||||
}
|
||||
49
app/Exports/RegionExport.php
Normal file
49
app/Exports/RegionExport.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class RegionExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return Regions::all();
|
||||
}
|
||||
|
||||
public function map($row)
|
||||
: array
|
||||
{
|
||||
return [
|
||||
$row->id,
|
||||
$row->code,
|
||||
$row->name,
|
||||
$row->created_at
|
||||
];
|
||||
}
|
||||
|
||||
public function headings()
|
||||
: array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Code',
|
||||
'Name',
|
||||
'Created At'
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats()
|
||||
: array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'D' => NumberFormat::FORMAT_DATE_DATETIME
|
||||
];
|
||||
}
|
||||
}
|
||||
57
app/Exports/TeamPenilaianExport.php
Normal file
57
app/Exports/TeamPenilaianExport.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
|
||||
class TeamPenilaianExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return Teams::select(
|
||||
'teams.id as id',
|
||||
'teams.name as team_name',
|
||||
'regions.name as region_name',
|
||||
DB::raw('STRING_AGG(users.name, \', \') as team_group')
|
||||
)
|
||||
->join('regions', 'teams.regions_id', '=', 'regions.id')
|
||||
->leftJoin('teams_users', 'teams.id', '=', 'teams_users.teams_id')
|
||||
->leftJoin('users', 'teams_users.user_id', '=', 'users.id')
|
||||
->groupBy('teams.id', 'teams.name', 'regions.name')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
return [
|
||||
$row->team_name,
|
||||
$row->region_name,
|
||||
$row->team_group,
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Name',
|
||||
'Region',
|
||||
'Anggota Team',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_TEXT,
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
'C' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
}
|
||||
152
app/Http/Controllers/ActivityController.php
Normal file
152
app/Http/Controllers/ActivityController.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
|
||||
class ActivityController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$status_permohonan = StatusPermohonan::all();
|
||||
return view('lpj::activity.index', compact('status_permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
|
||||
$status_permohonan = StatusPermohonan::orderBy('id')->get();
|
||||
|
||||
$permohonan = Permohonan::with(
|
||||
[
|
||||
'user',
|
||||
'debiture.province',
|
||||
'debiture.city',
|
||||
'debiture.district',
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian'
|
||||
],
|
||||
)->findOrFail($id);
|
||||
|
||||
return view('lpj::activity.activitydetail', compact('id', 'status_permohonan', 'permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
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 status filter if provided
|
||||
if ($request->has('status') && !empty($request->get('status'))) {
|
||||
$status = $request->get('status');
|
||||
$query->where('status', '=', $status);
|
||||
}
|
||||
|
||||
// Default sorting if no sort provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
} else {
|
||||
$query->orderBy('nomor_registrasi', 'asc'); // Default order by nomor_registrasi
|
||||
}
|
||||
|
||||
// Get the total count of records before paginating
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = (int) $request->get('page', 1); // Default page is 1
|
||||
$size = (int) $request->get('size', 10); // Default size is 10
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
// Limit results based on pagination
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records (after search & filters applied)
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
// Calculate the total number of pages
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $request->get('page', 1),
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download the specified resource from storage.
|
||||
*/
|
||||
public function download($id)
|
||||
{
|
||||
$document = Permohonan::find($id);
|
||||
return response()->download(storage_path('app/public/' . $document->dokumen));
|
||||
}
|
||||
}
|
||||
156
app/Http/Controllers/JenisPenilaianController.php
Normal file
156
app/Http/Controllers/JenisPenilaianController.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Exception;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Http\Requests\JenisPenilaianRequest;
|
||||
use Modules\Lpj\Exports\JenisPenilaianExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class JenisPenilaianController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::jenis_penilaian.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::jenis_penilaian.form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(JenisPenilaianRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
try {
|
||||
JenisPenilaian::create($validate);
|
||||
return redirect()->route('basicdata.jenis-penilaian.index')->with('success', 'Jenis Penilaian created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('basicdata.jenis-penilaian.create')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$jenisPenilaian = JenisPenilaian::find($id);
|
||||
return view('lpj::jenis_penilaian.form', compact('jenisPenilaian'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(JenisPenilaianRequest $request, $id)
|
||||
{
|
||||
|
||||
$validated = $request->validated();
|
||||
|
||||
|
||||
if ($validated) {
|
||||
try {
|
||||
$jenisPenilaian = JenisPenilaian::find($id);
|
||||
$jenisPenilaian->update($validated);
|
||||
return redirect()->route('basicdata.jenis-penilaian.index')->with('success', 'Jenis Penilaian updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('basicdata.jenis-penilaian.edit', $id)->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$jenisPenilaian = JenisPenilaian::find($id);
|
||||
$jenisPenilaian->delete();
|
||||
echo json_encode(['success' => true, 'message' => 'Jenis Penilaian deleted successfully']);
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete Jenis Penilaian']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_penilaian.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = JenisPenilaian::query();
|
||||
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
$totalRecords = $query->count();
|
||||
|
||||
|
||||
$size = $request->get('size');
|
||||
$pageCount = 1;
|
||||
|
||||
if ($size > 0) {
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$offset = ($page - 1) * $size;
|
||||
$query->skip($offset)->take($size);
|
||||
$filteredRecords = $query->count();
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
}
|
||||
|
||||
$data = $query->get();
|
||||
} else {
|
||||
$filteredRecords = $totalRecords;
|
||||
$data = $query->get();
|
||||
}
|
||||
|
||||
$currentPage = $request->get('page') ?? 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 JenisPenilaianExport(), 'jenis-penilaian.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class KJPPController extends Controller
|
||||
if ($file !== null) {
|
||||
// Jika ada file dari database maka hapus file yang lama ke file yang baru
|
||||
$kjpp = KJPP::find($id);
|
||||
// Storage::delete('public/uploads_pdf/' . $kjpp->attachment);
|
||||
Storage::delete('public/uploads_pdf/' . $kjpp->attachment);
|
||||
// Simpan file yang diunggah
|
||||
$file->storeAs('public/uploads_pdf', $filename);
|
||||
$validated['attachment'] = $filename;
|
||||
|
||||
225
app/Http/Controllers/PenilaianController.php
Normal file
225
app/Http/Controllers/PenilaianController.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Http\Requests\PenilaianRequest;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class PenilaianController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$status_permohonan = StatusPermohonan::all();
|
||||
|
||||
return view('lpj::penilaian.index', compact('status_permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(PenilaianRequest $request)
|
||||
{
|
||||
//print_r($request->all());exit;
|
||||
$validatedData = $request->validated();
|
||||
if ($validatedData) {
|
||||
try {
|
||||
$penilaian = Penilaian::create($validatedData);
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
]);
|
||||
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
} catch (Exception $e) {
|
||||
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create($id)
|
||||
{
|
||||
return view('lpj::penilaian.form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(PenilaianRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
try {
|
||||
$penilaian = Penilaian::where('nomor_registrasi', $request->nomor_registrasi)->firstOrFail();
|
||||
$penilaian->update($validate);
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
]);
|
||||
|
||||
return redirect()->route('penilaian.index', $id)->with('success', 'Penilaian berhasil diubah');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('penilaian.index', $id)->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function assignment($id)
|
||||
{
|
||||
$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();
|
||||
|
||||
$penilaian = Penilaian::where('nomor_registrasi', $permohonan->nomor_registrasi)->first();
|
||||
|
||||
return view('lpj::penilaian.form', compact('permohonan', 'teamPenilai', 'jenisPenilaian', 'penilaian'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
|
||||
public function revisi(PenilaianRequest $request, $nomor_registrasi)
|
||||
{
|
||||
$validatedData = $request->validated();
|
||||
if ($validatedData) {
|
||||
|
||||
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')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Permohonan::query();
|
||||
|
||||
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 . '%');
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereRaw('LOWER(status) = ?', ['register']);
|
||||
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
$totalRecords = $query->count();
|
||||
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
$filteredRecords = $query->count();
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getUserTeams($id)
|
||||
{
|
||||
$teamsUser = TeamsUsers::where('teams_id', $id)->get();
|
||||
$userIds = $teamsUser->pluck('user_id');
|
||||
$users = User::whereIn('id', $userIds)
|
||||
->with('roles')
|
||||
->get();
|
||||
|
||||
|
||||
if ($users->isNotEmpty()) {
|
||||
return response()->json($users, 200);
|
||||
}
|
||||
|
||||
return response()->json([], 200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
164
app/Http/Controllers/RegionController.php
Normal file
164
app/Http/Controllers/RegionController.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Lpj\Http\Requests\RegionRequest;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\RegionExport;
|
||||
|
||||
|
||||
class RegionController extends Controller
|
||||
{
|
||||
public $user;
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::region.index');
|
||||
}
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::region.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(RegionRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Regions::create($validate);
|
||||
return redirect()
|
||||
->route('basicdata.region.index')
|
||||
->with('success', 'region created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.region.create')
|
||||
->with('error', 'Failed to create region');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$region = Regions::find($id);
|
||||
return view('lpj::region.create', compact('region'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(RegionRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$region = Regions::find($id);
|
||||
$region->update($validate);
|
||||
return redirect()
|
||||
->route('basicdata.region.index')
|
||||
->with('success', 'Region updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.region.edit', $id)
|
||||
->with('error', 'Failed to update region');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// Delete from database
|
||||
$region = Regions::find($id);
|
||||
$region->delete();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Region deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete region']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
|
||||
if (is_null($this->user) || !$this->user->can('region.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Regions::query();
|
||||
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
if($request->has('sortOrder') && !empty($request->get('sortOrder'))){
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
$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->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// dump($data);
|
||||
|
||||
// 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 RegionExport, 'region.xlsx');
|
||||
}
|
||||
}
|
||||
260
app/Http/Controllers/TeamsController.php
Normal file
260
app/Http/Controllers/TeamsController.php
Normal file
@@ -0,0 +1,260 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Lpj\Http\Requests\TeamsRequest;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Exports\TeamPenilaianExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class TeamsController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::teams.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
|
||||
// cek region apakah sudah ada di tabel teams
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
$region = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
|
||||
// cek user apakah sudah ada di tabel teams_users
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $userTeam)
|
||||
->with('roles')
|
||||
->get();
|
||||
|
||||
return view('lpj::teams.form', compact('region', 'user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(TeamsRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$teams = Teams::create($validate);
|
||||
|
||||
$users = $request->input('user', []);
|
||||
|
||||
// loop untuk insert data users ke tabel teams_users
|
||||
foreach ($users as $user) {
|
||||
TeamsUsers::create([
|
||||
'teams_id' => $teams->id,
|
||||
'user_id' => $user
|
||||
]);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.teams.index')
|
||||
->with('success', 'Data saved successfully. ');
|
||||
} catch (Exception $e) {
|
||||
|
||||
DB::rollBack();
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.teams.create')
|
||||
->with('error', 'Failed to save data. ');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('lpj::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$teams = Teams::find($id);
|
||||
|
||||
|
||||
$region = Regions::all();
|
||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $usedUsers)
|
||||
->with('roles')
|
||||
->get();
|
||||
// Ambil user yang sudah ada di tim ini
|
||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||
|
||||
return view('lpj::teams.form', compact('teams', 'region', 'user', 'selectedUsers'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(TeamsRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$teams = Teams::findOrFail($id);
|
||||
|
||||
// Update data tim
|
||||
$teams->update($validate);
|
||||
$userIds = $request->input('user', []);
|
||||
|
||||
$teams->teamsUsers()->delete();
|
||||
|
||||
|
||||
foreach ($userIds as $userId) {
|
||||
TeamsUsers::create([
|
||||
'teams_id' => $teams->id,
|
||||
'user_id' => $userId
|
||||
]);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.teams.index')
|
||||
->with('success', 'Data updated successfully. ');
|
||||
} catch (Exception $e) {
|
||||
|
||||
DB::rollBack();
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.teams.create')
|
||||
->with('error', 'Failed to update data. ');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
|
||||
$teams = Teams::findOrFail($id);
|
||||
$teams->teamsUsers()->delete();
|
||||
|
||||
// Hapus tim
|
||||
$teams->delete();
|
||||
|
||||
DB::commit();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Team has been deleted successfully']);
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete Team']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('teams.view')) {
|
||||
//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')
|
||||
->join('regions', 'teams.regions_id', '=', 'regions.id')
|
||||
->leftJoin('teams_users', 'teams.id', '=', 'teams_users.teams_id')
|
||||
->leftJoin('users', 'teams_users.user_id', '=', 'users.id')
|
||||
->addSelect('users.id as user_id', 'users.name as user_name');
|
||||
|
||||
// Filter pencarian
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('teams.name', 'LIKE', "%$search%")
|
||||
->orWhere('regions.name', 'LIKE', "%$search%")
|
||||
->orWhere('users.name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination
|
||||
$size = $request->get('size', 10);
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
// Ambil data dengan pagination
|
||||
$data = $query->skip($offset)->take($size)->get();
|
||||
$filteredRecords = $data->count();
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil ID pengguna dari hasil query
|
||||
$userIds = $data->pluck('user_id')->unique();
|
||||
|
||||
// Ambil data pengguna dengan peran mereka
|
||||
$users = User::whereIn('id', $userIds)
|
||||
->with('roles')
|
||||
->get()
|
||||
->keyBy('id');
|
||||
|
||||
// Format data
|
||||
$formattedData = $data->groupBy('id')->map(function ($group) use ($users) {
|
||||
$team = $group->first();
|
||||
$team->user_team = $group->map(function ($item) use ($users) {
|
||||
$user = $users->get($item->user_id);
|
||||
return [
|
||||
'nama' => $item->user_name,
|
||||
'roles' => $user ? $user->roles->pluck('name')->toArray() : [],
|
||||
];
|
||||
})->toArray();
|
||||
return $team;
|
||||
})->values();
|
||||
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $page,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $formattedData
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new TeamPenilaianExport(), 'team-penilai.xlsx');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
41
app/Http/Requests/JenisPenilaianRequest.php
Normal file
41
app/Http/Requests/JenisPenilaianRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class JenisPenilaianRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|boolean',
|
||||
'authorized_at' => 'nullable|datetime',
|
||||
'authorized_status' => 'nullable|string|max:1',
|
||||
'authorized_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
|
||||
$rules['code'] = 'required|string|max:3|unique:jenis_penilaian,code,' . $this->id;
|
||||
|
||||
} else {
|
||||
$rules['code'] = 'required|string|max:3|unique:jenis_penilaian,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
59
app/Http/Requests/PenilaianRequest.php
Normal file
59
app/Http/Requests/PenilaianRequest.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PenilaianRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
|
||||
$action = $this->input('action');
|
||||
|
||||
if ($action === 'revisi') {
|
||||
return [
|
||||
'dokumen' => 'required|file|mimes:pdf',
|
||||
'keterangan' => 'required|string',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'jenis_penilaian_id' => 'required|max:255',
|
||||
'teams_id' => 'required|max:255',
|
||||
'tanggal_kunjungan' => 'required|max:255',
|
||||
'status' => 'required|string',
|
||||
'nomor_registrasi' => 'required|string',
|
||||
'surveyor_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||
'penilaian_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||
'penilai_surveyor_id' => 'nullable|required_without_all:surveyor_id,penilaian_id',
|
||||
'keterangan' => 'nullable',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
// Menetapkan nilai default untuk 'status' jika tidak ada dalam request
|
||||
$this->merge([
|
||||
'status' => $this->status ?? 'assign',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@
|
||||
'status' => 'required|string',
|
||||
'jenis_fasilitas_kredit_id' => 'required|exists:jenis_fasilitas_kredit,id',
|
||||
'nilai_plafond_id' => 'required|exists:nilai_plafond,id',
|
||||
'status_bayar' => 'required|string',
|
||||
'nilai_njop' => 'nullable|numeric'
|
||||
];
|
||||
|
||||
return $rules;
|
||||
|
||||
38
app/Http/Requests/RegionRequest.php
Normal file
38
app/Http/Requests/RegionRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RegionRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|boolean',
|
||||
'authorized_at' => 'nullable|datetime',
|
||||
'authorized_status' => 'nullable|string|max:1',
|
||||
'authorized_by' => 'nullable|exists:users,id',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|string|max:3|unique:regions,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|string|max:3|unique:regions,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
$rules = [
|
||||
'description' => 'nullable|max:255',
|
||||
'status' => 'required|boolean',
|
||||
'slug' => 'nullable|max:255',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
@@ -37,9 +38,9 @@
|
||||
|
||||
public function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
return $this->merge([
|
||||
'status' => isset($this->status) ? 1 : 0,
|
||||
'slug'=> Str::slug($this->name)
|
||||
'slug' => Str::slug($this->name),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
41
app/Http/Requests/TeamsRequest.php
Normal file
41
app/Http/Requests/TeamsRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TeamsRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'status' => 'nullable|boolean',
|
||||
'regions_id' => 'required|nullable|exists:regions,id',
|
||||
'user.*' => 'nullable|exists:users,id',
|
||||
'authorized_at' => 'nullable|datetime',
|
||||
'authorized_status' => 'nullable|string|max:1',
|
||||
'authorized_by' => 'nullable|exists:users,id',
|
||||
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|string|max:3|unique:teams,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|string|max:3|unique:teams,code';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
25
app/Models/JenisPenilaian.php
Normal file
25
app/Models/JenisPenilaian.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Database\Factories\JenisPenilaianFactory;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
class JenisPenilaian extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'jenis_penilaian';
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name', 'status', 'authorized_status', 'authorized_at', 'authorized_by',
|
||||
'created_at', 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class , 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
56
app/Models/Penilaian.php
Normal file
56
app/Models/Penilaian.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PenilaianFactory;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
|
||||
class Penilaian extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
protected $fillable = [
|
||||
'jenis_penilaian_id', 'teams_id', 'user_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi','penilaian_id','surveyor_id','penilai_surveyor_id',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function jenis_penilaian(){
|
||||
return $this->belongsTo(JenisPenilaian::class, 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function teams(){
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function users(){
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function userPenilai(){
|
||||
return $this->belongsTo(User::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function userSurveyor(){
|
||||
return $this->belongsTo(User::class, 'surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function userPenilaiSurveyor(){
|
||||
return $this->belongsTo(User::class, 'penilai_surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PermohonanFactory;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Modules\Lpj\Models\TujuanPenilaian;
|
||||
use Modules\Lpj\Models\JenisFasilitasKredit;
|
||||
|
||||
class Permohonan extends Base
|
||||
{
|
||||
@@ -18,13 +20,15 @@ class Permohonan extends Base
|
||||
'tujuan_penilaian_id',
|
||||
'debiture_id',
|
||||
'keterangan',
|
||||
'dokumen',
|
||||
'jenis_fasilitas_kredit_id',
|
||||
'nilai_plafond_id',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by',
|
||||
|
||||
'status_bayar',
|
||||
'nilai_njop'
|
||||
];
|
||||
|
||||
public function user(){
|
||||
@@ -54,4 +58,8 @@ class Permohonan extends Base
|
||||
public function jenisFasilitasKredit(){
|
||||
return $this->belongsTo(JenisFasilitasKredit::class);
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
}
|
||||
|
||||
26
app/Models/Regions.php
Normal file
26
app/Models/Regions.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\RegionsFactory;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
|
||||
class Regions extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'regions';
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name', 'status', 'authorized_status', 'authorized_at', 'authorized_by'
|
||||
];
|
||||
|
||||
public function teams(){
|
||||
return $this->hasMany(Teams::class, 'regions_id', 'id');
|
||||
}
|
||||
}
|
||||
40
app/Models/Teams.php
Normal file
40
app/Models/Teams.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TeamsFactory;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
|
||||
|
||||
class Teams extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'teams';
|
||||
protected $fillable = [
|
||||
'regions_id', 'code', 'name', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function regions(){
|
||||
return $this->belongsTo(Regions::class, 'regions_id', 'id');
|
||||
}
|
||||
|
||||
public function teamsUsers(){
|
||||
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
33
app/Models/TeamsUsers.php
Normal file
33
app/Models/TeamsUsers.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Database\Factories\TeamsUsersFactory;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
|
||||
class TeamsUsers extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'teams_users';
|
||||
protected $fillable = [
|
||||
'teams_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('regions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->char('status')->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('regions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jenis_penilaian', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->char('status')->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jenis_penilaian');
|
||||
}
|
||||
};
|
||||
41
database/migrations/2024_09_05_030405_create_teams_table.php
Normal file
41
database/migrations/2024_09_05_030405_create_teams_table.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('teams', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Regions::class)->constrained()->onDelete('cascade');
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->char('status')->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('teams');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Users;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('teams_users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Teams::class)->constrained()->onDelete('cascade');
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->boolean('status')->default(true)->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('teams_users');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('penilaian', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(JenisPenilaian::class);
|
||||
$table->foreignIdFor(Teams::class);
|
||||
$table->datetime('tanggal_kunjungan');
|
||||
$table->text('keterangan')->nullable();
|
||||
$table->string('status')->nullable();
|
||||
$table->string('nomor_registrasi')->references('nomor_registrasi')->on(Permohonan::class)->nullable();
|
||||
$table->integer('penilaian_id')->nullable();
|
||||
$table->integer('surveyor_id')->nullable();
|
||||
$table->integer('penilai_surveyor_id')->nullable();
|
||||
$table->timestamps();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->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('penilaian');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->enum('status_bayar',['sudah_bayar','belum_bayar'])->default('sudah_bayar');
|
||||
$table->string('nilai_njop')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->dropColumn('status_bayar');
|
||||
$table->dropColumn('nilai_njop');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->string('dokumen')->nullable()->after('status');
|
||||
$table->string('keterangan')->nullable()->after('dokumen');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->dropColumn('dokumen');
|
||||
$table->dropColumn('keterangan');
|
||||
});
|
||||
}
|
||||
};
|
||||
40
module.json
40
module.json
@@ -211,6 +211,46 @@
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
},
|
||||
{
|
||||
"title": "Region",
|
||||
"path": "basicdata.region",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
},
|
||||
{
|
||||
"title": "Staff Appraisal",
|
||||
"path": "basicdata.teams",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
},
|
||||
{
|
||||
"title": "Jenis Penilaian",
|
||||
"path": "basicdata.jenis-penilaian",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
},
|
||||
{
|
||||
"title": "KJPP",
|
||||
"path": "basicdata.kjpp",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
},
|
||||
{
|
||||
"title": "Ijin Usaha",
|
||||
"path": "basicdata.ijin_usaha",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
120
resources/views/activity/activitydetail.blade.php
Normal file
120
resources/views/activity/activitydetail.blade.php
Normal file
@@ -0,0 +1,120 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.border-l-primary {
|
||||
border-left-color: #0d6efd !important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header" id="advanced_settings_appearance">
|
||||
<h3 class="card-title">
|
||||
Activity Permohonan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('activity.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card grow" id="activity_2024">
|
||||
<div class="card-header">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Status Activity
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex flex-col">
|
||||
@foreach ($status_permohonan as $index => $status)
|
||||
{{-- Cek apakah status adalah "Revisi" dan status permohonan tidak sama, maka tidak ditampilkan --}}
|
||||
@if (strtolower($status->name) == 'revisi' && strtolower($status->name) != strtolower($permohonan->status))
|
||||
@continue
|
||||
@endif
|
||||
|
||||
<div class="flex items-start relative">
|
||||
@if ($index < count($status_permohonan) - 1)
|
||||
<div
|
||||
class="w-9 left-0 top-9 absolute bottom-0 translate-x-1/2
|
||||
{{ strtolower($status->name) == strtolower($permohonan->status) ? 'border-l border-l-primary' : 'border-l border-l-gray-300' }}">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div
|
||||
class="flex items-center justify-center shrink-0 rounded-full
|
||||
{{ strtolower($status->name) == strtolower($permohonan->status) ? ' btn-outline btn-primary' : 'bg-gray-100 border-gray-300 text-gray-600' }}
|
||||
size-9">
|
||||
@switch(strtolower($status->name))
|
||||
@case('order')
|
||||
<i class="ki-filled ki-handcart text-base"></i>
|
||||
@break
|
||||
|
||||
@case('revisi')
|
||||
<i class="ki-filled ki-notepad-edit text-base"></i>
|
||||
@break
|
||||
|
||||
@case('register')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
|
||||
@case('assign')
|
||||
<i class="ki-filled ki-file-added"></i>
|
||||
@break
|
||||
|
||||
@case('survey')
|
||||
<i class="ki-filled ki-map text-base"></i>
|
||||
@break
|
||||
|
||||
@default
|
||||
<i class="ki-filled ki-people text-base"></i>
|
||||
@endswitch
|
||||
|
||||
</div>
|
||||
@include('lpj::activity.components.status')
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer justify-center">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
94
resources/views/activity/components/status.blade.php
Normal file
94
resources/views/activity/components/status.blade.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<div class="pl-2.5 mb-7 text-md grow">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-sm text-gray-800">
|
||||
{{ $status->name . ' ' . $status->description }}
|
||||
</div>
|
||||
<span class="text-xs text-gray-600">
|
||||
@if (strtolower($status->name) == 'order')
|
||||
{{ $permohonan->created_at }}
|
||||
@elseif (strtolower($status->name) == strtolower($permohonan->status))
|
||||
{{ $permohonan->updated_at }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$isCurrentStatus = strtolower($status->name) == strtolower($permohonan->status);
|
||||
$hasKeterangan = isset($permohonan->keterangan);
|
||||
@endphp
|
||||
|
||||
{{-- Tampilkan keterangan jika status 'register' --}}
|
||||
@if (strtolower($status->name) == 'register' && $hasKeterangan && $isCurrentStatus)
|
||||
<div class="card shadow-none">
|
||||
<div class="card-body">
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Tampilkan dokumen dan keterangan jika status 'revisi' --}}
|
||||
@if (strtolower($status->name) == 'revisi' && $hasKeterangan)
|
||||
<div class="card shadow-none">
|
||||
<div class="card-body">
|
||||
<a href="{{ route('activity.download', $permohonan->id) }}" class="badge badge-sm badge-outline">
|
||||
{{ basename($permohonan->dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
<p class="text-xs text-gray-800 leading-[22px]">
|
||||
{{ $permohonan->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Tampilkan informasi assign jika status 'assign' --}}
|
||||
@if (strtolower($status->name) == 'assign' && $isCurrentStatus)
|
||||
<div class="card shadow-none">
|
||||
<div class="card-body grid grid-cols-3 gap-5">
|
||||
{{-- Informasi Penilai, Surveyor, dan Penilai Surveyor --}}
|
||||
<div>
|
||||
@isset($permohonan->penilaian)
|
||||
@if ($penilai = $permohonan->penilaian->userPenilai->name ?? null)
|
||||
<div class="mb-3">
|
||||
<p class="text-md font-medium text-gray-900">Penilai:</p>
|
||||
<span class="text-2sm text-gray-700">{{ $penilai }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($surveyor = $permohonan->penilaian->userSurveyor->name ?? null)
|
||||
<div class="mb-3">
|
||||
<p class="text-md font-medium text-gray-900">Surveyor:</p>
|
||||
<span class="text-2sm text-gray-700">{{ $surveyor }}</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($penilaiSurveyor = $permohonan->penilaian->userPenilaiSurveyor->name ?? null)
|
||||
<div class="mb-3">
|
||||
<p class="text-md font-medium text-gray-900">Penilai Surveyor:</p>
|
||||
<span class="text-2sm text-gray-700">{{ $penilaiSurveyor }}</span>
|
||||
</div>
|
||||
@endif
|
||||
@endisset
|
||||
</div>
|
||||
|
||||
{{-- Teams --}}
|
||||
<div>
|
||||
<h3 class="text-md font-medium text-gray-900">Teams:</h3>
|
||||
<ul>
|
||||
@foreach ($permohonan->penilaian->teams->teamsUsers as $item)
|
||||
<li class="text-xs text-gray-800 leading-[22px]">{{ $item->user->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{-- Catatan --}}
|
||||
<div>
|
||||
<h3 class="text-md font-medium text-gray-900">Catatan:</h3>
|
||||
<span class="text-2sm text-gray-700">{{ $permohonan->penilaian->keterangan }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
211
resources/views/activity/index.blade.php
Normal file
211
resources/views/activity/index.blade.php
Normal file
@@ -0,0 +1,211 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection
|
||||
@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">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Activity
|
||||
</div>
|
||||
<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 Penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<select class="select select-sm w-28" name="select" id="status-filter">
|
||||
<option value="">Pilih Status</option>
|
||||
@foreach ($status_permohonan as $item)
|
||||
<option value="{{ strtolower($item->name) }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</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('activity.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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('activity.datatables') }}">
|
||||
|
||||
<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
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const statusFilter = document.getElementById('status-filter'); // Dropdown filter element
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
} // Default order by 'nomor_registrasi' ascending
|
||||
],
|
||||
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) => `${data.user.name}`,
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => `${data.branch.name}`,
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => `${data.debiture.name}`,
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => `${data.tujuan_penilaian.name}`,
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = '';
|
||||
switch (data.status.toLowerCase()) {
|
||||
case 'revisi':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-warning';
|
||||
break;
|
||||
case 'order':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-info';
|
||||
break;
|
||||
case 'register':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-success';
|
||||
break;
|
||||
case 'survey':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-primary';
|
||||
break;
|
||||
case 'assign':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-dark';
|
||||
break;
|
||||
default:
|
||||
badgeClass = 'badge badge-pill badge-outline';
|
||||
}
|
||||
|
||||
return `<span class="badge ${badgeClass}">${data.status}</span>`;
|
||||
},
|
||||
},
|
||||
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="activity/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
</div>`,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
statusFilter.addEventListener('change', function() {
|
||||
const selectedStatus = this.value;
|
||||
dataTable.search(selectedStatus);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -59,7 +59,7 @@
|
||||
@if(isset($document->id))
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ $document->jenis_jaminan_id }}">
|
||||
@endif
|
||||
<select onchange="getLegalitasJaminan()" {{ isset($document->id) ? "disabled" : "" }} class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
|
||||
<select onchange="getLegalitasJaminan()" class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
|
||||
<option value="">Pilih Jenis Jaminan</option>
|
||||
@foreach($jenisJaminan as $row)
|
||||
@if(isset($document))
|
||||
|
||||
64
resources/views/jenis_penilaian/form.blade.php
Normal file
64
resources/views/jenis_penilaian/form.blade.php
Normal file
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<form
|
||||
action="{{ isset($jenisPenilaian->id) ? route('basicdata.jenis-penilaian.update', $jenisPenilaian->id) : route('basicdata.jenis-penilaian.store') }}"
|
||||
method="POST">
|
||||
|
||||
@if (isset($jenisPenilaian->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $jenisPenilaian->id }}">
|
||||
@endif
|
||||
|
||||
@csrf
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisPenilaian->id) ? 'Edit' : 'Tambah' }} jenis penilaian
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-penilaian.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $jenisPenilaian->code ?? '' }}">
|
||||
@error('code')
|
||||
<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">
|
||||
Name
|
||||
</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="{{ $jenisPenilaian->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
160
resources/views/jenis_penilaian/index.blade.php
Normal file
160
resources/views/jenis_penilaian/index.blade.php
Normal file
@@ -0,0 +1,160 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-penilaian') }}
|
||||
@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="jenis-penilaian-table"
|
||||
data-api-url="{{ route('basicdata.jenis-penilaian.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis 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 jenis 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.jenis-penilaian.export') }}"> Export to
|
||||
Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-penilaian.create') }}"> Tambah
|
||||
Jenis penilaian </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto max-h-[500px] overflow-y-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-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis penilaian </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>
|
||||
@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/jenis-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('#jenis-penilaian-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();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'jenis-penilaian',
|
||||
},
|
||||
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/jenis-penilaian/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></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
|
||||
@@ -70,24 +70,34 @@
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline 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('name') border-danger bg-danger-light @enderror" type="text " id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
|
||||
@error('name')
|
||||
<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 ID/KTP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}">
|
||||
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
|
||||
@error('nomor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nama_sertifikat">
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<button type="button" id="tambah_sertifikat" class="btn btn-primary btn-xs">Tambah Nama di Sertifikat</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -242,3 +252,43 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.getElementById('tambah_sertifikat').addEventListener('click', function() {
|
||||
const namaSertifikatDiv = document.getElementById('nama_sertifikat');
|
||||
const newDiv = document.createElement('div');
|
||||
newDiv.innerHTML = `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Lengkap
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline 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('name') border-danger bg-danger-light @enderror" type="text" id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
|
||||
@error('nomor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
namaSertifikatDiv.appendChild(newDiv);
|
||||
|
||||
// Event listener untuk tombol hapus
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
namaSertifikatDiv.removeChild(newDiv);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
617
resources/views/penilaian/form.blade.php
Normal file
617
resources/views/penilaian/form.blade.php
Normal file
@@ -0,0 +1,617 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card">
|
||||
<div class="card-header" id="advanced_settings_appearance">
|
||||
<h3 class="card-title">
|
||||
Data Permohonan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('penilaian.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemohon:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Detail Debutur
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
|
||||
<div class="col-span-1">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal">
|
||||
Name
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
Email
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->email ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
Phone
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->phone ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Address
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->address ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->village->name ?? '' }},
|
||||
{{ $permohonan->debiture->district->name ?? '' }},
|
||||
{{ $permohonan->debiture->city->name ?? '' }},
|
||||
{{ $permohonan->debiture->province->name ?? '' }} -
|
||||
{{ $permohonan->debiture->village->postal_code ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-span-1">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Cabang
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->branch->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
CIF
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->cif ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Nomor Rekening
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->nomor_rekening ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3">
|
||||
NPWP
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $permohonan->debiture->npwp ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Data Jaminan
|
||||
</h3>
|
||||
</div>
|
||||
<div data-accordion="true">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
|
||||
id="accordion_1_item_1">
|
||||
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
|
||||
<span class="text-base text-gray-900 font-medium">
|
||||
Jaminan {{ $loop->index + 1 }}
|
||||
</span>
|
||||
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
||||
</i>
|
||||
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
|
||||
</i>
|
||||
</button>
|
||||
<div class="accordion-content hidden" id="accordion_1_content_1">
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-2">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Jenis Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->jenisJaminan->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Hubungan Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Alamat Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->address ?? '' }},
|
||||
<br> {{ $dokumen->pemilik->village->name ?? '' }},
|
||||
{{ $dokumen->pemilik->district->name ?? '' }},
|
||||
{{ $dokumen->pemilik->city->name ?? '' }},
|
||||
{{ $dokumen->pemilik->province->name ?? '' }} -
|
||||
{{ $dokumen->pemilik->village->postal_code ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
|
||||
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
Dokumen Jaminan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
|
||||
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
|
||||
<i class="ki-filled ki-cloud-download"></i></a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
Keterangan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $detail->keterangan ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Form Assignment
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form
|
||||
action="{{ isset($penilaian->nomor_registrasi) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}"
|
||||
method="POST" class="">
|
||||
@if (isset($penilaian->nomor_registrasi))
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
<div class="pl-1 grid gap-2.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>
|
||||
<input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
||||
name="jenis_penilaian_id" id="jenis_penilaian_id">
|
||||
<option value="">Jenis Penilaian</option>
|
||||
|
||||
@foreach ($jenisPenilaian as $item)
|
||||
@if (isset($penilaian->nomor_registrasi))
|
||||
<option value="{{ $item->id }}"
|
||||
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@else
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('jenis_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('teams_id') border-danger bg-danger-light @enderror"
|
||||
name="teams_id" id="teams_id">
|
||||
<option value="">Pilih Tim Penilai</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
@if (isset($penilaian->nomor_registrasi))
|
||||
<option value="{{ $item->id }}"
|
||||
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->regions->name }}</option>
|
||||
@else
|
||||
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@error('teams_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">
|
||||
Surveyor yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="input select @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
</select>
|
||||
|
||||
@error('surveyor_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">
|
||||
<select id="penilaian_id" name="penilaian_id"
|
||||
class="input select @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
</select>
|
||||
@error('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">
|
||||
Surveyor dan penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input select @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
</select>
|
||||
@error('penilai_surveyor_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">
|
||||
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="datetime-local" name="tanggal_kunjungan"
|
||||
value="{{ isset($penilaian->tanggal_kunjungan) ? \Carbon\Carbon::createFromTimestamp($penilaian->tanggal_kunjungan)->format('Y-m-d\TH:i') : '' }}">
|
||||
@error('tanggal_kunjungan')
|
||||
<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">
|
||||
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">{{ $penilaian->keterangan ?? '' }}</textarea>
|
||||
</div>
|
||||
@error('keterangan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end card-footer mt-2">
|
||||
<button type="submit" class="btn btn-success">
|
||||
Aprove
|
||||
</button>
|
||||
|
||||
<button type="button" data-modal-toggle="#modal_revisi" class="btn btn-warning ml-3">
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal_revisi" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Revisi</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form
|
||||
action="{{ route('penilaian.revisi', $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi) }}"
|
||||
method="POST" enctype="multipart/form-data" id="revisiForm">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<input type="hidden" name="action" value="revisi">
|
||||
<input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Dokumen Revisi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input id="dokumen"
|
||||
class="file-input @error('dokumen') border-danger bg-danger-light @enderror"
|
||||
type="file" name="dokumen">
|
||||
@error('dokumen')
|
||||
<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">Catatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea id="keterangan" class="textarea @error('keterangan') border-danger bg-danger-light @enderror"
|
||||
rows="3" name="keterangan"></textarea>
|
||||
@error('keterangan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let teamsSelect = document.getElementById('teams_id');
|
||||
let penilaiSelect = document.getElementById('penilaian_id');
|
||||
let surveyorSelect = document.getElementById('surveyor_id');
|
||||
let penilaiSurveyorSelect = document.getElementById('penilai_surveyor_id');
|
||||
|
||||
let selectedSurveyorId = @json($penilaian->surveyor_id ?? null);
|
||||
let selectedPenilaiId = @json($penilaian->penilaian_id ?? null);
|
||||
let selectedPenilaiSurveyorId = @json($penilaian->penilai_surveyor_id ?? null);
|
||||
|
||||
function fetchPenilai(teamId) {
|
||||
penilaiSelect.innerHTML = '<option value="">Pilih Penilai</option>';
|
||||
surveyorSelect.innerHTML = '<option value="">Pilih Surveyor</option>';
|
||||
penilaiSurveyorSelect.innerHTML = '<option value="">Pilih Penilai Surveyor</option>';
|
||||
|
||||
if (teamId) {
|
||||
fetch(`/penilaian/getUserTeams/${teamId}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((user) => {
|
||||
let optionPenilai = document.createElement('option');
|
||||
let optionSurveyor = document.createElement('option');
|
||||
let optionPenilaiSurveyor = document.createElement('option');
|
||||
|
||||
optionPenilai.value = user.id;
|
||||
optionSurveyor.value = user.id;
|
||||
optionPenilaiSurveyor.value = user.id;
|
||||
|
||||
optionPenilai.text = user.name;
|
||||
optionSurveyor.text = user.name;
|
||||
optionPenilaiSurveyor.text = user.name;
|
||||
|
||||
// Tambahkan pengguna ke semua select
|
||||
penilaiSelect.appendChild(optionPenilai);
|
||||
surveyorSelect.appendChild(optionSurveyor);
|
||||
penilaiSurveyorSelect.appendChild(optionPenilaiSurveyor);
|
||||
|
||||
if (selectedPenilaiId && selectedPenilaiId == user.id) {
|
||||
optionPenilai.selected = true;
|
||||
}
|
||||
if (selectedSurveyorId && selectedSurveyorId == user.id) {
|
||||
optionSurveyor.selected = true;
|
||||
}
|
||||
if (selectedPenilaiSurveyorId && selectedPenilaiSurveyorId == user
|
||||
.id) {
|
||||
optionPenilaiSurveyor.selected = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let noUserOption = document.createElement('option');
|
||||
noUserOption.value = '';
|
||||
noUserOption.text = 'Tidak ada pengguna yang sesuai.';
|
||||
penilaiSelect.appendChild(noUserOption);
|
||||
surveyorSelect.appendChild(noUserOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(noUserOption.cloneNode(true));
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching team members:', error);
|
||||
let errorOption = document.createElement('option');
|
||||
errorOption.value = '';
|
||||
errorOption.text = 'Terjadi kesalahan.';
|
||||
penilaiSelect.appendChild(errorOption);
|
||||
surveyorSelect.appendChild(errorOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(errorOption.cloneNode(true));
|
||||
});
|
||||
} else {
|
||||
let defaultOption = document.createElement('option');
|
||||
defaultOption.value = '';
|
||||
defaultOption.text = 'Pilih tim terlebih dahulu.';
|
||||
penilaiSelect.appendChild(defaultOption);
|
||||
surveyorSelect.appendChild(defaultOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(defaultOption.cloneNode(true));
|
||||
}
|
||||
}
|
||||
|
||||
teamsSelect.addEventListener('change', function() {
|
||||
let teamId = this.value;
|
||||
fetchPenilai(teamId);
|
||||
});
|
||||
|
||||
let selectedTeamId = teamsSelect.value;
|
||||
if (selectedTeamId) {
|
||||
fetchPenilai(selectedTeamId);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const revisiForm = document.getElementById('revisiForm');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
|
||||
btnSubmit.addEventListener('click', function(event) {
|
||||
// Cegah form dari pengiriman default
|
||||
event.preventDefault();
|
||||
|
||||
// Ambil nilai dari input dan textarea
|
||||
const dokumenRevisi = document.getElementById('dokumen').value;
|
||||
const keteranganRevisi = document.getElementById('keterangan').value.trim();
|
||||
|
||||
// Bersihkan pesan kesalahan sebelumnya
|
||||
document.querySelectorAll('.alert.text-danger').forEach(el => el.remove());
|
||||
|
||||
// Validasi: jika ada field kosong, tampilkan pesan kesalahan
|
||||
let isValid = true;
|
||||
|
||||
if (!dokumenRevisi) {
|
||||
const errorMessage = document.createElement('em');
|
||||
errorMessage.className = 'alert text-danger text-sm';
|
||||
errorMessage.innerText = 'Dokumen Revisi harus diisi.';
|
||||
document.getElementById('dokumen').parentElement.appendChild(errorMessage);
|
||||
isValid = false; // Set isValid ke false
|
||||
}
|
||||
|
||||
if (!keteranganRevisi) {
|
||||
const errorMessage = document.createElement('em');
|
||||
errorMessage.className = 'alert text-danger text-sm';
|
||||
errorMessage.innerText = 'Catatan harus diisi.';
|
||||
document.getElementById('keterangan').parentElement.appendChild(errorMessage);
|
||||
isValid = false; // Set isValid ke false
|
||||
}
|
||||
|
||||
// Jika semua field valid, kirim form
|
||||
if (isValid) {
|
||||
revisiForm.submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
169
resources/views/penilaian/index.blade.php
Normal file
169
resources/views/penilaian/index.blade.php
Normal file
@@ -0,0 +1,169 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('penilaian') }}
|
||||
@endsection
|
||||
|
||||
@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">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Daftar Penilaian
|
||||
</div>
|
||||
<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 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('permohonan.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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('penilaian.datatables') }}">
|
||||
|
||||
<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
|
||||
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></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-warning " href="penilaian/${data.id}/assignment">
|
||||
<i class="ki-outline ki-eye"></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
|
||||
@@ -128,6 +128,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="sudah_bayar" ? 'selected' : '' }} value="sudah_bayar">Sudah Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="belum_bayar" ? 'selected' : '' }} value="belum_bayar">Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
<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 NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
@error('nilai_njop')
|
||||
<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">
|
||||
Status Permohonan
|
||||
@@ -282,6 +310,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar">Sudah Bayar</option>
|
||||
<option value="belum_bayar">Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
<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 NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
@error('nilai_njop')
|
||||
<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">
|
||||
Status Permohonan
|
||||
|
||||
61
resources/views/region/create.blade.php
Normal file
61
resources/views/region/create.blade.php
Normal file
@@ -0,0 +1,61 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (isset($region->id))
|
||||
<form action="{{ route('basicdata.region.update', $region->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $region->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.region.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($region->id) ? 'Edit' : 'Tambah' }} region
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.region.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $region->code ?? '' }}">
|
||||
@error('code')
|
||||
<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">
|
||||
Name
|
||||
</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="{{ $region->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
152
resources/views/region/index.blade.php
Normal file
152
resources/views/region/index.blade.php
Normal file
@@ -0,0 +1,152 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.region') }}
|
||||
@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="region-table" data-api-url="{{ route('basicdata.region.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Region
|
||||
</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 region" 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.region.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.region.create') }}"> Tambah Region </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-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Region </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>
|
||||
@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/region/${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('#region-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();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Region',
|
||||
},
|
||||
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/region/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></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
|
||||
|
||||
|
||||
|
||||
128
resources/views/teams/form.blade.php
Normal file
128
resources/views/teams/form.blade.php
Normal file
@@ -0,0 +1,128 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
{{-- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> --}}
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<form action="{{ isset($teams->id) ? route('basicdata.teams.update', $teams->id) : route('basicdata.teams.store') }}"
|
||||
method="POST">
|
||||
|
||||
@if (isset($teams->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $teams->id }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($teams->id) ? 'Edit' : 'Tambah' }} Teams
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.teams.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</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="{{ $teams->name ?? '' }}">
|
||||
@error('name')
|
||||
<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">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $teams->code ?? '' }}">
|
||||
@error('code')
|
||||
<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">Region</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
|
||||
name="regions_id">
|
||||
<option value="">Select Region</option>
|
||||
@if (isset($region))
|
||||
@foreach ($region as $regions)
|
||||
@if (isset($teams))
|
||||
<option value="{{ $regions->id }}"
|
||||
{{ $teams->regions_id == $regions->id ? 'selected' : '' }}>
|
||||
{{ $regions->name }}</option>
|
||||
@else
|
||||
<option value="{{ $regions->id }}">{{ $regions->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('regions_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">Users</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
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>
|
||||
@if (isset($user))
|
||||
@foreach ($user as $users)
|
||||
@if (isset($teams))
|
||||
<option value="{{ $users->id }}"
|
||||
{{ in_array($users->id, $selectedUsers) ? 'selected' : '' }}>
|
||||
{{ $users->name . ' | ' }}
|
||||
@foreach ($users->roles as $role)
|
||||
{{ $role->name }}
|
||||
@endforeach
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||
|
||||
@foreach ($users->roles as $role)
|
||||
{{ $role->name }}
|
||||
@endforeach
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('user')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
176
resources/views/teams/index.blade.php
Normal file
176
resources/views/teams/index.blade.php
Normal file
@@ -0,0 +1,176 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.teams') }}
|
||||
@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="teams-table" data-api-url="{{ route('basicdata.teams.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Teams
|
||||
</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 teams" 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.teams.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.teams.create') }}"> Tambah Teams </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-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Region Name </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Anggota Team </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>
|
||||
@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/teams/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Team 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('#teams-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
|
||||
console.log("API URL:", apiUrl);
|
||||
|
||||
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();
|
||||
},
|
||||
},
|
||||
|
||||
region_name: {
|
||||
title: 'Region Name',
|
||||
render: (item, data) => {
|
||||
return (
|
||||
`<ul>
|
||||
<li>${data.region_name}</li>
|
||||
<li>${data.team_name}</li>
|
||||
</ul>
|
||||
`)
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
user_team: {
|
||||
title: 'User Team',
|
||||
render: (item, data) => {
|
||||
if (data.user_team && data.user_team.length) {
|
||||
return `<ul>${data.user_team.map(user =>
|
||||
`<li>${user.nama} | ${user.roles.join(', ')}</li>`
|
||||
).join('')}</ul>`;
|
||||
} else {
|
||||
return '<ul><li>N/A</li></ul>';
|
||||
}
|
||||
},
|
||||
},
|
||||
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/teams/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></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
|
||||
@@ -229,7 +229,6 @@ Breadcrumbs::for('basicdata.ijin_usaha.edit', function (BreadcrumbTrail $trail)
|
||||
Breadcrumbs::for('debitur', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Debitur', route('debitur.index'));
|
||||
});
|
||||
// End Ijin Usaha
|
||||
|
||||
Breadcrumbs::for('debitur.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('debitur');
|
||||
@@ -291,6 +290,56 @@ Breadcrumbs::for('permohonan.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Data Permohonan');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.region', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Region', route('basicdata.region.index'));
|
||||
});
|
||||
Breadcrumbs::for('basicdata.region.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.region');
|
||||
$trail->push('Tambah Region', route('basicdata.region.create'));
|
||||
});
|
||||
Breadcrumbs::for('basicdata.region.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.region');
|
||||
$trail->push('Edit Region');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.teams', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Team', route('basicdata.teams.index'));
|
||||
});
|
||||
Breadcrumbs::for('basicdata.teams.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.teams');
|
||||
$trail->push('Tambah Team', route('basicdata.teams.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.teams.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.teams');
|
||||
$trail->push('Edit Team');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-penilaian', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Jenis Penilaian', route('basicdata.jenis-penilaian.index'));
|
||||
});
|
||||
Breadcrumbs::for('basicdata.jenis-penilaian.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.jenis-penilaian');
|
||||
$trail->push('Tambah Jenis Penilaian', route('basicdata.jenis-penilaian.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-penilaian.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.jenis-penilaian');
|
||||
$trail->push('Edit Jenis Penilaian');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('penilaian', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Penilaian', route('penilaian.index'));
|
||||
});
|
||||
Breadcrumbs::for('penilaian.assignment', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('penilaian');
|
||||
$trail->push('Assignment');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('authorization.index', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Permohonan', route('authorization.index'));
|
||||
});
|
||||
@@ -300,6 +349,15 @@ Breadcrumbs::for('authorization.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Detail Permohonan');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('activity', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Activity', route('activity.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('activity.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('activity');
|
||||
$trail->push('Activity activity');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('tender', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Tender');
|
||||
});
|
||||
|
||||
172
routes/web.php
172
routes/web.php
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\BranchController;
|
||||
use Modules\Lpj\Http\Controllers\CurrencyController;
|
||||
@@ -9,16 +10,19 @@ use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPenghuniJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\IjinUsahaController;
|
||||
use Modules\Lpj\Http\Controllers\JenisAsetController;
|
||||
use Modules\Lpj\Http\Controllers\JenisDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\JenisFasilitasKreditController;
|
||||
use Modules\Lpj\Http\Controllers\JenisJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLegalitasJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\KJPPController;
|
||||
use Modules\Lpj\Http\Controllers\NilaiPlafondController;
|
||||
use Modules\Lpj\Http\Controllers\PemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\PenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\PermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\RegionController;
|
||||
use Modules\Lpj\Http\Controllers\StatusPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\TenderController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||
|
||||
@@ -75,7 +79,6 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('export', [JenisDokumenController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('jenis-dokumen', JenisDokumenController::class);
|
||||
|
||||
Route::name('currency.')->prefix('mata-uang')->group(function () {
|
||||
Route::get('restore/{id}', [CurrencyController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [CurrencyController::class, 'dataForDatatables'])
|
||||
@@ -147,6 +150,154 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::resource('arah-mata-angin', ArahMataAnginController::class);
|
||||
|
||||
|
||||
Route::name('status-permohonan.')->prefix('status-permohonan')->group(function () {
|
||||
Route::get('restore/{id}', [StatusPermohonanController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [StatusPermohonanController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [StatusPermohonanController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('status-permohonan', StatusPermohonanController::class);
|
||||
|
||||
Route::name('region.')->prefix('region')->group(function () {
|
||||
Route::get('restore/{id}', [RegionController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [RegionController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [RegionController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
|
||||
Route::resource('region', RegionController::class, [
|
||||
'names' => [
|
||||
'index' => 'region.index',
|
||||
'show' => 'region.show',
|
||||
'create' => 'region.create',
|
||||
'store' => 'region.store',
|
||||
'edit' => 'region.edit',
|
||||
'update' => 'region.update',
|
||||
'destroy' => 'region.destroy',
|
||||
],
|
||||
]);
|
||||
|
||||
Route::resource('region', RegionController::class);
|
||||
|
||||
|
||||
Route::name('teams.')->prefix('teams')->group(function () {
|
||||
Route::get('restore/{id}', [TeamsController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [TeamsController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [TeamsController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::resource('teams', TeamsController::class, [
|
||||
'names' => [
|
||||
'index' => 'teams.index',
|
||||
'show' => 'teams.show',
|
||||
'create' => 'teams.create',
|
||||
'store' => 'teams.store',
|
||||
'edit' => 'teams.edit',
|
||||
'update' => 'teams.update',
|
||||
'destroy' => 'teams.destroy',
|
||||
],
|
||||
]);
|
||||
|
||||
Route::name('jenis-penilaian.')->prefix('jenis-penilaian')->group(function () {
|
||||
Route::get('restore/{id}', [JenisPenilaianController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [JenisPenilaianController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [JenisPenilaianController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::resource('jenis-penilaian', JenisPenilaianController::class, [
|
||||
'names' => [
|
||||
'index' => 'jenis-penilaian.index',
|
||||
'show' => 'jenis-penilaian.show',
|
||||
'create' => 'jenis-penilaian.create',
|
||||
'store' => 'jenis-penilaian.store',
|
||||
'edit' => 'jenis-penilaian.edit',
|
||||
'update' => 'jenis-penilaian.update',
|
||||
'destroy' => 'jenis-penilaian.destroy',
|
||||
],
|
||||
]);
|
||||
|
||||
Route::resource('mata-uang', CurrencyController::class, [
|
||||
'names' => [
|
||||
'index' => 'currency.index',
|
||||
'show' => 'currency.show',
|
||||
'create' => 'currency.create',
|
||||
'store' => 'currency.store',
|
||||
'edit' => 'currency.edit',
|
||||
'update' => 'currency.update',
|
||||
'destroy' => 'currency.destroy',
|
||||
],
|
||||
]);
|
||||
|
||||
Route::name('branch.')->prefix('cabang')->group(function () {
|
||||
Route::get('restore/{id}', [BranchController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [BranchController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [BranchController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::resource('cabang', BranchController::class, [
|
||||
'names' => [
|
||||
'index' => 'branch.index',
|
||||
'show' => 'branch.show',
|
||||
'create' => 'branch.create',
|
||||
'store' => 'branch.store',
|
||||
'edit' => 'branch.edit',
|
||||
'update' => 'branch.update',
|
||||
'destroy' => 'branch.destroy',
|
||||
],
|
||||
]);
|
||||
|
||||
Route::name('nilai-plafond.')->prefix('nilai-plafond')->group(function () {
|
||||
Route::get('restore/{id}', [NilaiPlafondController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [NilaiPlafondController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [NilaiPlafondController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('nilai-plafond', NilaiPlafondController::class);
|
||||
|
||||
Route::name('hubungan-pemilik-jaminan.')->prefix('hubungan-pemilik-jaminan')->group(function () {
|
||||
Route::get('restore/{id}', [HubunganPemilikJaminanController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [HubunganPemilikJaminanController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [HubunganPemilikJaminanController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('hubungan-pemilik-jaminan', HubunganPemilikJaminanController::class);
|
||||
|
||||
Route::name('hubungan-penghuni-jaminan.')->prefix('hubungan-penghuni-jaminan')->group(function () {
|
||||
Route::get('restore/{id}', [HubunganPenghuniJaminanController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [HubunganPenghuniJaminanController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [HubunganPenghuniJaminanController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('hubungan-penghuni-jaminan', HubunganPenghuniJaminanController::class);
|
||||
|
||||
Route::name('arah-mata-angin.')->prefix('arah-mata-angin')->group(function () {
|
||||
Route::get('restore/{id}', [ArahMataAnginController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [ArahMataAnginController::class, 'dataForDatatables'])
|
||||
->name('datatables');
|
||||
Route::get('export', [ArahMataAnginController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('arah-mata-angin', ArahMataAnginController::class);
|
||||
|
||||
Route::name('jaminan.')->prefix('{id}/jaminan')->group(function () {
|
||||
Route::get('download/{dokumen}', [DokumenJaminanController::class, 'download'])->name('download');
|
||||
Route::get('/', [DokumenJaminanController::class, 'index'])->name('index');
|
||||
Route::get('create', [DokumenJaminanController::class, 'create'])->name('create');
|
||||
Route::get('{jaminan}/edit', [DokumenJaminanController::class, 'edit'])->name('edit');
|
||||
Route::put('{jaminan}', [DokumenJaminanController::class, 'update'])->name('update');
|
||||
Route::post('store', [DokumenJaminanController::class, 'store'])->name('store');
|
||||
Route::delete('{jaminan}', [DokumenJaminanController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
|
||||
Route::name('pemilik.')->prefix('{id}/pemilik')->group(function () {
|
||||
Route::get('/', [PemilikJaminanController::class, 'index'])->name('index');
|
||||
Route::get('create', [PemilikJaminanController::class, 'create'])->name('create');
|
||||
Route::get('{pemilik}/edit', [PemilikJaminanController::class, 'edit'])->name('edit');
|
||||
Route::put('{pemilik}', [PemilikJaminanController::class, 'update'])->name('update');
|
||||
Route::post('store', [PemilikJaminanController::class, 'store'])->name('store');
|
||||
Route::delete('{pemilik}', [PemilikJaminanController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
|
||||
Route::name('status-permohonan.')->prefix('status-permohonan')->group(function () {
|
||||
Route::get('restore/{id}', [StatusPermohonanController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [StatusPermohonanController::class, 'dataForDatatables'])
|
||||
@@ -173,7 +324,6 @@ Route::middleware(['auth'])->group(function () {
|
||||
});
|
||||
|
||||
Route::resource('ijin_usaha', IjinUsahaController::class);
|
||||
// End Activity Ijin Usaha route
|
||||
});
|
||||
|
||||
Route::name('permohonan.')->prefix('permohonan')->group(function () {
|
||||
@@ -190,8 +340,12 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('authorization', [PermohonanController::class, 'authorization'])->name('authorization.index');
|
||||
Route::get('authorization/datatables', [PermohonanController::class, 'dataForAuthorization'])
|
||||
->name('authorization.datatables');
|
||||
Route::get('authorization/{id}/edit', [PermohonanController::class, 'showAuthorization'])->name('authorization.show');
|
||||
Route::put('authorization/{id}', [PermohonanController::class, 'updateAuthorization'])->name('authorization.update');
|
||||
Route::get('authorization/{id}/edit', [PermohonanController::class, 'showAuthorization'])->name(
|
||||
'authorization.show',
|
||||
);
|
||||
Route::put('authorization/{id}', [PermohonanController::class, 'updateAuthorization'])->name(
|
||||
'authorization.update',
|
||||
);
|
||||
|
||||
Route::name('debitur.')->prefix('debitur')->group(function () {
|
||||
Route::get('restore/{id}', [DebitureController::class, 'restore'])->name('restore');
|
||||
@@ -228,9 +382,13 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('penawaran/create', [TenderController::class, 'penawaran_create'])->name('penawaran.create');
|
||||
|
||||
// Proses Penawaran
|
||||
Route::get('proses_penawaran', [TenderController::class, 'proses_penawaran_index'])->name('proses_penawaran.index');
|
||||
Route::get('proses_penawaran', [TenderController::class, 'proses_penawaran_index'])->name(
|
||||
'proses_penawaran.index',
|
||||
);
|
||||
|
||||
// Penawaran Ulang
|
||||
Route::get('penawaran_ulang', [TenderController::class, 'penawaran_ulang_index'])->name('penawaran_ulang.index');
|
||||
Route::get('penawaran_ulang', [TenderController::class, 'penawaran_ulang_index'])->name(
|
||||
'penawaran_ulang.index',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user