Merge branch 'staging' into feature/senior-officer
This commit is contained in:
49
app/Exports/CustomFieldExport.php
Normal file
49
app/Exports/CustomFieldExport.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\CustomField;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class CustomFieldExport implements WithColumnFormatting, WithHeadings, FromCollection, WithMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return CustomField::all();
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
return [
|
||||
$row->id,
|
||||
$row->name,
|
||||
$row->type,
|
||||
$row->created_at,
|
||||
$row->updated_at,
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Name',
|
||||
'Type',
|
||||
'Created At',
|
||||
'Updated At',
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'D' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
||||
'E' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\HolidayCalendar;
|
||||
use Modules\Lpj\Models\CustomField;
|
||||
use Modules\Lpj\Models\HolidayCalendar;
|
||||
use Modules\Lpj\Models\PenawaranDetailTender;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
@@ -359,3 +360,16 @@ function getNomorLaporan($permohonanId, $documentId){
|
||||
])->first();
|
||||
return $laporan->nomor_laporan ?? null;
|
||||
}
|
||||
|
||||
function getCustomField($param){
|
||||
if(is_numeric($param)){
|
||||
$field = CustomField::find($param);
|
||||
} else {
|
||||
$field = CustomField::where(['name' => $param])->first();
|
||||
}
|
||||
if($field){
|
||||
return $field;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
153
app/Http/Controllers/CustomFieldController.php
Normal file
153
app/Http/Controllers/CustomFieldController.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\CustomFieldExport;
|
||||
use Modules\Lpj\Http\Requests\CustomFieldRequest;
|
||||
use Modules\Lpj\Models\CustomField;
|
||||
|
||||
class CustomFieldController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::custom_fields.index');
|
||||
}
|
||||
|
||||
public function store(CustomFieldRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
CustomField::create($validate);
|
||||
return redirect()
|
||||
->route('basicdata.custom-field.index')
|
||||
->with('success', 'Custom Field created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.custom-field.create')
|
||||
->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$urutan_prioritas = CustomField::max('urutan_prioritas')+1;
|
||||
return view('lpj::custom_fields.create', compact('urutan_prioritas'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$customField = CustomField::find($id);
|
||||
$urutan_prioritas = $customField->urutan_prioritas ?? CustomField::max('urutan_prioritas')+1;
|
||||
return view('lpj::custom_fields.create', compact('customField', 'urutan_prioritas' ));
|
||||
}
|
||||
|
||||
public function update(CustomFieldRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$customField = CustomField::find($id);
|
||||
$customField->update($validate);
|
||||
return redirect()
|
||||
->route('basicdata.custom-field.index')
|
||||
->with('success', 'Custom Field updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('basicdata.custom-field.edit', $id)
|
||||
->with('error', 'Failed to update custom field');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// Delete from database
|
||||
$customField = CustomField::find($id);
|
||||
$customField->delete();
|
||||
|
||||
echo json_encode(['success' => true, 'message' => 'Custom Field deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Failed to delete custom field']);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('custom_fields.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view custom fields.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = CustomField::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('name', 'LIKE', "%$search%");
|
||||
$q->orWhere('label', 'LIKE', "%$search%");
|
||||
$q->orWhere('type', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
return Excel::download(new CustomFieldExport, 'custom_fields.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
use Modules\Lpj\Http\Requests\DokumenJaminanRequest;
|
||||
use Modules\Lpj\Models\CustomField;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Models\DetailDokumenJaminan;
|
||||
use Modules\Lpj\Models\DokumenJaminan;
|
||||
@@ -88,7 +89,7 @@
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
'details' => isset($request->custom_field[$key]) ? json_encode($request->custom_field[$key]) : ''
|
||||
'details' => isset($request->custom_field[$value]) ? json_encode($request->custom_field[$value]) : ''
|
||||
];
|
||||
|
||||
$dokumenJaminan = [];
|
||||
@@ -247,7 +248,7 @@
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
'details' => isset($request->custom_field[$key]) ? json_encode($request->custom_field[$key]) : ''
|
||||
'details' => isset($request->custom_field[$value]) ? json_encode($request->custom_field[$value]) : ''
|
||||
];
|
||||
|
||||
$dokumenJaminan = [];
|
||||
@@ -496,6 +497,12 @@
|
||||
foreach ($document->detail as $detail) {
|
||||
// Only include existing legalitas if its id is in the new set
|
||||
if (in_array($detail->jenis_legalitas_jaminan_id, $newLegalitasIds)) {
|
||||
$customFields = [];
|
||||
if($detail->jenisLegalitasJaminan->custom_fields) {
|
||||
$customFields = CustomField::whereIn('id', $detail->jenisLegalitasJaminan->custom_fields)
|
||||
->get();
|
||||
}
|
||||
|
||||
$existingLegalitas[] = [
|
||||
'id' => $detail->id,
|
||||
'jenis_legalitas_jaminan_id' => $detail->jenis_legalitas_jaminan_id,
|
||||
@@ -507,6 +514,7 @@
|
||||
$detail->dokumen_nomor,
|
||||
) ?? $detail->dokumen_nomor,
|
||||
'custom_field' => $detail->jenisLegalitasJaminan->custom_field,
|
||||
'custom_fields' => $customFields,
|
||||
'custom_field_type' => $detail->jenisLegalitasJaminan->custom_field_type,
|
||||
'details' => $detail->details,
|
||||
'keterangan' => $detail->keterangan,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\JenisLegalitasJaminanExport;
|
||||
use Modules\Lpj\Http\Requests\JenisLegalitasJaminanRequest;
|
||||
use Modules\Lpj\Models\CustomField;
|
||||
use Modules\Lpj\Models\JenisLegalitasJaminan;
|
||||
|
||||
class JenisLegalitasJaminanController extends Controller
|
||||
@@ -40,13 +41,15 @@
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::jenis_legalitas_jaminan.create');
|
||||
$customFields = CustomField::orderBy('urutan_prioritas', 'asc')->get();
|
||||
return view('lpj::jenis_legalitas_jaminan.create',compact('customFields'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::find($id);
|
||||
return view('lpj::jenis_legalitas_jaminan.create', compact('jenisLegalitasJaminan'));
|
||||
$customFields = CustomField::orderBy('urutan_prioritas', 'asc')->get();
|
||||
return view('lpj::jenis_legalitas_jaminan.create', compact('jenisLegalitasJaminan', 'customFields'));
|
||||
}
|
||||
|
||||
public function update(JenisLegalitasJaminanRequest $request, $id)
|
||||
|
||||
58
app/Http/Requests/CustomFieldRequest.php
Normal file
58
app/Http/Requests/CustomFieldRequest.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Modules\Lpj\Models\CustomField;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class CustomFieldRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
'type' => 'required|in:text,select,radio,checkbox',
|
||||
'label' => 'nullable|max:255',
|
||||
'urutan_prioritas' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
Rule::unique('custom_fields')->ignore($this->route('custom_field')),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function prepareValidationData($data){
|
||||
if(!$this->type){
|
||||
$this->merge(['type' => 'text']);
|
||||
}
|
||||
|
||||
if (!$this->urutan_prioritas) {
|
||||
$maxPrioritas = CustomField::max('urutan_prioritas') ?? 0;
|
||||
$this->merge(['urutan_prioritas' => $maxPrioritas + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom messages for validator errors.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'urutan_prioritas.unique' => 'Urutan prioritas sudah digunakan. Silakan pilih nomor lain.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@
|
||||
'slug' => 'required|max:255',
|
||||
'custom_field' => 'nullable|max:255',
|
||||
'custom_field_type' => 'nullable|max:255',
|
||||
'custom_fields' => 'nullable|array',
|
||||
'custom_fields.*' => 'required|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -46,5 +48,10 @@
|
||||
'slug' => Str::slug($this->name),
|
||||
]);
|
||||
}
|
||||
|
||||
// Ensure custom_fields is always an array
|
||||
if (!is_array($this->custom_fields)) {
|
||||
$this->merge(['custom_fields' => []]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
26
app/Models/CustomField.php
Normal file
26
app/Models/CustomField.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\CustomFieldFactory;
|
||||
|
||||
class CustomField extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'type',
|
||||
'urutan_prioritas',
|
||||
'label'
|
||||
];
|
||||
|
||||
// protected static function newFactory(): CustomFieldFactory
|
||||
// {
|
||||
// // return CustomFieldFactory::new();
|
||||
// }
|
||||
}
|
||||
@@ -7,5 +7,14 @@
|
||||
class JenisLegalitasJaminan extends Base
|
||||
{
|
||||
protected $table = 'jenis_legalitas_jaminan';
|
||||
protected $fillable = ['code', 'name','slug','custom_field','custom_field_type'];
|
||||
protected $fillable = ['code', 'name','slug','custom_field','custom_field_type','custom_fields'];
|
||||
|
||||
protected $casts = [
|
||||
'custom_fields' => 'array',
|
||||
];
|
||||
|
||||
public function customFields()
|
||||
{
|
||||
return $this->hasMany(CustomField::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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('custom_fields', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('type');
|
||||
$table->timestamps();
|
||||
$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('custom_fields');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('custom_fields', function (Blueprint $table) {
|
||||
$table->integer('urutan_prioritas')->nullable()->after('type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('custom_fields', function (Blueprint $table) {
|
||||
$table->dropColumn('urutan_prioritas');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('custom_fields', function (Blueprint $table) {
|
||||
$table->string('label')->nullable()->after('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('custom_fields', function (Blueprint $table) {
|
||||
$table->dropColumn('label');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('jenis_legalitas_jaminan', function (Blueprint $table) {
|
||||
$table->string('custom_fields')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('jenis_legalitas_jaminan', function (Blueprint $table) {
|
||||
$table->dropColumn('custom_fields');
|
||||
});
|
||||
}
|
||||
};
|
||||
11
module.json
11
module.json
@@ -851,6 +851,17 @@
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Custom Field",
|
||||
"path": "basicdata.custom-field",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
89
resources/views/custom_fields/create.blade.php
Normal file
89
resources/views/custom_fields/create.blade.php
Normal file
@@ -0,0 +1,89 @@
|
||||
@php
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
|
||||
@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($customField->id))
|
||||
<form action="{{ route('basicdata.custom-field.update', $customField->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $customField->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.custom-field.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($customField->id) ? 'Edit' : 'Tambah' }} Custom Field
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.custom-field.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="{{ $customField->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">
|
||||
Label
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('label') border-danger bg-danger-light @enderror" type="text" name="label" value="{{ $customField->label ?? '' }}">
|
||||
@error('label')
|
||||
<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">
|
||||
Type
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input @error('type') border-danger bg-danger-light @enderror" name="type">
|
||||
<option value="text" {{ (isset($customField->type) && $customField->type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="radio" {{ (isset($customField->type) && $customField->type == 'radio') ? 'selected' : '' }}>Radio</option>
|
||||
<option value="number" {{ (isset($customField->type) && $customField->type == 'select') ? 'selected' : '' }}>Select</option>
|
||||
<option value="option" {{ (isset($customField->type) && $customField->type == 'checkbox') ? 'selected' : '' }}>Checkbox</option>
|
||||
</select>
|
||||
@error('type')
|
||||
<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">
|
||||
Urutan Prioritas
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('urutan_prioritas') border-danger bg-danger-light @enderror" type="number" name="urutan_prioritas" value="{{ $customField->urutan_prioritas ?? $urutan_prioritas }}">
|
||||
@error('urutan_prioritas')
|
||||
<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
|
||||
153
resources/views/custom_fields/index.blade.php
Normal file
153
resources/views/custom_fields/index.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.custom-field') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="custom-field-table" data-api-url="{{ route('basicdata.custom-field.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Custom Field
|
||||
</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 Custom Field" 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.custom-field.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.custom-field.create') }}"> Tambah Custom Field </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="name">
|
||||
<span class="sort"> <span class="sort-label"> Custom Field </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="type">
|
||||
<span class="sort"> <span class="sort-label"> Type </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="urutan_prioritas">
|
||||
<span class="sort"> <span class="sort-label"> Urutan Prioritas </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 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/custom-field/${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('#custom-field-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();
|
||||
},
|
||||
},
|
||||
label: {
|
||||
title: 'Custom Field',
|
||||
},
|
||||
type: {
|
||||
title: 'Type',
|
||||
},
|
||||
urutan_prioritas: {
|
||||
title: 'Urutan Prioritas',
|
||||
},
|
||||
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/custom-field/${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
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Permohonan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="text-base text-gray-700 font-bold">
|
||||
{{ $permohonan->nomor_registrasi ?? "-" }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Permohonan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="text-base text-gray-700 font-bold">
|
||||
{{ $permohonan->nomor_registrasi ?? "-" }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pemilik Jaminan
|
||||
@@ -314,38 +314,30 @@
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@if($detail->jenisLegalitasJaminan->custom_field)
|
||||
@php $custom_field = json_decode($detail->details,true) @endphp
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" value="{{ $custom_field[$detail->jenisLegalitasJaminan->custom_field] ?? '' }}">
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($key)->label ?? "" }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" value="{{ json_decode($detail->details)->{getCustomField($key)->name} ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@else
|
||||
@if($detail->jenisLegalitasJaminan->custom_field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if($detail->jenisLegalitasJaminan->custom_field_type === "text")
|
||||
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "number")
|
||||
<input class="input" type="number" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "date")
|
||||
<input class="input" type="date" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "textarea")
|
||||
<textarea class="textarea" rows="3" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2"></textarea>
|
||||
@else
|
||||
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@endif
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($key)->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" placeholder="...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -393,25 +385,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($item->custom_field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$item->custom_field) }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if($item->custom_field_type === "text")
|
||||
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "number")
|
||||
<input class="input" type="number" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "date")
|
||||
<input class="input" type="date" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "textarea")
|
||||
<textarea class="textarea" rows="3" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2"></textarea>
|
||||
@else
|
||||
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@endif
|
||||
@if($item->custom_fields)
|
||||
@foreach($item->custom_fields as $field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($field)->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$item->id}}][{{getCustomField($field)->name}}]" placeholder="...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -437,13 +421,13 @@
|
||||
@push('scripts')
|
||||
{{--Pemilik Jaminan--}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners() {
|
||||
document.querySelectorAll(".delete-button").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
button.addEventListener("click", function () {
|
||||
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
|
||||
});
|
||||
});
|
||||
@@ -452,7 +436,7 @@
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners();
|
||||
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function() {
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function () {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
||||
newDiv.innerHTML = `
|
||||
@@ -547,16 +531,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${item.custom_field ? `
|
||||
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${item.custom_field.replace(/_/g, " ")}
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
|
||||
${getCustomFieldInput(field.type, field.name, item.details, item.id)}
|
||||
</div>
|
||||
</div>
|
||||
` : ""}
|
||||
`).join('') : ""}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -637,19 +621,19 @@
|
||||
return dokumenNomor;
|
||||
}
|
||||
|
||||
function getCustomFieldInput(type, fieldName, value) {
|
||||
function getCustomFieldInput(type, fieldName, value, itemId) {
|
||||
value = value ? JSON.parse(value)[fieldName] || "" : "";
|
||||
switch (type) {
|
||||
case "text":
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
case "number":
|
||||
return `<input class="input" type="number" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="number" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
case "date":
|
||||
return `<input class="input" type="date" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="date" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
case "textarea":
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[][${fieldName}]">${value}</textarea>`;
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[${itemId}][${fieldName}]">${value}</textarea>`;
|
||||
default:
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -92,28 +92,28 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Legalitas Jaminan
|
||||
</label>
|
||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||
@foreach ($jenisLegalitasJaminan as $row)
|
||||
<label class="switch">
|
||||
@if ( isset($jenisJaminan) && !empty(json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true)))
|
||||
<input type="checkbox" @if (in_array($row->code, json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true))) {{ 'checked' }} @endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Legalitas Jaminan
|
||||
</label>
|
||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||
@foreach ($jenisLegalitasJaminan as $row)
|
||||
<label class="switch">
|
||||
@if ( isset($jenisJaminan) && !empty(json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true)))
|
||||
<input type="checkbox" @if (in_array($row->code, json_decode($jenisJaminan->jenis_legalitas_jaminan_id, true))) {{ 'checked' }} @endif
|
||||
value="{{ $row->code }}" name="jenis_legalitas_jaminan_id[]" />
|
||||
@else
|
||||
<input type="checkbox" value="{{ $row->code }}"
|
||||
name="jenis_legalitas_jaminan_id[]" />
|
||||
@endif
|
||||
<span class="switch-label">
|
||||
@else
|
||||
<input type="checkbox" value="{{ $row->code }}"
|
||||
name="jenis_legalitas_jaminan_id[]" />
|
||||
@endif
|
||||
<span class="switch-label">
|
||||
{{ $row->name }}
|
||||
</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
|
||||
@@ -10,83 +10,107 @@
|
||||
<form action="{{ route('basicdata.jenis-legalitas-jaminan.update', $jenisLegalitasJaminan->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisLegalitasJaminan->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-legalitas-jaminan.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">
|
||||
@if(isset($jenisLegalitasJaminan->id))
|
||||
<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 readonly class="input border-warning bg-warning-light @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<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="{{ $jenisLegalitasJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-legalitas-jaminan.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">
|
||||
@if(isset($jenisLegalitasJaminan->id))
|
||||
<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 readonly class="input border-warning bg-warning-light @error('code') border-danger bg-danger-light @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<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="{{ $jenisLegalitasJaminan->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tambahkan inputan custom_field -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('custom_field') border-danger bg-danger-light @enderror" type="text" name="custom_field" value="{{ $jenisLegalitasJaminan->custom_field ?? '' }}">
|
||||
@error('custom_field')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tambahkan inputan custom_field -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('custom_field') border-danger bg-danger-light @enderror" type="text" name="custom_field" value="{{ $jenisLegalitasJaminan->custom_field ?? '' }}">
|
||||
@error('custom_field')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tambahkan inputan custom_field_type -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field Type
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect @error('custom_field_type') border-danger bg-danger-light @enderror" name="custom_field_type">
|
||||
<option value="">Pilih Tipe</option>
|
||||
<option value="text" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="number" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'number') ? 'selected' : '' }}>Number</option>
|
||||
<option value="date" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'date') ? 'selected' : '' }}>Date</option>
|
||||
</select>
|
||||
@error('custom_field_type')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tambahkan inputan custom_field_type -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Custom Field Type
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect @error('custom_field_type') border-danger bg-danger-light @enderror" name="custom_field_type">
|
||||
<option value="">Pilih Tipe</option>
|
||||
<option value="text" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="number" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'number') ? 'selected' : '' }}>Number</option>
|
||||
<option value="date" {{ (isset($jenisLegalitasJaminan) && $jenisLegalitasJaminan->custom_field_type == 'date') ? 'selected' : '' }}>Date</option>
|
||||
</select>
|
||||
@error('custom_field_type')
|
||||
<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">
|
||||
Custom Fields
|
||||
</label>
|
||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||
@foreach($customFields as $customField)
|
||||
<label class="switch">
|
||||
@if ( isset($jenisLegalitasJaminan) && !empty($jenisLegalitasJaminan->custom_fields))
|
||||
<input type="checkbox" @if (in_array($customField->id, $jenisLegalitasJaminan->custom_fields))
|
||||
{{ 'checked' }}
|
||||
@endif
|
||||
value="{{ $customField->id }}" name="custom_fields[]"/>
|
||||
@else
|
||||
<input type="checkbox" value="{{ $customField->id }}"
|
||||
name="custom_fields[]"/>
|
||||
@endif
|
||||
<span class="switch-label">
|
||||
{{ $customField->urutan_prioritas.'. '.$customField->label }}
|
||||
</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
@@ -85,104 +85,100 @@
|
||||
$allPeople = array_filter($allPeople);
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
Luas Tanah / Luas Bangunan:
|
||||
@php
|
||||
$luas_tanah = null;
|
||||
$luas_bangunan = null;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
@if ($luas_tanah !== null && $luas_bangunan !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
|
||||
@elseif ($luas_tanah !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup>
|
||||
@elseif ($luas_bangunan !== null)
|
||||
{{ $luas_bangunan }} m<sup>2</sup>
|
||||
@endif
|
||||
</div>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
@php
|
||||
$luas_tanah = null;
|
||||
$luas_bangunan = null;
|
||||
@endphp
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br />
|
||||
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
|
||||
alt="{{ $permohonan->user->name }}" width="200">
|
||||
<p>
|
||||
{{ $permohonan->user->name }}
|
||||
</p>
|
||||
</div>
|
||||
@if (is_object($details))
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
|
||||
)
|
||||
@php
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
|
||||
)
|
||||
@php
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if ($luas_tanah !== null && $luas_bangunan !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
|
||||
@elseif ($luas_tanah !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup>
|
||||
@elseif ($luas_bangunan !== null)
|
||||
{{ $luas_bangunan }} m<sup>2</sup>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br/>
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br/>
|
||||
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
|
||||
alt="{{ $permohonan->user->name }}" width="200">
|
||||
<p>
|
||||
{{ $permohonan->user->name }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -133,21 +133,15 @@
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -116,21 +116,15 @@
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
@endphp
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
|
||||
@php
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -131,21 +131,15 @@
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah)))
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan)))
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.downloadSuratTenderKJPP', ['noreg' => $noreg, 'id' => $id]) }}"
|
||||
class="btn btn-xs btn-light">
|
||||
class="btn btn-xs btn-light">
|
||||
<img src="{{ asset('img/pdf.png') }}" width="25" alt="pdf" class="pdf"></img>Download
|
||||
</a>
|
||||
<a href="{{ route('tender.penawaran.showKirimEmail', $noreg) }}" class="btn btn-xs btn-info"><i
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
// Handle invalid JSON silently
|
||||
}
|
||||
}
|
||||
@@ -114,21 +114,17 @@
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
|
||||
)
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
|
||||
)
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
@@ -152,7 +148,7 @@
|
||||
<p>Best Regards,
|
||||
<div class="font-bold">
|
||||
<img src="{{ asset('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
|
||||
alt="{{ $permohonan->user->name }}" width="200" class="signature">
|
||||
alt="{{ $permohonan->user->name }}" width="200" class="signature">
|
||||
<p>
|
||||
{{ $permohonan->user->name }}
|
||||
</p>
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
<div class="container">
|
||||
Dear <span class="important">
|
||||
@php
|
||||
$allPeople = [];
|
||||
|
||||
@@ -87,104 +87,100 @@
|
||||
$allPeople = array_filter(array_unique($allPeople));
|
||||
$totalPeople = count($allPeople);
|
||||
@endphp
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
@if ($totalPeople > 0)
|
||||
@foreach ($allPeople as $index => $person)
|
||||
{{ $person }}{{ $index === $totalPeople - 2 ? ' dan ' : ($index < $totalPeople - 2 ? ' , ' : '') }}
|
||||
@endforeach
|
||||
@else
|
||||
Tidak Ada
|
||||
@endif
|
||||
</span>
|
||||
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
<div class="content">
|
||||
Mohon untuk dibuatkan proposal jasa appraisal atas nama <span
|
||||
class="important">{{ $permohonan->debiture->name }}</span>, tujuan penilaian untuk <span
|
||||
class="important">{{ $penawaran->tujuanPenilaianKJPP->name }}</span>, laporan dalam bentuk <span
|
||||
class="important">{{ $penawaran->jenisLaporan->name }}</span>, dengan data-data sebagai berikut:
|
||||
</div>
|
||||
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
Luas Tanah / Luas Bangunan:
|
||||
@php
|
||||
$luas_tanah = null;
|
||||
$luas_bangunan = null;
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
|
||||
@if (is_object($details))
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_tanah' &&
|
||||
isset($details->{'luas_tanah'}) &&
|
||||
is_numeric($details->{'luas_tanah'}))
|
||||
@php
|
||||
$luas_tanah = $details->{'luas_tanah'};
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@if (
|
||||
$detail->jenisLegalitasJaminan->custom_field === 'luas_bangunan' &&
|
||||
isset($details->{'luas_bangunan'}) &&
|
||||
is_numeric($details->{'luas_bangunan'}))
|
||||
@php
|
||||
$luas_bangunan = $details->{'luas_bangunan'};
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->debiture->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
{{ $district->name }}
|
||||
@endforeach,@foreach ($cities as $city)
|
||||
{{ ucwords(strtolower($city->name)) }}
|
||||
@endforeach,@foreach ($provinces as $province)
|
||||
{{ $province->name }}
|
||||
@endforeach
|
||||
@endforeach
|
||||
</span>
|
||||
|
||||
@if ($luas_tanah !== null && $luas_bangunan !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
|
||||
@elseif ($luas_tanah !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup>
|
||||
@elseif ($luas_bangunan !== null)
|
||||
{{ $luas_bangunan }} m<sup>2</sup>
|
||||
@endif
|
||||
</div>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
@php
|
||||
$luas_tanah = null;
|
||||
$luas_bangunan = null;
|
||||
@endphp
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br />
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
@foreach ($permohonan->debiture->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br />
|
||||
<img src="{{ public_path('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
|
||||
alt="{{ $permohonan->user->name }}" width="200">
|
||||
<p>
|
||||
{{ $permohonan->user->name }}
|
||||
</p>
|
||||
</div>
|
||||
@if (is_object($details))
|
||||
@if(isset($details->luas_tanah) && is_numeric($details->luas_tanah))
|
||||
)
|
||||
@php
|
||||
$luas_tanah = $details->luas_tanah;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
@if(isset($details->luas_bangunan) && is_numeric($details->luas_bangunan))
|
||||
)
|
||||
@php
|
||||
$luas_bangunan = $details->luas_bangunan;
|
||||
@endphp
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if ($luas_tanah !== null && $luas_bangunan !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup> / {{ $luas_bangunan }} m<sup>2</sup>
|
||||
@elseif ($luas_tanah !== null)
|
||||
{{ $luas_tanah }} m<sup>2</sup>
|
||||
@elseif ($luas_bangunan !== null)
|
||||
{{ $luas_bangunan }} m<sup>2</sup>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
Harap proposal dibuat dengan harga yang minimal sehingga tidak perlu tawar menawar lagi. <br/>
|
||||
Mohon proposal dapat saya terima segera, sebelum <span
|
||||
class="important">{{ formatTanggalIndonesia($penawaran->end_date, true) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="signature">
|
||||
Best Regards,<br/>
|
||||
<img src="{{ public_path('storage/signatures/' . $permohonan->user->id . '/' . $permohonan->user->sign) }}"
|
||||
alt="{{ $permohonan->user->name }}" width="200">
|
||||
<p>
|
||||
{{ $permohonan->user->name }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
PT. Bank Artha Graha Internasional, Tbk.<br>
|
||||
Gedung Bank Artha Graha, Lantai 3<br>
|
||||
Jl. Kwitang Raya No 24-26, Jakarta Pusat - 10420.<br>
|
||||
Telp. 021 - 3903040 (H)
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -9,6 +9,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
Breadcrumbs::for('basicdata.custom-field', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Custom Field', route('basicdata.custom-field.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.custom-field.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.custom-field');
|
||||
$trail->push('Tambah Custom Field', route('basicdata.custom-field.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.custom-field.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.custom-field');
|
||||
$trail->push('Edit Custom Field');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-fasilitas-kredit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Jenis Fasilitas Kredit', route('basicdata.jenis-fasilitas-kredit.index'));
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPenghuniJaminanController;
|
||||
@@ -51,6 +52,16 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('api/check-penawaran/{nomor_registrasi}', [TenderController::class, 'checkPenawaranExistence']);
|
||||
|
||||
Route::name('basicdata.')->prefix('basic-data')->group(function () {
|
||||
|
||||
Route::name('custom-field.')->prefix('custom-field')->group(function () {
|
||||
Route::get('restore/{id}', [CustomFieldController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [CustomFieldController::class, 'dataForDatatables'])->name(
|
||||
'datatables',
|
||||
);
|
||||
Route::get('export', [CustomFieldController::class, 'export'])->name('export');
|
||||
});
|
||||
Route::resource('custom-field', CustomFieldController::class);
|
||||
|
||||
Route::name('jenis-fasilitas-kredit.')->prefix('jenis-fasilitas-kredit')->group(function () {
|
||||
Route::get('restore/{id}', [JenisFasilitasKreditController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [JenisFasilitasKreditController::class, 'dataForDatatables'])->name(
|
||||
|
||||
Reference in New Issue
Block a user