Menyelesaikan Menu KJPP
This commit is contained in:
@@ -6,14 +6,14 @@ use Maatwebsite\Excel\Concerns\FromCollection;
|
|||||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||||
use Modules\Lpj\Models\IjinUsaha;
|
use Modules\Lpj\Models\KJPP;
|
||||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||||
|
|
||||||
class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
|
class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
|
||||||
{
|
{
|
||||||
public function collection()
|
public function collection()
|
||||||
{
|
{
|
||||||
return IjinUsaha::all();
|
return KJPP::all();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function map($row): array
|
public function map($row): array
|
||||||
@@ -23,6 +23,26 @@ class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection,
|
|||||||
$row->code,
|
$row->code,
|
||||||
$row->name,
|
$row->name,
|
||||||
$row->jenis_kantor,
|
$row->jenis_kantor,
|
||||||
|
$row->nomor_ijin_usaha,
|
||||||
|
$row->province_code,
|
||||||
|
$row->city_code,
|
||||||
|
$row->district_code,
|
||||||
|
$row->village_code,
|
||||||
|
$row->address,
|
||||||
|
$row->postal_code,
|
||||||
|
$row->nomor_telepon_kantor,
|
||||||
|
$row->email_kantor,
|
||||||
|
$row->nama_pimpinan,
|
||||||
|
$row->nomor_hp_pimpinan,
|
||||||
|
$row->nama_pic_reviewer,
|
||||||
|
$row->nomor_hp_pic_reviewer,
|
||||||
|
$row->nama_pic_admin,
|
||||||
|
$row->nomor_hp_pic_admin,
|
||||||
|
$row->nama_pic_marketing,
|
||||||
|
$row->nomor_hp_pic_marketing,
|
||||||
|
$row->ijin_usaha_id,
|
||||||
|
$row->jenis_aset_id,
|
||||||
|
$row->attachment,
|
||||||
$row->created_at
|
$row->created_at
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -34,6 +54,26 @@ class KJPPExport implements WithColumnFormatting, WithHeadings, FromCollection,
|
|||||||
'Code',
|
'Code',
|
||||||
'Name',
|
'Name',
|
||||||
'Jenis Kantor / Cabang',
|
'Jenis Kantor / Cabang',
|
||||||
|
'Nomor Ijin Usaha',
|
||||||
|
'Province Code',
|
||||||
|
'City Code',
|
||||||
|
'District Code',
|
||||||
|
'Village Code',
|
||||||
|
'Address',
|
||||||
|
'Postal Code',
|
||||||
|
'Nomor Telepon Kantor',
|
||||||
|
'Email Kantor',
|
||||||
|
'Nama Pimpinan',
|
||||||
|
'Nomor HP Pimpinan',
|
||||||
|
'Nama PIC Reviewer',
|
||||||
|
'Nomor HP PIC Reviewer',
|
||||||
|
'Nama PIC Admin',
|
||||||
|
'Nomor HP PIC Admin',
|
||||||
|
'Nama PIC Marketing',
|
||||||
|
'Nomor HP PIC Marketing',
|
||||||
|
'Ijin Usaha ID',
|
||||||
|
'Jenis Aset ID',
|
||||||
|
'Attachment',
|
||||||
'Created At'
|
'Created At'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
namespace Modules\Lpj\Http\Controllers;
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
|
use Throwable;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Modules\Lpj\Models\KJPP;
|
use Modules\Lpj\Models\KJPP;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Modules\Lpj\Models\Branch;
|
use Modules\Lpj\Models\Branch;
|
||||||
|
use Modules\Location\Models\City;
|
||||||
use Modules\Lpj\Models\IjinUsaha;
|
use Modules\Lpj\Models\IjinUsaha;
|
||||||
use Modules\Lpj\Exports\KJPPExport;
|
use Modules\Lpj\Exports\KJPPExport;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Modules\Location\Models\Village;
|
||||||
use Modules\Lpj\Models\JenisJaminan;
|
use Modules\Lpj\Models\JenisJaminan;
|
||||||
|
use Modules\Location\Models\District;
|
||||||
use Modules\Location\Models\Province;
|
use Modules\Location\Models\Province;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Modules\Lpj\Http\Requests\KJPPRequest;
|
use Modules\Lpj\Http\Requests\KJPPRequest;
|
||||||
@@ -44,24 +48,33 @@ class KJPPController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function store(KJPPRequest $request)
|
public function store(KJPPRequest $request)
|
||||||
{
|
{
|
||||||
$validate = $request->validated();
|
$validated = $request->validated();
|
||||||
|
|
||||||
|
if ($validated) {
|
||||||
if ($validate) {
|
|
||||||
$file = $request->file('attachment');
|
$file = $request->file('attachment');
|
||||||
$filename = $file ? time() . '.' . $file->getClientOriginalExtension() : 'default.pdf';
|
$filename = $file ? time() . '.' . $file->getClientOriginalExtension() : 'default.pdf';
|
||||||
|
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$file->storeAs('uploads_pdf', $filename, 'public');
|
// Simpan file yang diunggah
|
||||||
|
$file->storeAs('public/uploads_pdf', $filename);
|
||||||
} else {
|
} else {
|
||||||
Storage::copy('/home/bagi/Downloads/default.pdf', 'public/uploads_pdf/' . $filename);
|
// Salin file default ke lokasi yang diinginkan
|
||||||
|
Storage::copy('public/test/default.pdf', 'public/uploads_pdf/' . $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
dd($validate);
|
// Tambahkan nama file ke data yang divalidasi
|
||||||
KJPP::create($validate);
|
$validated['attachment'] = $filename;
|
||||||
|
|
||||||
|
// Simpan data ke database
|
||||||
|
KJPP::create($validated);
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('basicdata.kjpp.index')
|
->route('basicdata.kjpp.index')
|
||||||
->with('success', 'Ijin Usaha created successfully');
|
->with('success', 'KJPP created successfully');
|
||||||
|
} else {
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.kjpp.create')
|
||||||
|
->with('error', 'Validation failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +83,17 @@ class KJPPController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
return view('lpj::show');
|
$kjpp = KJPP::find($id);
|
||||||
|
$ijin_usaha = IjinUsaha::where('code', $kjpp->nomor_ijin_usaha)->get();
|
||||||
|
$ijin_usahas = IjinUsaha::all();
|
||||||
|
$jenis_jaminan = JenisJaminan::all();
|
||||||
|
$branches = Branch::where('name', $kjpp->jenis_kantor)->get();
|
||||||
|
$provinces = Province::where('code', $kjpp->province_code)->get();
|
||||||
|
$cities = City::where('code', $kjpp->city_code)->get();
|
||||||
|
$districts = District::where('code', $kjpp->district_code)->get();
|
||||||
|
$villages = Village::where('code', $kjpp->village_code)->get();
|
||||||
|
// dd($branches);
|
||||||
|
return view('lpj::kjpp.show', compact('jenis_jaminan', 'ijin_usahas', 'ijin_usaha', 'branches', 'kjpp', 'provinces', 'cities', 'districts', 'villages'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,15 +101,53 @@ class KJPPController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
return view('lpj::edit');
|
$kjpp = KJPP::find($id);
|
||||||
|
$branch = Branch::all();
|
||||||
|
$ijin_usaha = IjinUsaha::all();
|
||||||
|
$jenis_aset = JenisJaminan::all();
|
||||||
|
$provinces = Province::all();
|
||||||
|
$cities = City::where('province_code', $kjpp->province_code)->get();
|
||||||
|
$districts = District::where('city_code', $kjpp->city_code)->get();
|
||||||
|
$villages = Village::where('district_code', $kjpp->district_code)->get();
|
||||||
|
|
||||||
|
return view('lpj::kjpp.create', compact('kjpp', 'branch', 'ijin_usaha', 'jenis_aset', 'provinces', 'cities', 'districts', 'villages'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*/
|
*/
|
||||||
public function update(KJPP $request, $id)
|
public function update(KJPPRequest $request, $id)
|
||||||
{
|
{
|
||||||
//
|
$validated = $request->validated();
|
||||||
|
|
||||||
|
if ($validated) {
|
||||||
|
$file = $request->file('attachment');
|
||||||
|
$filename = $file ? time() . '.' . $file->getClientOriginalExtension() : null;
|
||||||
|
|
||||||
|
if ($file !== null) {
|
||||||
|
// Jika ada file dari database maka hapus file yang lama ke file yang baru
|
||||||
|
$kjpp = KJPP::find($id);
|
||||||
|
// Storage::delete('public/uploads_pdf/' . $kjpp->attachment);
|
||||||
|
// Simpan file yang diunggah
|
||||||
|
$file->storeAs('public/uploads_pdf', $filename);
|
||||||
|
$validated['attachment'] = $filename;
|
||||||
|
} else {
|
||||||
|
// Jika tidak ada file yang diunggah, gunakan file yang sudah ada atau file default
|
||||||
|
$kjpp = KJPP::find($id);
|
||||||
|
$validated['attachment'] = $kjpp->attachment ?? 'default.pdf';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perbarui data di database
|
||||||
|
KJPP::where('id', $id)->update($validated);
|
||||||
|
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.kjpp.index')
|
||||||
|
->with('success', 'KJPP updated successfully');
|
||||||
|
} else {
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.kjpp.edit', $id)
|
||||||
|
->with('error', 'Validation failed');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,7 +155,21 @@ class KJPPController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
//
|
try {
|
||||||
|
$kjpp = KJPP::find($id);
|
||||||
|
|
||||||
|
// Jangan hapus file default.pdf
|
||||||
|
if ($kjpp->attachment && $kjpp->attachment !== 'default.pdf') {
|
||||||
|
Storage::delete('public/uploads_pdf/' . $kjpp->attachment);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hapus data dari database
|
||||||
|
$kjpp->delete();
|
||||||
|
|
||||||
|
echo json_encode(['success' => true, 'message' => 'KJPP deleted successfully']);
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo json_encode(['success' => false, 'message' => 'Failed to delete branch: ' . $e]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
@@ -161,6 +236,6 @@ class KJPPController extends Controller
|
|||||||
|
|
||||||
public function export()
|
public function export()
|
||||||
{
|
{
|
||||||
return Excel::download(new KJPPExport, 'currency.xlsx');
|
return Excel::download(new KJPPExport, 'kjpp.xlsx');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ class KJPPRequest extends FormRequest
|
|||||||
'nomor_hp_pic_admin' => 'required|numeric|digits_between:10,15',
|
'nomor_hp_pic_admin' => 'required|numeric|digits_between:10,15',
|
||||||
'nama_pic_marketing' => 'required|string|not_regex:/^\d+$/|max:255',
|
'nama_pic_marketing' => 'required|string|not_regex:/^\d+$/|max:255',
|
||||||
'nomor_hp_pic_marketing' => 'required|numeric|digits_between:10,15',
|
'nomor_hp_pic_marketing' => 'required|numeric|digits_between:10,15',
|
||||||
'ijin_usaha.*' => 'nullable',
|
'ijin_usaha_id' => 'nullable',
|
||||||
'jenis_jaminan.*' => 'nullable',
|
'jenis_aset_id' => 'nullable',
|
||||||
'attachment' => 'nullable|mimes:pdf|max:1024'
|
'attachment' => 'nullable|mimes:pdf|max:1024'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -56,15 +56,6 @@ class KJPPRequest extends FormRequest
|
|||||||
|
|
||||||
public function prepareForValidation(): void
|
public function prepareForValidation(): void
|
||||||
{
|
{
|
||||||
if ($this->method() == 'POST') {
|
|
||||||
$this->merge([
|
|
||||||
'code' => IdGenerator::generate(
|
|
||||||
['table' => 'ijin_usaha', 'length' => 5, 'prefix' => 'IU', 'field' => 'code'],
|
|
||||||
['table' => 'jenis_jaminan', 'length' => 5, 'prefix' => 'JJ', 'field' => 'code'],
|
|
||||||
)
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->merge([
|
$this->merge([
|
||||||
'ijin_usaha_id' => json_encode($this->ijin_usaha_id),
|
'ijin_usaha_id' => json_encode($this->ijin_usaha_id),
|
||||||
'jenis_aset_id' => json_encode($this->jenis_aset_id)
|
'jenis_aset_id' => json_encode($this->jenis_aset_id)
|
||||||
|
|||||||
@@ -13,9 +13,4 @@ class Branch extends Base
|
|||||||
{
|
{
|
||||||
return $this->hasMany(Debiture::class, 'branch_id', 'id');
|
return $this->hasMany(Debiture::class, 'branch_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function kjpp()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(KJPP::class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,4 @@ class IjinUsaha extends Model
|
|||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['code', 'name'];
|
protected $fillable = ['code', 'name'];
|
||||||
|
|
||||||
// relasi ke kjpp
|
|
||||||
public function kjpp()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(KJPP::class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,4 @@ class JenisJaminan extends Base
|
|||||||
{
|
{
|
||||||
protected $table = 'jenis_jaminan';
|
protected $table = 'jenis_jaminan';
|
||||||
protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id'];
|
protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id'];
|
||||||
|
|
||||||
// relasi ke kjpp
|
|
||||||
public function kjpp()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(KJPP::class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace Modules\Lpj\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Modules\Location\Models\Province;
|
||||||
|
|
||||||
// use Modules\Lpj\Database\Factories\KJPPFactory;
|
// use Modules\Lpj\Database\Factories\KJPPFactory;
|
||||||
|
|
||||||
class KJPP extends Model
|
class KJPP extends Model
|
||||||
@@ -41,22 +43,4 @@ class KJPP extends Model
|
|||||||
'jenis_aset_id',
|
'jenis_aset_id',
|
||||||
'attachment'
|
'attachment'
|
||||||
];
|
];
|
||||||
|
|
||||||
// relasi ke branch
|
|
||||||
public function branch()
|
|
||||||
{
|
|
||||||
return $this->hasOne(Branch::class, 'jenis_kantor');
|
|
||||||
}
|
|
||||||
|
|
||||||
// relasi ke jenis aset
|
|
||||||
public function jenis_aset()
|
|
||||||
{
|
|
||||||
return $this->hasMany(JenisJaminan::class, 'jenis_aset_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// relasi ke ijin usaha
|
|
||||||
public function ijin_usaha()
|
|
||||||
{
|
|
||||||
return $this->hasMany(IjinUsaha::class, 'ijin_usaha_id');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
@if (isset($kjpp))
|
@if (isset($kjpp))
|
||||||
@foreach ($branch as $branches)
|
@foreach ($branch as $branches)
|
||||||
<option value="{{ $branches->name }}"
|
<option value="{{ $branches->name }}"
|
||||||
{{ old('jenis_kantor', $branches->name) == $branches->name ? 'selected' : '' }}>
|
{{ old('jenis_kantor', $kjpp->jenis_kantor) == $branches->name ? 'selected' : '' }}>
|
||||||
{{ $branches->name }}
|
{{ $branches->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
@if (isset($kjpp))
|
@if (isset($kjpp))
|
||||||
@foreach ($ijin_usaha as $branches)
|
@foreach ($ijin_usaha as $branches)
|
||||||
<option value="{{ $branches->code }}"
|
<option value="{{ $branches->code }}"
|
||||||
{{ old('nomor_ijin_usaha', $branches->code) == $branches->code ? 'selected' : '' }}>
|
{{ old('nomor_ijin_usaha', $kjpp->nomor_ijin_usaha) == $branches->code ? 'selected' : '' }}>
|
||||||
{{ $branches->code }}
|
{{ $branches->code }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -351,11 +351,11 @@
|
|||||||
@if (isset($kjpp->ijin_usaha_id))
|
@if (isset($kjpp->ijin_usaha_id))
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif
|
@if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif
|
||||||
value="{{ $row->code }}" name="ijin_usaha[]" />
|
value="{{ $row->code }}" name="ijin_usaha_id[]" />
|
||||||
@else
|
@else
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@if (in_array($row->code, old('ijin_usaha_id', []))) {{ 'checked' }} @endif
|
@if (in_array($row->code, old('ijin_usaha_id', []))) {{ 'checked' }} @endif
|
||||||
value="{{ $row->code }}" name="ijin_usaha[]" />
|
value="{{ $row->code }}" name="ijin_usaha_id[]" />
|
||||||
@endif
|
@endif
|
||||||
<span class="switch-label">
|
<span class="switch-label">
|
||||||
{{ $row->name }}
|
{{ $row->name }}
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Jenis Jaminan
|
Pengalaman (Jenis Aset)
|
||||||
</label>
|
</label>
|
||||||
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||||
@foreach ($jenis_aset as $row)
|
@foreach ($jenis_aset as $row)
|
||||||
@@ -374,11 +374,11 @@
|
|||||||
@if (isset($kjpp->jenis_aset_id))
|
@if (isset($kjpp->jenis_aset_id))
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif
|
@if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif
|
||||||
value="{{ $row->code }}" name="jenis_jaminan[]" />
|
value="{{ $row->code }}" name="jenis_aset_id[]" />
|
||||||
@else
|
@else
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@if (in_array($row->code, old('jenis_aset_id', []))) {{ 'checked' }} @endif
|
@if (in_array($row->code, old('jenis_aset_id', []))) {{ 'checked' }} @endif
|
||||||
value="{{ $row->code }}" name="jenis_jaminan[]" />
|
value="{{ $row->code }}" name="jenis_aset_id[]" />
|
||||||
@endif
|
@endif
|
||||||
<span class="switch-label">
|
<span class="switch-label">
|
||||||
{{ $row->name }}
|
{{ $row->name }}
|
||||||
@@ -392,6 +392,15 @@
|
|||||||
Attachment
|
Attachment
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
@if (isset($kjpp) && $kjpp->attachment)
|
||||||
|
<div class="mb-2">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">Lihat File:</p>
|
||||||
|
<a href="{{ asset('storage/uploads_pdf/' . $kjpp->attachment) }}"
|
||||||
|
class="btn btn-link" target="_blank">
|
||||||
|
{{ $kjpp->attachment }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
<input class="file-input @error('attachment') border-danger @enderror" name="attachment"
|
<input class="file-input @error('attachment') border-danger @enderror" name="attachment"
|
||||||
type="file" />
|
type="file" />
|
||||||
@error('attachment')
|
@error('attachment')
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
title: 'Action',
|
title: 'Action',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
return `<div class="flex flex-nowrap justify-center">
|
return `<div class="flex flex-nowrap justify-center">
|
||||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" href="basic-data/kjpp/${data.id}/show">
|
<a class="btn btn-sm btn-icon btn-clear btn-primary" href="basic-data/kjpp/${data.id}">
|
||||||
<i class="ki-filled ki-eye"></i>
|
<i class="ki-filled ki-eye"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/kjpp/${data.id}/edit">
|
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/kjpp/${data.id}/edit">
|
||||||
|
|||||||
195
resources/views/kjpp/show.blade.php
Normal file
195
resources/views/kjpp/show.blade.php
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
@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 pb-2.5">
|
||||||
|
<div class="card-header" id="basic_settings">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Show KJPP
|
||||||
|
</h3>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<a href="{{ route('basicdata.kjpp.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">
|
||||||
|
Nomor KJPP
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->code }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama KJPP
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->name }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">Jenis Kantor / Cabang</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||||
|
@foreach ($branches as $branch)
|
||||||
|
{{ $branch->name }}
|
||||||
|
@endforeach
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">Nomor Ijin Usaha</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||||
|
@foreach ($ijin_usaha as $iu)
|
||||||
|
{{ $iu->code }}
|
||||||
|
@endforeach
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Alamat Kantor
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->address }} , Kel.
|
||||||
|
@foreach ($villages as $village)
|
||||||
|
{{ $village->name }}
|
||||||
|
@endforeach , Kec.
|
||||||
|
@foreach ($districts as $district)
|
||||||
|
{{ $district->name }}
|
||||||
|
@endforeach ,
|
||||||
|
@foreach ($cities as $city)
|
||||||
|
{{ $city->name }}
|
||||||
|
@endforeach ,
|
||||||
|
@foreach ($provinces as $province)
|
||||||
|
{{ $province->name }}
|
||||||
|
@endforeach, Kode Pos.
|
||||||
|
@foreach ($villages as $village)
|
||||||
|
{{ $village->postal_code }}
|
||||||
|
@endforeach
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor Telepon Kantor
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_telepon_kantor }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Email Kantor
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->email_kantor }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama Pimpinan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pimpinan }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor HP Pimpinan
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pimpinan }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama PIC Reviewer
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_reviewer }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor HP PIC Reviewer
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_reviewer }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama PIC Admin
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_admin }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor HP PIC Admin
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_admin }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nama PIC Marketing
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nama_pic_marketing }}</p>
|
||||||
|
</div>
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Nomor HP PIC Marketing
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<p class="flex w-full text-gray-600 font-medium text-sm">{{ $kjpp->nomor_hp_pic_marketing }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Ijin Usaha
|
||||||
|
</label>
|
||||||
|
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||||
|
@foreach ($ijin_usahas as $row)
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" @if (in_array($row->code, old('ijin_usaha_id', json_decode($kjpp->ijin_usaha_id, true)))) {{ 'checked' }} @endif
|
||||||
|
value="{{ $row->code }}" name="ijin_usaha_id[]" disabled="" />
|
||||||
|
<span class="switch-label">
|
||||||
|
{{ $row->name }}
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Pengalaman (Jenis Aset)
|
||||||
|
</label>
|
||||||
|
<div class="grid grid-cols-3 lg:grid-cols-4 w-full gap-2.5">
|
||||||
|
@foreach ($jenis_jaminan as $row)
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" @if (in_array($row->code, old('jenis_aset_id', json_decode($kjpp->jenis_aset_id, true)))) {{ 'checked' }} @endif
|
||||||
|
value="{{ $row->code }}" name="jenis_aset_id[]" disabled="" />
|
||||||
|
<span class="switch-label">
|
||||||
|
{{ $row->name }}
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Attachment
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<div class="mb-2">
|
||||||
|
<a href="{{ asset('storage/uploads_pdf/' . $kjpp->attachment) }}" class="btn btn-link"
|
||||||
|
target="_blank">
|
||||||
|
{{ $kjpp->attachment }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
Reference in New Issue
Block a user