Merge remote-tracking branch 'origin/feature/senior-officer' into staging
# Conflicts: # module.json # routes/web.php
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
$row->branch->name,
|
||||
$row->tujuanPenilaian->name,
|
||||
$row->debiture->name,
|
||||
$row->fasilitasKredit->name,
|
||||
$row->plafond->name,
|
||||
$row->jenisFasilitasKredit->name,
|
||||
$row->nilaiPlafond->name,
|
||||
$row->status,
|
||||
$row->authorized_at,
|
||||
$row->authorized_status,
|
||||
|
||||
@@ -7,7 +7,11 @@ use Exception;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Exports\PermohonanExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class ActivityController extends Controller
|
||||
{
|
||||
@@ -25,6 +29,39 @@ class ActivityController extends Controller
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
|
||||
|
||||
public function progres_activity()
|
||||
{
|
||||
// Ambil user yang sedang login
|
||||
$user = auth()->user();
|
||||
$roles = $user->load('roles');
|
||||
$regionId = null;
|
||||
|
||||
// Cek apakah user memiliki role 'senior officer'
|
||||
if ($roles->roles->pluck('name')->contains('senior officer')) {
|
||||
$regionId = TeamsUsers::with('team.regions')
|
||||
->where('user_id', $user->id)
|
||||
->first()?->team->regions_id;
|
||||
}
|
||||
|
||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions'])
|
||||
->whereHas('team', function ($q) use ($regionId) {
|
||||
if ($regionId) {
|
||||
$q->where('regions_id', $regionId);
|
||||
}
|
||||
})
|
||||
->where('user_id', '!=', $user->id)
|
||||
->get();
|
||||
|
||||
return view('lpj::activity.progres_activity.index', compact('teamsActivity'));
|
||||
}
|
||||
|
||||
|
||||
public function senior()
|
||||
{
|
||||
return view('lpj::activity.senior_officer.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
@@ -39,7 +76,7 @@ class ActivityController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
|
||||
$status_permohonan = StatusPermohonan::orderBy('id')->get();
|
||||
$status_permohonan = StatusPermohonan::orderBy('id')->get()->reverse();
|
||||
|
||||
$permohonan = Permohonan::with(
|
||||
[
|
||||
@@ -67,9 +104,9 @@ class ActivityController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function dataForDatatables(Request $request)
|
||||
*/public function dataForDatatables(Request $request)
|
||||
{
|
||||
// Check permissions
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
@@ -81,20 +118,19 @@ class ActivityController extends Controller
|
||||
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 . '%');
|
||||
});
|
||||
}
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%')
|
||||
->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
|
||||
// Apply status filter if provided
|
||||
if ($request->has('status') && !empty($request->get('status'))) {
|
||||
$status = $request->get('status');
|
||||
$query->where('status', '=', $status);
|
||||
// Split search term by comma to allow multiple statuses
|
||||
$statusKeywords = explode(',', $search);
|
||||
foreach ($statusKeywords as $keyword) {
|
||||
$q->orWhere('status', 'LIKE', '%' . trim($keyword) . '%');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Default sorting if no sort provided
|
||||
@@ -103,32 +139,29 @@ class ActivityController extends Controller
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
} else {
|
||||
$query->orderBy('nomor_registrasi', 'asc'); // Default order by nomor_registrasi
|
||||
$query->orderBy('nomor_registrasi', 'asc');
|
||||
}
|
||||
|
||||
// Get the total count of records before paginating
|
||||
// Get total count of records before pagination
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
// Pagination
|
||||
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
|
||||
$page = (int) $request->get('page', 1);
|
||||
$size = (int) $request->get('size', 10);
|
||||
$offset = ($page - 1) * $size;
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records (after search & filters applied)
|
||||
// Get filtered count
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
// Get data
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
// Calculate the total number of pages
|
||||
// Calculate total 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,
|
||||
@@ -141,6 +174,7 @@ class ActivityController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Download the specified resource from storage.
|
||||
*/
|
||||
@@ -149,4 +183,64 @@ class ActivityController extends Controller
|
||||
$document = Permohonan::find($id);
|
||||
return response()->download(storage_path('app/public/' . $document->dokumen));
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new PermohonanExport(), 'activity.xlsx');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function dataTablesForActivity(Request $request, $id)
|
||||
{
|
||||
// Query Penilaian dengan relasi yang diperlukan
|
||||
$query = Penilaian::with(['permohonan', 'permohonan.debiture', 'permohonan.tujuanPenilaian'])
|
||||
->where(function($q) use ($id) {
|
||||
$q->where('surveyor_id', $id)
|
||||
->orWhere('penilaian_id', $id)
|
||||
->orWhere('penilai_surveyor_id', $id);
|
||||
});
|
||||
|
||||
// Filter pencarian
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', "%$search%")
|
||||
->orWhere('status', '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);
|
||||
|
||||
// Return data dalam bentuk JSON
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $page,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
140
app/Http/Controllers/SurveyorController.php
Normal file
140
app/Http/Controllers/SurveyorController.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?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\Permohonan;
|
||||
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::surveyor.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::with(
|
||||
[
|
||||
'user',
|
||||
'debiture.province',
|
||||
'debiture.city',
|
||||
'debiture.district',
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian'
|
||||
],
|
||||
)->findOrFail($id);
|
||||
return view('lpj::surveyor.detail', compact('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 update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
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) = ?', ['assign']);
|
||||
|
||||
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', 'penilaian', 'jenisFasilitasKredit'])->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,
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -10,45 +10,50 @@ 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',
|
||||
'jenis_penilaian_id', 'teams_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(){
|
||||
public function jenis_penilaian()
|
||||
{
|
||||
return $this->belongsTo(JenisPenilaian::class, 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function teams(){
|
||||
public function teams()
|
||||
{
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function users(){
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function userPenilai(){
|
||||
public function userPenilai()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function userSurveyor(){
|
||||
public function userSurveyor()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function userPenilaiSurveyor(){
|
||||
public function userPenilaiSurveyor()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'penilai_surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Database\Factories\TeamsUsersFactory;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
|
||||
class TeamsUsers extends Model
|
||||
{
|
||||
@@ -30,4 +31,10 @@ class TeamsUsers extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian()
|
||||
{
|
||||
return $this->belongsTo(Penilaian::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
12
module.json
12
module.json
@@ -120,6 +120,18 @@
|
||||
"administrator","so"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Team Activity",
|
||||
"path": "activity.progres",
|
||||
"icon": "ki-filled ki-questionnaire-tablet text-lg",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"so"
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Activity",
|
||||
"path": "activity",
|
||||
|
||||
@@ -13,108 +13,118 @@
|
||||
</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 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">
|
||||
Tujuan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
|
||||
<div class="card grow" id="activity_2024">
|
||||
<div class="card-header">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
Status Activity
|
||||
</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>
|
||||
<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-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
|
||||
<div class="flex items-start relative">
|
||||
@if ($index > 0)
|
||||
<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
|
||||
|
||||
@case('revisi')
|
||||
<i class="ki-filled ki-notepad-edit text-base"></i>
|
||||
@break
|
||||
<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('preregister')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
@case('order')
|
||||
<i class="ki-filled ki-handcart text-base"></i>
|
||||
@break
|
||||
|
||||
@case('register')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
@case('revisi')
|
||||
<i class="ki-filled ki-notepad-edit text-base"></i>
|
||||
@break
|
||||
|
||||
@case('assign')
|
||||
<i class="ki-filled ki-file-added"></i>
|
||||
@break
|
||||
@case('register')
|
||||
<i class="ki-filled ki-note-2 text-base"></i>
|
||||
@break
|
||||
|
||||
@case('survey')
|
||||
<i class="ki-filled ki-map text-base"></i>
|
||||
@break
|
||||
@case('assign')
|
||||
<i class="ki-filled ki-file-added"></i>
|
||||
@break
|
||||
|
||||
@default
|
||||
<i class="ki-filled ki-people text-base"></i>
|
||||
@endswitch
|
||||
@case('survey')
|
||||
<i class="ki-filled ki-map text-base"></i>
|
||||
@break
|
||||
@case('proses laporan')
|
||||
<i class="ki-filled ki-paper-plane text-base"></i>
|
||||
@break
|
||||
@case('approved')
|
||||
<i class="ki-filled ki-check text-base"></i>
|
||||
@break
|
||||
@case('delivered')
|
||||
<i class="ki-filled ki-delivery-3 text-base"></i>
|
||||
@break
|
||||
@default
|
||||
<i class="ki-filled ki-information text-base"></i>
|
||||
@endswitch
|
||||
|
||||
</div>
|
||||
@include('lpj::activity.components.status')
|
||||
</div>
|
||||
@include('lpj::activity.components.status')
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer justify-center">
|
||||
<!-- Add footer content if necessary -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer justify-center">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -43,47 +43,10 @@
|
||||
</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>
|
||||
|
||||
@@ -4,16 +4,45 @@
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
|
||||
@endpush
|
||||
<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">
|
||||
@@ -22,14 +51,42 @@
|
||||
</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 class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button
|
||||
class="dropdowns-toggle btn btn-sm btn-light inline-flex justify-between w-full items-center">
|
||||
Pilih Status
|
||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||
</i>
|
||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||
</i>
|
||||
</button>
|
||||
<div
|
||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<!-- Checkbox untuk All Status -->
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input id="select-all" type="checkbox"
|
||||
class="form-checkbox h-4 w-4 text-blue-600">
|
||||
<span class="ml-2">All Status</span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Dinamis Status dari Backend -->
|
||||
@foreach ($status_permohonan as $item)
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
||||
value="{{ strtolower($item->name) }}">
|
||||
<span class="ml-2">{{ $item->name }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
@@ -203,9 +260,44 @@
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
statusFilter.addEventListener('change', function() {
|
||||
const selectedStatus = this.value;
|
||||
dataTable.search(selectedStatus);
|
||||
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', applyStatusFilter);
|
||||
});
|
||||
|
||||
// Event listener untuk "Select All"
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
applyStatusFilter();
|
||||
});
|
||||
|
||||
function applyStatusFilter() {
|
||||
const selectedStatuses = Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
|
||||
|
||||
if (selectedStatuses.length === 0) {
|
||||
dataTable.search('');
|
||||
console.log(selectedStatuses);
|
||||
|
||||
} else {
|
||||
|
||||
dataTable.search(selectedStatuses.join(','), true);
|
||||
console.log(selectedStatuses);
|
||||
|
||||
}
|
||||
|
||||
const allChecked = Array.from(statusCheckboxes).every(cb => cb.checked);
|
||||
selectAllCheckbox.checked = allChecked;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
244
resources/views/activity/progres_activity/index.blade.php
Normal file
244
resources/views/activity/progres_activity/index.blade.php
Normal file
@@ -0,0 +1,244 @@
|
||||
@extends('layouts.main')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity.progres') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card min-w-full">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Team Activity</h3>
|
||||
</div>
|
||||
<div data-accordion="true">
|
||||
|
||||
@php
|
||||
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
return $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
@endphp
|
||||
|
||||
@foreach ($sortedTeamsActivity as $index => $item)
|
||||
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
|
||||
id="accordion_{{ $index }}">
|
||||
<button class="accordion-toggle py-4 group mx-8"
|
||||
data-accordion-toggle="#accordion_{{ $index }}content_{{ $index }}"
|
||||
style="margin-start: 10px">
|
||||
<table class="table table-auto align-middle text-gray-700 font-medium text-sm">
|
||||
<tr>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">{{ $item->user->name }}</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
@php
|
||||
$totalTasks = $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
@endphp
|
||||
<p>Total Task: {{ $totalTasks }}</p>
|
||||
</span>
|
||||
</th>
|
||||
<th>
|
||||
<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>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</button>
|
||||
<div class="accordion-content hidden" id="accordion_{{ $index }}content_{{ $index }}">
|
||||
<div class="mx-8 pb-4" style="margin-bottom: 20px">
|
||||
<div class="card card-grid min-w-full" data-datatable="false"
|
||||
id="activity-table-{{ $index }}"
|
||||
data-api-url="{{ route('activity.progres.datatables', ['id' => $item->user->id ]) }}">
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table
|
||||
class="table table-auto align-middle text-gray-700 font-medium text-sm my-4"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="min-w-[100px]">Nama Debitur</th>
|
||||
<th class="min-w-[100px]">Tujuan Penilaian</th>
|
||||
<th class="min-w-[100px]">Jenis Asset</th>
|
||||
<th class="min-w-[100px]">Jenis Report</th>
|
||||
<th class="min-w-[100px]">Tgl Register</th>
|
||||
<th class="min-w-[100px]">Tgl Assign</th>
|
||||
<th class="min-w-[100px]">Tgl Kunjungan</th>
|
||||
<th class="min-w-[100px]">Progress</th>
|
||||
<th class="min-w-[100px]">Due Date SLA</th>
|
||||
<th class="min-w-[100px]">Paparan</th>
|
||||
<th class="min-w-[100px]">Approve</th>
|
||||
<th class="min-w-[50px] text-center">Keterangan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="12" class="text-center">No data available</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</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>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const accordions = document.querySelectorAll('[data-accordion-item]');
|
||||
|
||||
accordions.forEach((accordion, index) => {
|
||||
accordion.querySelector('.accordion-toggle').addEventListener('click', () => {
|
||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||
'data-api-url');
|
||||
|
||||
console.log("This is the API URL: " + apiUrl);
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
columns: {
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture.name}`
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.tujuan_penilaian?.name || ''}`;
|
||||
},
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) => `${data.jenis_asset || ''}`,
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
render: (item, data) => `${data.jenis_report || ''}`,
|
||||
},
|
||||
register: {
|
||||
title: 'Register',
|
||||
render: (item, data) =>
|
||||
`${formatDateFromISO(data.permohonan.created_at) || ''}`,
|
||||
|
||||
},
|
||||
assign: {
|
||||
title: 'Assign',
|
||||
render: (item, data) => `${formatDateFromISO(data.created_at)}`,
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tgl Kunjungan',
|
||||
render: (item, data) =>
|
||||
`${formatDateFromISO(data.tanggal_kunjungan) || ''}`,
|
||||
},
|
||||
progress: {
|
||||
title: 'Progress',
|
||||
render: (item, data) => `${data.progress || ''}`,
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date',
|
||||
render: (item, data) => `${data.due_date || ''}`,
|
||||
},
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
render: (item, data) => `${data.paparan || ''}`,
|
||||
},
|
||||
approve: {
|
||||
title: 'Approve',
|
||||
render: (item, data) => `${data.approve || ''}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Keterangan',
|
||||
render: (item, data) => `${data.keterangan || ''}`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize DataTable only for the active accordion
|
||||
if (!accordion.querySelector('.dataTable')) {
|
||||
const element = accordion.querySelector('.card-grid');
|
||||
new KTDataTable(element, dataTableOptions);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function formatDateFromISO(isoDateString) {
|
||||
const date = new Date(isoDateString);
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const year = String(date.getFullYear()).slice(-2);
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
15
resources/views/activity/senior_officer/index.blade.php
Normal file
15
resources/views/activity/senior_officer/index.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('activity') }}
|
||||
@endsection --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row"></div>
|
||||
<div class="col-md-12">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -335,7 +335,7 @@
|
||||
</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">
|
||||
class="select input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
</select>
|
||||
|
||||
|
||||
162
resources/views/surveyor/detail.blade.php
Normal file
162
resources/views/surveyor/detail.blade.php
Normal file
@@ -0,0 +1,162 @@
|
||||
@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">
|
||||
<div class="card">
|
||||
<div class="card-header" id="advanced_settings_appearance">
|
||||
<h3 class="card-title">
|
||||
Surveyor
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('surveyor.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">
|
||||
Waktu Survei:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->penilaian->tanggal_kunjungan }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Keterangan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->penilaian->keterangan }}
|
||||
</span>
|
||||
</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 min-w-full py-2 px-2">
|
||||
{{-- <div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Data Jaminan
|
||||
</h3>
|
||||
</div> --}}
|
||||
|
||||
<div class="flex flex-col gap-5 lg:gap-7.5">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
270
resources/views/surveyor/index.blade.php
Normal file
270
resources/views/surveyor/index.blade.php
Normal file
@@ -0,0 +1,270 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('surveyor') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
|
||||
@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
|
||||
|
||||
<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">
|
||||
Surveyor
|
||||
</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('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('surveyor.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 Assigned</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">Fasilitas Kredit</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>
|
||||
|
||||
<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">Kunjungan</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=""
|
||||
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">Tanggal 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="">
|
||||
@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 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 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 Assigned',
|
||||
render: (item, data) => {
|
||||
const createdAt = convertDate(data.penilaian.created_at);
|
||||
return createdAt;
|
||||
},
|
||||
},
|
||||
|
||||
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}`,
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`,
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" data-modal-toggle="#modal_revisi" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${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);
|
||||
});
|
||||
|
||||
function convertDate(date) {
|
||||
const createdAt = new Date(date);
|
||||
const day = String(createdAt.getDate()).padStart(2, '0');
|
||||
const month = String(createdAt.getMonth() + 1).padStart(2, '0');
|
||||
const year = createdAt.getFullYear();
|
||||
return `${day}-${month}-${year}`;
|
||||
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@@ -126,3 +126,4 @@
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -370,6 +370,7 @@
|
||||
$trail->push('Assignment');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('authorization.index', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Permohonan', route('authorization.index'));
|
||||
});
|
||||
@@ -388,6 +389,10 @@
|
||||
$trail->push('Activity activity');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('activity.progres', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Team activity');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('tender', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Tender');
|
||||
});
|
||||
@@ -418,6 +423,15 @@
|
||||
$trail->push('Data Penawaran Ulang', route('tender.penawaran_ulang.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('surveyor', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Surveyor', route('surveyor.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('surveyor.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('surveyor');
|
||||
$trail->push('Detail');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('registrasi', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Registrasi', route('registrasi.index'));
|
||||
});
|
||||
|
||||
@@ -27,19 +27,19 @@ use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\TenderController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||
|
||||
// use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\SurveyorController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
Route::name('basicdata.')->prefix('basic-data')->group(function () {
|
||||
@@ -201,6 +201,9 @@ Route::middleware(['auth'])->group(function () {
|
||||
],
|
||||
]);
|
||||
|
||||
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');
|
||||
@@ -449,14 +452,33 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('store', [PenilaianController::class, 'store'])->name('store');
|
||||
});
|
||||
|
||||
/**
|
||||
* Route start activity
|
||||
*/
|
||||
|
||||
Route::name('activity.')->prefix('activity')->group(function () {
|
||||
Route::get('restore/{id}', [ActivityController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [ActivityController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [ActivityController::class, 'export'])->name('export');
|
||||
Route::get('/', [ActivityController::class, 'index'])->name('index');
|
||||
|
||||
Route::get('/{id}/show', [ActivityController::class, 'show'])->name('show');
|
||||
Route::get('download/{id}', [ActivityController::class, 'download'])->name('download');
|
||||
Route::get('senior', [ActivityController::class, 'senior'])->name('senior');
|
||||
|
||||
Route::name('progres.')->prefix('progres')->group(function () {
|
||||
Route::get('/', [ActivityController::class, 'progres_activity'])->name('index');
|
||||
Route::get('/datatables/{id}', [ActivityController::class, 'dataTablesForActivity'])->name('datatables');
|
||||
|
||||
});
|
||||
|
||||
Route::get('/teams/{regionId}', [ActivityController::class, 'dataTablesForActivity']);
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Route end activity
|
||||
*/
|
||||
});
|
||||
|
||||
require __DIR__ . '/registrasi.php';
|
||||
|
||||
Reference in New Issue
Block a user