Compare commits
11 Commits
6378ba0f98
...
sementara
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aceff4f006 | ||
|
|
f402c0831a | ||
|
|
ceca0aa5e8 | ||
|
|
43361f81e7 | ||
|
|
58b53a0284 | ||
|
|
bb0da7626b | ||
|
|
8a6ab059f5 | ||
|
|
6cf4432642 | ||
|
|
7c5202021f | ||
|
|
e8a735e977 | ||
|
|
1c5b48ff1b |
83
Helpers/PdfHelper.php
Normal file
83
Helpers/PdfHelper.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Helpers;
|
||||||
|
|
||||||
|
class PdfHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Format text for PDF output to handle special characters
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function formatText($text)
|
||||||
|
{
|
||||||
|
if (empty($text)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Common problematic characters and their safe replacements
|
||||||
|
$replacements = [
|
||||||
|
'<' => '<',
|
||||||
|
'>' => '>',
|
||||||
|
'&' => '&',
|
||||||
|
'"' => '"',
|
||||||
|
"'" => ''',
|
||||||
|
'≤' => '≤',
|
||||||
|
'≥' => '≥',
|
||||||
|
'≠' => '!=',
|
||||||
|
'≈' => '~',
|
||||||
|
'×' => 'x',
|
||||||
|
'÷' => '/',
|
||||||
|
'–' => '-',
|
||||||
|
'—' => '-',
|
||||||
|
'' => '"',
|
||||||
|
'' => '"',
|
||||||
|
'' => "'",
|
||||||
|
'' => "'",
|
||||||
|
];
|
||||||
|
|
||||||
|
// First pass: replace with HTML entities
|
||||||
|
$safeText = str_replace(array_keys($replacements), array_values($replacements), $text);
|
||||||
|
|
||||||
|
// Ensure UTF-8 encoding
|
||||||
|
if (!mb_check_encoding($safeText, 'UTF-8')) {
|
||||||
|
$safeText = mb_convert_encoding($safeText, 'UTF-8', 'auto');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove any remaining non-ASCII characters that could cause issues
|
||||||
|
$safeText = preg_replace('/[^\x20-\x7E\xA0-\xFF]/', '', $safeText);
|
||||||
|
|
||||||
|
return $safeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format mathematical symbols to text representation
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function formatMathSymbols($text)
|
||||||
|
{
|
||||||
|
if (empty($text)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$mathReplacements = [
|
||||||
|
'<' => 'kurang dari',
|
||||||
|
'>' => 'lebih dari',
|
||||||
|
'<=' => 'kurang dari sama dengan',
|
||||||
|
'>=' => 'lebih dari sama dengan',
|
||||||
|
'!=' => 'tidak sama dengan',
|
||||||
|
'==' => 'sama dengan',
|
||||||
|
'≤' => 'kurang dari sama dengan',
|
||||||
|
'≥' => 'lebih dari sama dengan',
|
||||||
|
'≠' => 'tidak sama dengan',
|
||||||
|
'≈' => 'kira-kira',
|
||||||
|
'≡' => 'identik dengan',
|
||||||
|
'≅' => 'hampir sama dengan',
|
||||||
|
];
|
||||||
|
|
||||||
|
return str_replace(array_keys($mathReplacements), array_values($mathReplacements), $text);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
Http/Controllers/ImageController.php
Normal file
27
Http/Controllers/ImageController.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Routing\Controller;
|
||||||
|
use Modules\Lpj\app\Services\ImageResizeService;
|
||||||
|
|
||||||
|
class ImageController extends Controller
|
||||||
|
{
|
||||||
|
protected $imageService;
|
||||||
|
|
||||||
|
public function __construct(ImageResizeService $imageService)
|
||||||
|
{
|
||||||
|
$this->imageService = $imageService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show(Request $request, $path)
|
||||||
|
{
|
||||||
|
$width = $request->query('w');
|
||||||
|
$quality = $request->query('q', 80);
|
||||||
|
|
||||||
|
$resizedPath = $this->imageService->resize($path, $width, null, $quality);
|
||||||
|
|
||||||
|
return response()->file(storage_path('app/public/' . $resizedPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/.DS_Store
vendored
Normal file
BIN
app/.DS_Store
vendored
Normal file
Binary file not shown.
128
app/Exports/ReferensiLinkExport.php
Normal file
128
app/Exports/ReferensiLinkExport.php
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Exports;
|
||||||
|
|
||||||
|
use Modules\Lpj\app\Models\ReferensiLink;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithStyles;
|
||||||
|
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||||
|
|
||||||
|
class ReferensiLinkExport implements FromQuery, WithHeadings, WithMapping, WithStyles, ShouldAutoSize, WithColumnFormatting
|
||||||
|
{
|
||||||
|
protected $filters;
|
||||||
|
|
||||||
|
public function __construct($filters = [])
|
||||||
|
{
|
||||||
|
$this->filters = $filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query data yang akan diexport
|
||||||
|
*/
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
$query = ReferensiLink::with(['createdBy', 'updatedBy'])
|
||||||
|
->select('referensi_link.*');
|
||||||
|
|
||||||
|
// Apply filters
|
||||||
|
if (isset($this->filters['kategori']) && !empty($this->filters['kategori'])) {
|
||||||
|
$query->where('kategori', $this->filters['kategori']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->filters['status']) && $this->filters['status'] !== '') {
|
||||||
|
$query->where('is_active', $this->filters['status']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->filters['search']) && !empty($this->filters['search'])) {
|
||||||
|
$query->search($this->filters['search']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $query->ordered();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header kolom
|
||||||
|
*/
|
||||||
|
public function headings(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'No',
|
||||||
|
'Nama',
|
||||||
|
'Link',
|
||||||
|
'Kategori',
|
||||||
|
'Deskripsi',
|
||||||
|
'Status Aktif',
|
||||||
|
'Urutan',
|
||||||
|
'Dibuat Oleh',
|
||||||
|
'Diupdate Oleh',
|
||||||
|
'Tanggal Dibuat',
|
||||||
|
'Tanggal Diupdate',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mapping data untuk setiap baris
|
||||||
|
*/
|
||||||
|
public function map($referensiLink): array
|
||||||
|
{
|
||||||
|
static $rowNumber = 0;
|
||||||
|
$rowNumber++;
|
||||||
|
|
||||||
|
return [
|
||||||
|
$rowNumber,
|
||||||
|
$referensiLink->name,
|
||||||
|
$referensiLink->link,
|
||||||
|
$referensiLink->kategori ?? '-',
|
||||||
|
$referensiLink->deskripsi ?? '-',
|
||||||
|
$referensiLink->is_active ? 'Aktif' : 'Tidak Aktif',
|
||||||
|
$referensiLink->urutan,
|
||||||
|
$referensiLink->createdBy ? $referensiLink->createdBy->name : '-',
|
||||||
|
$referensiLink->updatedBy ? $referensiLink->updatedBy->name : '-',
|
||||||
|
$referensiLink->created_at->format('d-m-Y H:i:s'),
|
||||||
|
$referensiLink->updated_at->format('d-m-Y H:i:s'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Styling untuk worksheet
|
||||||
|
*/
|
||||||
|
public function styles(Worksheet $sheet)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Header styling
|
||||||
|
1 => [
|
||||||
|
'font' => ['bold' => true, 'size' => 12],
|
||||||
|
'fill' => ['fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'startColor' => ['rgb' => 'E2EFDA']],
|
||||||
|
'alignment' => ['horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER],
|
||||||
|
],
|
||||||
|
// Alternating row colors
|
||||||
|
'A2:K1000' => [
|
||||||
|
'fill' => ['fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'startColor' => ['rgb' => 'F8F9FA']],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format kolom
|
||||||
|
*/
|
||||||
|
public function columnFormats(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'F' => NumberFormat::FORMAT_DATE_DDMMYYYY, // Tanggal dibuat
|
||||||
|
'G' => NumberFormat::FORMAT_DATE_DDMMYYYY, // Tanggal diupdate
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom title untuk sheet
|
||||||
|
*/
|
||||||
|
public function title(): string
|
||||||
|
{
|
||||||
|
return 'Referensi Link';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
use Modules\Usermanagement\Models\User;
|
use Modules\Usermanagement\Models\User;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Modules\Lpj\Services\ImageResizeService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format tanggal ke dalam format Bahasa Indonesia
|
* Format tanggal ke dalam format Bahasa Indonesia
|
||||||
@@ -775,3 +776,20 @@
|
|||||||
Log::error('Tidak dapat memparsing timestamp dengan format apapun: "' . $timestamp . '"');
|
Log::error('Tidak dapat memparsing timestamp dengan format apapun: "' . $timestamp . '"');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('resize_image')) {
|
||||||
|
/**
|
||||||
|
* Merubah ukuran gambar secara on-the-fly dan mengembalikan path-nya.
|
||||||
|
*
|
||||||
|
* @param string $path Path asli gambar.
|
||||||
|
* @param int|null $width Lebar yang diinginkan.
|
||||||
|
* @param int|null $height Tinggi yang diinginkan (opsional, akan menjaga rasio aspek jika null).
|
||||||
|
* @param int $quality Kualitas gambar (1-100).
|
||||||
|
* @return string Path gambar yang sudah di-resize.
|
||||||
|
*/
|
||||||
|
function resize_image(string $path, ?int $width, ?int $height = null, int $quality = 80): string
|
||||||
|
{
|
||||||
|
|
||||||
|
return app(ImageResizeService::class)->resize($path, $width, $height, $quality);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
32
app/Http/Controllers/# Run on VM.sh
Normal file
32
app/Http/Controllers/# Run on VM.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Run on VM
|
||||||
|
rclone hashsum MD5 "gdrive:01_Data Mentah/itdel/bawang_putih/BPM1" --drive-shared-with-me --output-file itdel_bawang_putih_gdrive.txt
|
||||||
|
rclone hashsum MD5 "gcs:transit_bucket_ysds/itdel/BPM1" --output-file itdel_bawang_putih_gcs.txt
|
||||||
|
rclone check --checksum "gcs:transit_bucket_ysds/itdel/BPM1" "gdrive:01_Data Mentah/itdel/bawang_putih/BPM1" --drive-shared-with-me --combined="itdel_bawang_putih_cheksum_bucket_drive.txt" --log-file="itdel_bawang_putih_count_checksum_bucket_drive.txt"
|
||||||
|
# Run on Local Machine
|
||||||
|
rclone hashsum MD5 "/data/storageserver/0.RAW/WGS/revio call/Raw/itdel/bawang_putih/BPM1" --output-file itdel_bawang_putih_local.txt
|
||||||
|
rclone check --checksum "/data/storageserver/0.RAW/WGS/revio call/Raw/itdel/bawang_putih/BPM1" "gdrive:01_Data Mentah/itdel/bawang_putih/BPM1" --drive-shared-with-me --combined="itdel_bawang_putih_checksum_local_gdrive.txt" --log-file="itdel_bawang_putih_count_checksum_local_gdrive.txt"
|
||||||
|
|
||||||
|
# Run on VM
|
||||||
|
rclone hashsum MD5 "gdrive:01_Data Mentah/itdel/kemenyan" --drive-shared-with-me --output-file itdel_kemenyan_gdrive.txt
|
||||||
|
rclone hashsum MD5 "gcs:transit_bucket_ysds/itdel/kemenyan" --output-file itdel_kemenyan_gcs.txt
|
||||||
|
rclone check --checksum "gcs:transit_bucket_ysds/itdel/kemenyan" "gdrive:01_Data Mentah/itdel/kemenyan" --drive-shared-with-me --combined="itdel_kemenyan_checksum_bucket_drive.txt" --log-file="itdel_kemenyan_count_checksum_bucket_drive.txt"
|
||||||
|
# Run on Local Machine
|
||||||
|
rclone hashsum MD5 "/data/storageserver/0.RAW/WGS/revio call/Raw/itdel/kemenyan" --output-file itdel_kemenyan_local.txt
|
||||||
|
rclone check --checksum "/data/storageserver/0.RAW/WGS/revio call/Raw/itdel/kemenyan" "gdrive:01_Data Mentah/itdel/kemenyan" --drive-shared-with-me --combined="itdel_kemenyan_checksum_local_gdrive.txt" --log-file="itdel_kemenyan_count_checksum_local_gdrive.txt"
|
||||||
|
|
||||||
|
# Run on VM
|
||||||
|
rclone hashsum MD5 "gdrive:01_Data Mentah/ugm/prima/bawang_putih" --drive-shared-with-me --output-file ugm_prima_bawang_putih_gdrive.txt
|
||||||
|
rclone hashsum MD5 "gcs:transit_bucket_ysds/bawang_putih_prima_UGM" --output-file ugm_prima_bawang_putih_gcs.txt
|
||||||
|
rclone check --checksum "gcs:transit_bucket_ysds/bawang_putih_prima_UGM" "gdrive:01_Data Mentah/ugm/prima/bawang_putih" --drive-shared-with-me --combined="ugm_prima_bawang_putih_checksum_bucket_drive.txt" --log-file="ugm_prima_bawang_putih_count_checksum_bucket_drive.txt"
|
||||||
|
# Run on Local Machine
|
||||||
|
rclone hashsum MD5 "/data/storageserver/0.RAW/WGS/revio call/Raw/bawang_putih" --output-file ugm_prima_bawang_putih_local.txt
|
||||||
|
rclone check --checksum "/data/storageserver/0.RAW/WGS/revio call/Raw/bawang_putih" "gdrive:01_Data Mentah/ugm/prima/bawang_putih" --drive-shared-with-me --combined="ugm_prima_bawang_putih_checksum_local_gdrive.txt" --log-file="ugm_prima_bawang_putih_count_checksum_local_gdrive.txt"
|
||||||
|
|
||||||
|
|
||||||
|
# Run on VM
|
||||||
|
rclone hashsum MD5 "gdrive:01_Data Mentah/polije/netty/bawang_merah" --drive-shared-with-me --output-file polije_netty_bawang_merah_gdrive.txt
|
||||||
|
rclone hashsum MD5 "gcs:transit_bucket_ysds/bawang_merah_netty_polije" --output-file polije_netty_bawang_merah_gcs.txt
|
||||||
|
rclone check --checksum "gcs:transit_bucket_ysds/bawang_merah_netty_polije" "gdrive:01_Data Mentah/polije/netty/bawang_merah" --drive-shared-with-me --combined="polije_netty_bawang_merah_checksum_bucket_drive.txt" --log-file="polije_netty_bawang_merah_count_checksum_bucket_drive.txt"
|
||||||
|
# Run on Local Machine
|
||||||
|
rclone hashsum MD5 "/data/storageserver/0.RAW/WGS/revio call/Raw/bawang_merah" --output-file polije_netty_bawang_merah_local.txt
|
||||||
|
rclone check --checksum "/data/storageserver/0.RAW/WGS/revio call/Raw/bawang_merah" "gdrive:01_Data Mentah/polije/netty/bawang_merah" --drive-shared-with-me --combined="polije_netty_bawang_merah_checksum_local_gdrive.txt" --log-file="polije_netty_bawang_merah_count_checksum_local_gdrive.txt"
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
use Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Modules\Location\Models\Province;
|
use Modules\Location\Models\Province;
|
||||||
use Modules\Lpj\Http\Requests\BankDataRequest;
|
use Modules\Lpj\Http\Requests\BankDataRequest;
|
||||||
use Modules\Lpj\Models\BankData;
|
use Modules\Lpj\Models\BankData;
|
||||||
@@ -88,7 +88,8 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Invalid coordinates
|
// Invalid coordinates
|
||||||
Log::warning("Invalid coordinates: Lat: $_lat, Lng: $_lng");// Do something to handle this situation, such as logging an error or skipping the record
|
Log::warning("Invalid coordinates: Lat: $_lat, Lng: $_lng");
|
||||||
|
// Do something to handle this situation, such as logging an error or skipping the record
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +139,8 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Invalid coordinates
|
// Invalid coordinates
|
||||||
Log::warning("Invalid coordinates: Lat: $lat, Lng: $lng");// Do something to handle this situation, such as logging an error or skipping the record
|
Log::warning("Invalid coordinates: Lat: $lat, Lng: $lng");
|
||||||
|
// Do something to handle this situation, such as logging an error or skipping the record
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,6 +199,24 @@
|
|||||||
// Retrieve data from the database
|
// Retrieve data from the database
|
||||||
$query = BankData::query();
|
$query = BankData::query();
|
||||||
|
|
||||||
|
// Check if show_all parameter is set
|
||||||
|
$showAll = $request->has('show_all') && $request->get('show_all') === 'true';
|
||||||
|
|
||||||
|
// If show_all is true, we'll get all data without pagination
|
||||||
|
if ($showAll) {
|
||||||
|
// Get all records without pagination
|
||||||
|
$data = $query->get();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'data' => $data,
|
||||||
|
'recordsTotal' => $data->count(),
|
||||||
|
'recordsFiltered' => $data->count(),
|
||||||
|
'page' => 1,
|
||||||
|
'pageSize' => $data->count(),
|
||||||
|
'total' => 1
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// Apply search filter if provided
|
// Apply search filter if provided
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
@@ -252,8 +272,10 @@
|
|||||||
// Get the total count of records
|
// Get the total count of records
|
||||||
$totalRecords = $query->count();
|
$totalRecords = $query->count();
|
||||||
|
|
||||||
// Apply pagination if provided
|
// Apply pagination only if explicitly requested or not first load
|
||||||
if ($request->has('page') && $request->has('size')) {
|
$shouldPaginate = $request->has('page') && $request->has('size') && !$request->has('show_all');
|
||||||
|
|
||||||
|
if ($shouldPaginate) {
|
||||||
$page = $request->get('page');
|
$page = $request->get('page');
|
||||||
$size = $request->get('size');
|
$size = $request->get('size');
|
||||||
$offset = ($page - 1) * $size; // Calculate the offset
|
$offset = ($page - 1) * $size; // Calculate the offset
|
||||||
@@ -287,11 +309,11 @@
|
|||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Calculate the page count
|
// Calculate the page count (1 if showing all data)
|
||||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
$pageCount = $shouldPaginate ? ceil($totalRecords / $request->get('size')) : 1;
|
||||||
|
|
||||||
// Calculate the current page number
|
// Calculate the current page number
|
||||||
$currentPage = $request->get('page', 1);
|
$currentPage = $shouldPaginate ? $request->get('page', 1) : 1;
|
||||||
|
|
||||||
// Ensure current page doesn't exceed page count
|
// Ensure current page doesn't exceed page count
|
||||||
$currentPage = min($currentPage, $pageCount);
|
$currentPage = min($currentPage, $pageCount);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ use Illuminate\Http\Request;
|
|||||||
use Modules\Lpj\Models\CategoryDaftarPustaka;
|
use Modules\Lpj\Models\CategoryDaftarPustaka;
|
||||||
use Modules\Lpj\Services\DaftarPustakaService;
|
use Modules\Lpj\Services\DaftarPustakaService;
|
||||||
use Modules\Lpj\Http\Requests\DaftarPustakaRequest;
|
use Modules\Lpj\Http\Requests\DaftarPustakaRequest;
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class DaftarPustakaController extends Controller
|
class DaftarPustakaController extends Controller
|
||||||
{
|
{
|
||||||
@@ -22,7 +24,15 @@ class DaftarPustakaController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$categories = CategoryDaftarPustaka::all();
|
// Get categories with count of daftar pustaka
|
||||||
|
try {
|
||||||
|
$categories = CategoryDaftarPustaka::withCount('daftarPustaka')->get();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// Handle jika tabel belum ada atau error lainnya
|
||||||
|
Log::warning('Error loading categories with count: ' . $e->getMessage());
|
||||||
|
$categories = CategoryDaftarPustaka::get(); // Fallback tanpa count
|
||||||
|
}
|
||||||
|
|
||||||
$daftar_pustaka = $this->daftarPustaka->getAllDaftarPustaka($request);
|
$daftar_pustaka = $this->daftarPustaka->getAllDaftarPustaka($request);
|
||||||
|
|
||||||
return view('lpj::daftar-pustaka.index', [
|
return view('lpj::daftar-pustaka.index', [
|
||||||
|
|||||||
441
app/Http/Controllers/ReferensiLinkController.php
Normal file
441
app/Http/Controllers/ReferensiLinkController.php
Normal file
@@ -0,0 +1,441 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Modules\Lpj\Models\ReferensiLink;
|
||||||
|
use Modules\Lpj\Http\Requests\ReferensiLinkRequest;
|
||||||
|
use Modules\Lpj\Exports\ReferensiLinkExport;
|
||||||
|
use Modules\Lpj\Imports\ReferensiLinkImport;
|
||||||
|
|
||||||
|
class ReferensiLinkController extends Controller
|
||||||
|
{
|
||||||
|
public $user;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
$this->middleware(function ($request, $next) {
|
||||||
|
$this->user = auth()->user();
|
||||||
|
return $next($request);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.view', $this->user);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'title' => 'Referensi Link',
|
||||||
|
'subtitle' => 'Daftar Referensi Link',
|
||||||
|
'breadcrumb' => [
|
||||||
|
['url' => route('dashboard'), 'text' => 'Dashboard'],
|
||||||
|
['text' => 'Referensi Link']
|
||||||
|
],
|
||||||
|
'kategoriOptions' => $this->getKategoriOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('lpj::referensi_link.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.create', $this->user);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'title' => 'Tambah Referensi Link',
|
||||||
|
'subtitle' => 'Form Tambah Referensi Link Baru',
|
||||||
|
'breadcrumb' => [
|
||||||
|
['url' => route('dashboard'), 'text' => 'Dashboard'],
|
||||||
|
['url' => route('basicdata.referensi-link.index'), 'text' => 'Referensi Link'],
|
||||||
|
['text' => 'Tambah']
|
||||||
|
],
|
||||||
|
'kategoriOptions' => $this->getKategoriOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('lpj::referensi_link.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(ReferensiLinkRequest $request)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.create', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$validated = $request->validated();
|
||||||
|
|
||||||
|
// Set urutan otomatis jika belum diisi
|
||||||
|
if (empty($validated['urutan'])) {
|
||||||
|
$validated['urutan'] = ReferensiLink::max('urutan') + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$referensiLink = ReferensiLink::create($validated);
|
||||||
|
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.referensi-link.index')
|
||||||
|
->with('success', 'Referensi Link berhasil ditambahkan');
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->withInput()
|
||||||
|
->with('error', 'Gagal menambahkan Referensi Link: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.update', $this->user);
|
||||||
|
|
||||||
|
$referensiLink = ReferensiLink::findOrFail($id);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'title' => 'Edit Referensi Link',
|
||||||
|
'subtitle' => 'Form Edit Referensi Link',
|
||||||
|
'breadcrumb' => [
|
||||||
|
['url' => route('dashboard'), 'text' => 'Dashboard'],
|
||||||
|
['url' => route('basicdata.referensi-link.index'), 'text' => 'Referensi Link'],
|
||||||
|
['text' => 'Edit']
|
||||||
|
],
|
||||||
|
'referensiLink' => $referensiLink,
|
||||||
|
'kategoriOptions' => $this->getKategoriOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('lpj::referensi_link.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(ReferensiLinkRequest $request, $id)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.update', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$referensiLink = ReferensiLink::findOrFail($id);
|
||||||
|
$validated = $request->validated();
|
||||||
|
|
||||||
|
$referensiLink->update($validated);
|
||||||
|
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.referensi-link.index')
|
||||||
|
->with('success', 'Referensi Link berhasil diperbarui');
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->withInput()
|
||||||
|
->with('error', 'Gagal memperbarui Referensi Link: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.delete', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$referensiLink = ReferensiLink::findOrFail($id);
|
||||||
|
$referensiLink->delete();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'success' => true,
|
||||||
|
'message' => 'Referensi Link berhasil dihapus'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Gagal menghapus Referensi Link: ' . $e->getMessage()
|
||||||
|
], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Datatable API for KTDataTable
|
||||||
|
*/
|
||||||
|
public function dataTable(Request $request)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.view', $this->user);
|
||||||
|
|
||||||
|
$query = ReferensiLink::with(['createdBy', 'updatedBy'])
|
||||||
|
->select('referensi_link.*');
|
||||||
|
|
||||||
|
// Search
|
||||||
|
$search = $request->input('search');
|
||||||
|
if (!empty($search)) {
|
||||||
|
$query->where(function ($q) use ($search) {
|
||||||
|
$q->where('name', 'LIKE', "%{$search}%")
|
||||||
|
->orWhere('link', 'LIKE', "%{$search}%")
|
||||||
|
->orWhere('kategori', 'LIKE', "%{$search}%");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optional filters (support multiple request shapes)
|
||||||
|
$filters = $request->input('filters', []);
|
||||||
|
$kategori = $request->input('kategori', $filters['kategori'] ?? null);
|
||||||
|
if (!empty($kategori)) {
|
||||||
|
if (is_array($kategori)) {
|
||||||
|
$query->whereIn('kategori', $kategori);
|
||||||
|
} else {
|
||||||
|
$values = preg_split('/[,|]/', (string) $kategori, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
if (count($values) > 1) {
|
||||||
|
$query->whereIn('kategori', $values);
|
||||||
|
} else {
|
||||||
|
$query->where('kategori', $kategori);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$statusRaw = $request->input('status', $filters['status'] ?? $request->input('is_active'));
|
||||||
|
$statusParsed = $this->parseActiveFilter($statusRaw);
|
||||||
|
if ($statusParsed !== null) {
|
||||||
|
$query->where('is_active', $statusParsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sorting
|
||||||
|
$allowedSortFields = ['id', 'name', 'link', 'kategori', 'urutan', 'is_active', 'created_at', 'updated_at'];
|
||||||
|
$sortField = in_array($request->input('sortField', 'urutan'), $allowedSortFields, true)
|
||||||
|
? $request->input('sortField', 'urutan')
|
||||||
|
: 'urutan';
|
||||||
|
$sortOrder = strtolower($request->input('sortOrder', 'asc'));
|
||||||
|
if (in_array($sortOrder, ['asc', 'desc'], true)) {
|
||||||
|
$query->orderBy($sortField, $sortOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pagination
|
||||||
|
$page = max((int) $request->input('page', 1), 1);
|
||||||
|
$size = max((int) $request->input('size', 10), 1);
|
||||||
|
$totalRecords = (clone $query)->count();
|
||||||
|
$offset = ($page - 1) * $size;
|
||||||
|
$items = $query->skip($offset)->take($size)->get();
|
||||||
|
|
||||||
|
// Map data rows
|
||||||
|
$data = $items->map(function ($row) {
|
||||||
|
return [
|
||||||
|
'id' => $row->id,
|
||||||
|
'name' => $row->name,
|
||||||
|
'link' => '<a href="' . $row->link . '" target="_blank" class="text-primary">' . Str::limit($row->link, 50) . ' <i class="fas fa-external-link-alt"></i></a>',
|
||||||
|
'kategori' => $row->kategori,
|
||||||
|
'status_badge' => $row->status_badge,
|
||||||
|
'urutan' => $row->urutan,
|
||||||
|
'actions' => (
|
||||||
|
(auth()->user()->can('referensi-link.update') ? '<a class="dropdown-item" href="' . route('basicdata.referensi-link.edit', $row->id) . '"><i class="fas fa-edit"></i> Edit</a>' : '') .
|
||||||
|
(auth()->user()->can('referensi-link.delete') ? '<a class="dropdown-item text-danger" href="javascript:void(0)" onclick="deleteData(' . $row->id . ')"><i class="fas fa-trash"></i> Hapus</a>' : '')
|
||||||
|
),
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'draw' => (int) $request->input('draw'),
|
||||||
|
'recordsTotal' => $totalRecords,
|
||||||
|
'recordsFiltered' => $totalRecords,
|
||||||
|
'pageCount' => (int) ceil($totalRecords / $size),
|
||||||
|
'page' => $page,
|
||||||
|
'totalCount' => $totalRecords,
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export data to Excel
|
||||||
|
*/
|
||||||
|
public function export(Request $request)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.export', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$filename = 'referensi_link_' . date('YmdHis') . '.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new ReferensiLinkExport($request->all()), $filename);
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->with('error', 'Gagal export data: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show import form
|
||||||
|
*/
|
||||||
|
public function import()
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.import', $this->user);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'title' => 'Import Referensi Link',
|
||||||
|
'subtitle' => 'Import data Referensi Link dari Excel',
|
||||||
|
'breadcrumb' => [
|
||||||
|
['url' => route('dashboard'), 'text' => 'Dashboard'],
|
||||||
|
['url' => route('basicdata.referensi-link.index'), 'text' => 'Referensi Link'],
|
||||||
|
['text' => 'Import']
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('lpj::referensi_link.import', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process import
|
||||||
|
*/
|
||||||
|
public function importProcess(Request $request)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.import', $this->user);
|
||||||
|
|
||||||
|
$request->validate([
|
||||||
|
'file' => 'required|mimes:xlsx,xls|max:10240', // max 10MB
|
||||||
|
]);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$import = new ReferensiLinkImport();
|
||||||
|
Excel::import($import, $request->file('file'));
|
||||||
|
|
||||||
|
$stats = $import->getImportStats();
|
||||||
|
|
||||||
|
$message = "Import berhasil! {$stats['success']} data berhasil diimport";
|
||||||
|
if ($stats['failed'] > 0) {
|
||||||
|
$message .= ", {$stats['failed']} data gagal diimport";
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()
|
||||||
|
->route('basicdata.referensi-link.index')
|
||||||
|
->with('success', $message);
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Log::error('ReferensiLink import error: ' . $e->getMessage());
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->with('error', 'Gagal import data: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle status (active/inactive)
|
||||||
|
*/
|
||||||
|
public function toggleStatus($id)
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.update', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$referensiLink = ReferensiLink::findOrFail($id);
|
||||||
|
$referensiLink->is_active = !$referensiLink->is_active;
|
||||||
|
$referensiLink->save();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'success' => true,
|
||||||
|
'message' => 'Status berhasil diubah',
|
||||||
|
'status' => $referensiLink->is_active
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Gagal mengubah status: ' . $e->getMessage()
|
||||||
|
], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get kategori options for dropdown
|
||||||
|
*/
|
||||||
|
private function getKategoriOptions()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'regulasi' => 'Regulasi',
|
||||||
|
'panduan' => 'Panduan',
|
||||||
|
'prosedur' => 'Prosedur',
|
||||||
|
'formulir' => 'Formulir',
|
||||||
|
'laporan' => 'Laporan',
|
||||||
|
'lainnya' => 'Lainnya'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseActiveFilter($value): ?bool
|
||||||
|
{
|
||||||
|
if ($value === null || $value === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_bool($value)) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$val = strtolower(trim((string) $value));
|
||||||
|
|
||||||
|
if (in_array($val, ['1', 'true', 'aktif', 'active', 'yes', 'y'], true)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (in_array($val, ['0', 'false', 'tidak', 'inactive', 'nonaktif', 'no', 'n'], true)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download import template
|
||||||
|
*/
|
||||||
|
public function downloadTemplate()
|
||||||
|
{
|
||||||
|
//$this->authorize('referensi-link.import', $this->user);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$headers = [
|
||||||
|
'Nama',
|
||||||
|
'Link',
|
||||||
|
'Kategori',
|
||||||
|
'Deskripsi',
|
||||||
|
'Status Aktif',
|
||||||
|
'Urutan'
|
||||||
|
];
|
||||||
|
|
||||||
|
$filename = 'template_referensi_link_' . date('YmdHis') . '.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new class($headers) implements \Maatwebsite\Excel\Concerns\FromArray, \Maatwebsite\Excel\Concerns\WithHeadings {
|
||||||
|
private $headers;
|
||||||
|
|
||||||
|
public function __construct($headers)
|
||||||
|
{
|
||||||
|
$this->headers = $headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function array(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['Contoh Referensi', 'https://example.com', 'panduan', 'Deskripsi contoh referensi link', 'aktif', 1],
|
||||||
|
['Contoh Regulasi', 'https://regulasi.example.com', 'regulasi', 'Deskripsi regulasi', 'aktif', 2],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function headings(): array
|
||||||
|
{
|
||||||
|
return $this->headers;
|
||||||
|
}
|
||||||
|
}, $filename);
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return redirect()
|
||||||
|
->back()
|
||||||
|
->with('error', 'Gagal download template: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -883,11 +883,10 @@ class SurveyorController extends Controller
|
|||||||
$penilaian = Penilaian::findOrFail($id);
|
$penilaian = Penilaian::findOrFail($id);
|
||||||
|
|
||||||
$permohonan = Permohonan::where('nomor_registrasi', $penilaian->nomor_registrasi)->first();
|
$permohonan = Permohonan::where('nomor_registrasi', $penilaian->nomor_registrasi)->first();
|
||||||
;
|
|
||||||
if (Carbon::parse($validate['waktu_penilaian']) <= Carbon::parse($penilaian->tanggal_kunjungan)) {
|
if (Carbon::parse($validate['waktu_penilaian']) <= Carbon::parse($penilaian->tanggal_kunjungan)) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => 'Waktu penilaian harus lebih besar dari tanggal assign.'
|
'message' => 'Waktu penilaian harus lebih besar dari tanggal assign.'.$penilaian->tanggal_kunjungan.' '.$validate['waktu_penilaian']
|
||||||
], 422);
|
], 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
114
app/Http/Requests/ReferensiLinkRequest.php
Normal file
114
app/Http/Requests/ReferensiLinkRequest.php
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Http\Requests;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
class ReferensiLinkRequest extends FormRequest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the validation rules that apply to the request.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
$rules = [
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'link' => 'required|string|max:500',
|
||||||
|
'kategori' => 'nullable|string|max:100',
|
||||||
|
'deskripsi' => 'nullable|string|max:2000',
|
||||||
|
'is_active' => 'boolean',
|
||||||
|
'urutan' => 'nullable|integer|min:0',
|
||||||
|
];
|
||||||
|
|
||||||
|
// Validasi tambahan untuk link
|
||||||
|
$rules['link'] .= '|url';
|
||||||
|
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the user is authorized to make this request.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function authorize(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get custom messages for validator errors.
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
public function messages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name.required' => 'Nama referensi link wajib diisi',
|
||||||
|
'name.string' => 'Nama referensi link harus berupa teks',
|
||||||
|
'name.max' => 'Nama referensi link maksimal 255 karakter',
|
||||||
|
'link.required' => 'Link wajib diisi',
|
||||||
|
'link.string' => 'Link harus berupa teks',
|
||||||
|
'link.max' => 'Link maksimal 500 karakter',
|
||||||
|
'link.url' => 'Link harus berupa URL yang valid',
|
||||||
|
'kategori.string' => 'Kategori harus berupa teks',
|
||||||
|
'kategori.max' => 'Kategori maksimal 100 karakter',
|
||||||
|
'deskripsi.string' => 'Deskripsi harus berupa teks',
|
||||||
|
'deskripsi.max' => 'Deskripsi maksimal 2000 karakter',
|
||||||
|
'is_active.boolean' => 'Status aktif harus berupa ya/tidak',
|
||||||
|
'urutan.integer' => 'Urutan harus berupa angka',
|
||||||
|
'urutan.min' => 'Urutan minimal 0',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get custom attributes for validator errors.
|
||||||
|
*
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
public function attributes(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => 'Nama Referensi Link',
|
||||||
|
'link' => 'Link',
|
||||||
|
'kategori' => 'Kategori',
|
||||||
|
'deskripsi' => 'Deskripsi',
|
||||||
|
'is_active' => 'Status Aktif',
|
||||||
|
'urutan' => 'Urutan',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare the data for validation.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function prepareForValidation(): void
|
||||||
|
{
|
||||||
|
// Format link jika belum memiliki protocol
|
||||||
|
if ($this->has('link')) {
|
||||||
|
$link = $this->input('link');
|
||||||
|
if ($link && !preg_match('/^(https?:\/\/)/i', $link)) {
|
||||||
|
$this->merge([
|
||||||
|
'link' => 'https://' . $link
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default is_active jika tidak diset
|
||||||
|
if (!$this->has('is_active')) {
|
||||||
|
$this->merge([
|
||||||
|
'is_active' => true
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set default urutan jika tidak diset atau 0
|
||||||
|
if (!$this->has('urutan') || empty($this->input('urutan'))) {
|
||||||
|
$this->merge([
|
||||||
|
'urutan' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
166
app/Imports/ReferensiLinkImport.php
Normal file
166
app/Imports/ReferensiLinkImport.php
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Imports;
|
||||||
|
|
||||||
|
use Modules\Lpj\app\Models\ReferensiLink;
|
||||||
|
use Maatwebsite\Excel\Concerns\ToModel;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithValidation;
|
||||||
|
use Maatwebsite\Excel\Concerns\Importable;
|
||||||
|
use Maatwebsite\Excel\Concerns\SkipsFailures;
|
||||||
|
use Maatwebsite\Excel\Concerns\SkipsOnFailure;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithBatchInserts;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithChunkReading;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class ReferensiLinkImport implements ToModel, WithHeadingRow, WithValidation, SkipsOnFailure, WithBatchInserts, WithChunkReading
|
||||||
|
{
|
||||||
|
use Importable, SkipsFailures;
|
||||||
|
|
||||||
|
protected $importedCount = 0;
|
||||||
|
protected $failedCount = 0;
|
||||||
|
protected $errors = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert row to model
|
||||||
|
*/
|
||||||
|
public function model(array $row)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->importedCount++;
|
||||||
|
|
||||||
|
return new ReferensiLink([
|
||||||
|
'name' => $row['nama'] ?? $row['name'],
|
||||||
|
'link' => $this->formatLink($row['link'] ?? $row['url'] ?? ''),
|
||||||
|
'kategori' => $row['kategori'] ?? $row['category'] ?? 'lainnya',
|
||||||
|
'deskripsi' => $row['deskripsi'] ?? $row['description'] ?? null,
|
||||||
|
'is_active' => $this->parseStatus($row['status_aktif'] ?? $row['is_active'] ?? 'aktif'),
|
||||||
|
'urutan' => $this->parseUrutan($row['urutan'] ?? $row['order'] ?? 0),
|
||||||
|
'created_by' => Auth::id(),
|
||||||
|
'updated_by' => Auth::id(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->failedCount++;
|
||||||
|
$this->errors[] = "Baris {$row['row_number']}: " . $e->getMessage();
|
||||||
|
Log::error('Import ReferensiLink Error: ' . $e->getMessage(), ['row' => $row]);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation rules
|
||||||
|
*/
|
||||||
|
public function rules(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'nama' => 'required|string|max:255',
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
'link' => 'required|string|max:500',
|
||||||
|
'url' => 'required|string|max:500',
|
||||||
|
'kategori' => 'nullable|string|max:100',
|
||||||
|
'category' => 'nullable|string|max:100',
|
||||||
|
'deskripsi' => 'nullable|string|max:2000',
|
||||||
|
'description' => 'nullable|string|max:2000',
|
||||||
|
'status_aktif' => 'nullable|string|in:aktif,tidak aktif,1,0,true,false',
|
||||||
|
'is_active' => 'nullable|string|in:aktif,tidak aktif,1,0,true,false',
|
||||||
|
'urutan' => 'nullable|integer|min:0',
|
||||||
|
'order' => 'nullable|integer|min:0',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom validation messages
|
||||||
|
*/
|
||||||
|
public function customValidationMessages()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'nama.required' => 'Nama wajib diisi',
|
||||||
|
'name.required' => 'Nama wajib diisi',
|
||||||
|
'link.required' => 'Link wajib diisi',
|
||||||
|
'url.required' => 'Link wajib diisi',
|
||||||
|
'link.url' => 'Link harus berupa URL yang valid',
|
||||||
|
'url.url' => 'Link harus berupa URL yang valid',
|
||||||
|
'kategori.max' => 'Kategori maksimal 100 karakter',
|
||||||
|
'category.max' => 'Kategori maksimal 100 karakter',
|
||||||
|
'deskripsi.max' => 'Deskripsi maksimal 2000 karakter',
|
||||||
|
'description.max' => 'Deskripsi maksimal 2000 karakter',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Batch size for inserts
|
||||||
|
*/
|
||||||
|
public function batchSize(): int
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chunk size for reading
|
||||||
|
*/
|
||||||
|
public function chunkSize(): int
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format link to ensure it has protocol
|
||||||
|
*/
|
||||||
|
private function formatLink($link)
|
||||||
|
{
|
||||||
|
if (empty($link)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove any whitespace
|
||||||
|
$link = trim($link);
|
||||||
|
|
||||||
|
// Add protocol if not present
|
||||||
|
if (!preg_match('/^(https?:\/\/)/i', $link)) {
|
||||||
|
$link = 'https://' . $link;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $link;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse status value
|
||||||
|
*/
|
||||||
|
private function parseStatus($status)
|
||||||
|
{
|
||||||
|
if (empty($status)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$status = strtolower(trim($status));
|
||||||
|
|
||||||
|
return in_array($status, ['aktif', '1', 'true', 'yes', 'ya']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse order value
|
||||||
|
*/
|
||||||
|
private function parseUrutan($urutan)
|
||||||
|
{
|
||||||
|
if (empty($urutan)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int) $urutan;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get import statistics
|
||||||
|
*/
|
||||||
|
public function getImportStats(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'imported' => $this->importedCount,
|
||||||
|
'failed' => $this->failedCount,
|
||||||
|
'errors' => $this->errors,
|
||||||
|
'success' => $this->importedCount - $this->failedCount,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ class CategoryDaftarPustaka extends Model
|
|||||||
];
|
];
|
||||||
|
|
||||||
public function daftarPustaka(){
|
public function daftarPustaka(){
|
||||||
return $this->hasMany(DaftarPustaka::class);
|
return $this->hasMany(DaftarPustaka::class, 'category_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
152
app/Models/ReferensiLink.php
Normal file
152
app/Models/ReferensiLink.php
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Modules\Usermanagement\Models\User;
|
||||||
|
|
||||||
|
class ReferensiLink extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The table associated with the model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $table = 'referensi_link';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'link',
|
||||||
|
'kategori',
|
||||||
|
'deskripsi',
|
||||||
|
'is_active',
|
||||||
|
'urutan',
|
||||||
|
'created_by',
|
||||||
|
'updated_by',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $casts = [
|
||||||
|
'is_active' => 'boolean',
|
||||||
|
'urutan' => 'integer',
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boot the model.
|
||||||
|
*/
|
||||||
|
protected static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
|
||||||
|
static::creating(function ($model) {
|
||||||
|
if (Auth::check()) {
|
||||||
|
$model->created_by = Auth::id();
|
||||||
|
$model->updated_by = Auth::id();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
static::updating(function ($model) {
|
||||||
|
if (Auth::check()) {
|
||||||
|
$model->updated_by = Auth::id();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope untuk filter data aktif
|
||||||
|
*/
|
||||||
|
public function scopeActive($query)
|
||||||
|
{
|
||||||
|
return $query->where('is_active', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope untuk filter berdasarkan kategori
|
||||||
|
*/
|
||||||
|
public function scopeByKategori($query, $kategori)
|
||||||
|
{
|
||||||
|
return $query->where('kategori', $kategori);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope untuk urutkan berdasarkan urutan
|
||||||
|
*/
|
||||||
|
public function scopeOrdered($query)
|
||||||
|
{
|
||||||
|
return $query->orderBy('urutan', 'asc')->orderBy('name', 'asc');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope untuk pencarian
|
||||||
|
*/
|
||||||
|
public function scopeSearch($query, $search)
|
||||||
|
{
|
||||||
|
return $query->where(function ($q) use ($search) {
|
||||||
|
$q->where('name', 'like', "%{$search}%")
|
||||||
|
->orWhere('link', 'like', "%{$search}%")
|
||||||
|
->orWhere('kategori', 'like', "%{$search}%")
|
||||||
|
->orWhere('deskripsi', 'like', "%{$search}%");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Relasi ke user yang membuat
|
||||||
|
*/
|
||||||
|
public function createdBy()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Relasi ke user yang update
|
||||||
|
*/
|
||||||
|
public function updatedBy()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'updated_by');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor untuk status badge
|
||||||
|
*/
|
||||||
|
public function getStatusBadgeAttribute()
|
||||||
|
{
|
||||||
|
return $this->is_active
|
||||||
|
? '<span class="badge bg-success">Aktif</span>'
|
||||||
|
: '<span class="badge bg-danger">Tidak Aktif</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor untuk link yang diformat
|
||||||
|
*/
|
||||||
|
public function getFormattedLinkAttribute()
|
||||||
|
{
|
||||||
|
return $this->link ? url($this->link) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mutator untuk memastikan link valid
|
||||||
|
*/
|
||||||
|
public function setLinkAttribute($value)
|
||||||
|
{
|
||||||
|
// Validasi dan format link
|
||||||
|
if ($value && !preg_match('/^(https?:\/\/)/i', $value)) {
|
||||||
|
$value = 'https://' . $value;
|
||||||
|
}
|
||||||
|
$this->attributes['link'] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
73
app/Services/ImageResizeService.php
Normal file
73
app/Services/ImageResizeService.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Services;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Intervention\Image\Laravel\Facades\Image;
|
||||||
|
|
||||||
|
class ImageResizeService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Resize an image and store it.
|
||||||
|
*
|
||||||
|
* @param string $originalPath
|
||||||
|
* @param int $width
|
||||||
|
* @param int|null $height
|
||||||
|
* @param int $quality
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function resize(string $originalPath, ?int $width, ?int $height = null, int $quality = 80): string
|
||||||
|
{
|
||||||
|
if (empty($originalPath) || !Storage::disk('public')->exists($originalPath)) {
|
||||||
|
Log::warning("Image Service: Original path is empty or does not exist: {$originalPath}");
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$height = null;
|
||||||
|
|
||||||
|
$pathinfo = pathinfo($originalPath);
|
||||||
|
|
||||||
|
// Kembali menggunakan direktori 'resized' dan menyertakan dimensi di nama file
|
||||||
|
$resizedPath = "{$pathinfo['dirname']}/resized/{$pathinfo['filename']}_{$width}x{$height}_{$quality}.{$pathinfo['extension']}";
|
||||||
|
|
||||||
|
if (Storage::disk('public')->exists($resizedPath)) {
|
||||||
|
return $resizedPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$originalFullPath = Storage::disk('public')->path($originalPath);
|
||||||
|
$newFullPath = Storage::disk('public')->path($resizedPath);
|
||||||
|
|
||||||
|
$image = Image::read($originalFullPath);
|
||||||
|
|
||||||
|
// Resize dengan menjaga aspek rasio jika height null
|
||||||
|
if ($width && $height) {
|
||||||
|
// Paksa resize ke dimensi yang ditentukan, abaikan aspek rasio
|
||||||
|
$image->resize($width, $height);
|
||||||
|
} elseif ($width && !$height) {
|
||||||
|
// Resize hanya berdasarkan width, tinggi menyesuaikan aspek rasio
|
||||||
|
$image->scale(width: $width);
|
||||||
|
} elseif (!$width && $height) {
|
||||||
|
// Resize hanya berdasarkan height, lebar menyesuaikan aspek rasio
|
||||||
|
$image->scale(height: $height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!Storage::disk('public')->exists(dirname($resizedPath))) {
|
||||||
|
Storage::disk('public')->makeDirectory(dirname($resizedPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Simpan dengan kualitas yang ditentukan
|
||||||
|
$image->save($newFullPath, $quality);
|
||||||
|
|
||||||
|
Log::info("Image Service: Successfully resized {$originalPath} to {$resizedPath} with quality {$quality}%.");
|
||||||
|
|
||||||
|
return $resizedPath;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::error("Image Service: Resize failed for {$originalPath}. Error: " . $e->getMessage());
|
||||||
|
return $originalPath; // Fallback ke gambar asli jika gagal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -347,6 +347,7 @@ class PreviewLaporanService
|
|||||||
$pdf->setPaper('A4', 'portrait');
|
$pdf->setPaper('A4', 'portrait');
|
||||||
$pdf->set_option('isHtml5ParserEnabled', true);
|
$pdf->set_option('isHtml5ParserEnabled', true);
|
||||||
$pdf->set_option('isPhpEnabled', true);
|
$pdf->set_option('isPhpEnabled', true);
|
||||||
|
$pdf->set_option('dpi', '96');
|
||||||
|
|
||||||
return $pdf;
|
return $pdf;
|
||||||
}
|
}
|
||||||
|
|||||||
75
commit-message-staged.txt
Normal file
75
commit-message-staged.txt
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
🐛 fix(lpj): Perbaikan format Rupiah, role access, dan validasi data
|
||||||
|
|
||||||
|
## Ringkasan
|
||||||
|
Melakukan perbaikan pada helper format Rupiah, akses role user, validasi data MIG, serta penyesuaian tampilan laporan dan dokumentasi.
|
||||||
|
|
||||||
|
## Perubahan Detail
|
||||||
|
|
||||||
|
### 🔧 Helper Function
|
||||||
|
**app/Helpers/Lpj.php**:
|
||||||
|
- Menambahkan parameter opsional `withSymbol` pada fungsi `formatRupiah()` untuk kontrol simbol Rp
|
||||||
|
- Menambahkan handling untuk menghapus titik (.) dari input number sebelum proses
|
||||||
|
- Memperbaiki return value untuk null/empty string sesuai parameter `withSymbol`
|
||||||
|
- Mengganti `str_pad()` dengan `sprintf()` untuk generate random number (lebih efisien)
|
||||||
|
|
||||||
|
### 🛠️ Service Layer
|
||||||
|
**app/Services/PreviewLaporanService.php**:
|
||||||
|
- Memperbaiki validasi data MIG dengan menambahkan pengecekan `is_mig` flag
|
||||||
|
- Menambahkan null safety pada property `mig_mst_lpj_tot_nilai_pasar`
|
||||||
|
- Memperbaiki kondisi logic untuk memo dan validasi nilai pasar
|
||||||
|
|
||||||
|
### 🎨 View Components
|
||||||
|
**resources/views/component/print-out-dokument.blade.php**:
|
||||||
|
- Memperbaiki syntax Blade dari `@isset` menjadi `isset()` yang lebih proper
|
||||||
|
|
||||||
|
**resources/views/debitur/components/debitur.blade.php**:
|
||||||
|
- Memperbaiki role checking dari `hasRole()` menjadi `hasAnyRole()` untuk multiple roles
|
||||||
|
|
||||||
|
**resources/views/debitur/index.blade.php**:
|
||||||
|
- Menambahkan role 'admin' pada kondisi edit dan delete actions
|
||||||
|
- Memperbaiki permission checking untuk administrator dan admin
|
||||||
|
|
||||||
|
**resources/views/laporan/index.blade.php**:
|
||||||
|
- Menyederhanakan logic tombol laporan dan resume
|
||||||
|
- Menghapus logic role-based yang kompleks untuk tombol laporan
|
||||||
|
- Memperbaiki route URL untuk print-out laporan
|
||||||
|
- Menghapus function `generateLaporanButton()` yang tidak digunakan
|
||||||
|
|
||||||
|
**resources/views/penilai/components/lpj-sederhana-standar.blade.php**:
|
||||||
|
- Menambahkan role 'penilai' pada permission tombol simpan
|
||||||
|
|
||||||
|
**resources/views/penilai/components/print-out-sederhana.blade.php**:
|
||||||
|
- Memperbaiki tampilan data dokumen dengan menambahkan kolom nomor dokumen
|
||||||
|
- Mengganti `number_format()` dengan `formatRupiah()` untuk konsistensi format
|
||||||
|
- Menambahkan fallback untuk data tanah dan bangunan ketika `npw_tambahan` tidak tersedia
|
||||||
|
- Memperbaiki perhitungan total nilai pasar wajar dengan proper parsing
|
||||||
|
- Memperbaiki format tampilan nilai likuidasi
|
||||||
|
- Memperbaiki struktur HTML tabel untuk dokumentasi
|
||||||
|
|
||||||
|
**resources/views/penilai/components/signature-approval.blade.php**:
|
||||||
|
- Memperbaiki route dan parameter untuk approval signature
|
||||||
|
|
||||||
|
**resources/views/permohonan/index.blade.php**:
|
||||||
|
- Menambahkan role 'admin' pada permission actions
|
||||||
|
|
||||||
|
## Alasan Perubahan
|
||||||
|
1. **Format Rupiah**: Menambahkan fleksibilitas untuk menampilkan nominal dengan atau tanpa simbol Rp sesuai kebutuhan tampilan
|
||||||
|
2. **Validasi Data**: Memperkuat validasi data MIG untuk mencegah error pada data yang tidak lengkap
|
||||||
|
3. **Role Access**: Memperbaiki permission checking untuk mencakup role admin yang sebelumnya terlewat
|
||||||
|
4. **Tampilan Laporan**: Menyederhanakan UI dan memperbaiki format tampilan nilai untuk konsistensi
|
||||||
|
5. **Fallback Data**: Menambahkan handling untuk kasus data tidak lengkap pada laporan penilaian
|
||||||
|
|
||||||
|
## Dampak
|
||||||
|
- ✅ Format Rupiah lebih fleksibel dengan opsi simbol
|
||||||
|
- ✅ Validasi data MIG lebih kuat dan aman
|
||||||
|
- ✅ Role admin sekarang memiliki akses yang sesuai
|
||||||
|
- ✅ Tampilan laporan lebih konsisten dan rapi
|
||||||
|
- ✅ Penanganan error untuk data tidak lengkap lebih baik
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
Pastikan untuk:
|
||||||
|
1. Test format Rupiah dengan berbagai skenario (dengan/ tanpa simbol)
|
||||||
|
2. Test akses role admin pada semua fitur yang diperbarui
|
||||||
|
3. Test validasi data MIG dengan data lengkap dan tidak lengkap
|
||||||
|
4. Test tampilan laporan dengan data npw_tambahan kosong
|
||||||
|
5. Verifikasi perhitungan total nilai pasar wajar tetap akurat
|
||||||
BIN
database/.DS_Store
vendored
Normal file
BIN
database/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -0,0 +1,45 @@
|
|||||||
|
<?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('referensi_link', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name', 255)->nullable(false)->comment('Nama referensi link');
|
||||||
|
$table->text('link')->nullable(false)->comment('URL link referensi');
|
||||||
|
$table->string('kategori', 100)->nullable()->comment('Kategori referensi (misal: regulasi, panduan, dll)');
|
||||||
|
$table->text('deskripsi')->nullable()->comment('Deskripsi lengkap referensi');
|
||||||
|
$table->boolean('is_active')->default(true)->comment('Status aktif referensi');
|
||||||
|
$table->integer('urutan')->default(0)->comment('Urutan tampil referensi');
|
||||||
|
$table->unsignedBigInteger('created_by')->nullable()->comment('ID user yang membuat');
|
||||||
|
$table->unsignedBigInteger('updated_by')->nullable()->comment('ID user yang update terakhir');
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
// Indexes
|
||||||
|
$table->index('kategori');
|
||||||
|
$table->index('is_active');
|
||||||
|
$table->index('urutan');
|
||||||
|
$table->index('created_by');
|
||||||
|
|
||||||
|
// Foreign keys
|
||||||
|
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
|
||||||
|
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('referensi_link');
|
||||||
|
}
|
||||||
|
};
|
||||||
47
module.json
47
module.json
@@ -22,6 +22,7 @@
|
|||||||
"permission": "",
|
"permission": "",
|
||||||
"roles": [
|
"roles": [
|
||||||
"administrator",
|
"administrator",
|
||||||
|
"admin",
|
||||||
"pemohon-ao",
|
"pemohon-ao",
|
||||||
"pemohon-eo",
|
"pemohon-eo",
|
||||||
"DD Appraisal",
|
"DD Appraisal",
|
||||||
@@ -289,15 +290,7 @@
|
|||||||
"classes": "",
|
"classes": "",
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"permission": "",
|
"permission": "",
|
||||||
"roles": [
|
"roles": []
|
||||||
"administrator",
|
|
||||||
"admin",
|
|
||||||
"DD Appraisal",
|
|
||||||
"EO Appraisal",
|
|
||||||
"senior-officer",
|
|
||||||
"penilai",
|
|
||||||
"surveyor"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Data Permohonan",
|
"title": "Data Permohonan",
|
||||||
@@ -1230,21 +1223,43 @@
|
|||||||
"system": [
|
"system": [
|
||||||
{
|
{
|
||||||
"title": "Daftar Pustaka",
|
"title": "Daftar Pustaka",
|
||||||
"path": "daftar-pustaka",
|
"path": "",
|
||||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||||
"classes": "",
|
"classes": "",
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"permission": "",
|
"permission": "",
|
||||||
"roles": [
|
"roles": [
|
||||||
"administrator",
|
"administrator",
|
||||||
"pemohon-ao",
|
"admin"
|
||||||
"pemohon-eo",
|
],
|
||||||
"admin",
|
"sub": [
|
||||||
"DD Appraisal",
|
{
|
||||||
"EO Appraisal",
|
"title": "Daftar Pustaka",
|
||||||
"senior-officer"
|
"path": "daftar-pustaka",
|
||||||
|
"icon": "ki-filled ki-external-link text-lg text-primary",
|
||||||
|
"classes": "",
|
||||||
|
"attributes": [],
|
||||||
|
"permission": "",
|
||||||
|
"roles": [
|
||||||
|
"administrator",
|
||||||
|
"admin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Referensi Link",
|
||||||
|
"path": "basicdata.referensi-link",
|
||||||
|
"icon": "ki-filled ki-external-link text-lg text-primary",
|
||||||
|
"classes": "",
|
||||||
|
"attributes": [],
|
||||||
|
"permission": "",
|
||||||
|
"roles": [
|
||||||
|
"administrator",
|
||||||
|
"admin"
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
resources/.DS_Store
vendored
Normal file
BIN
resources/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -5,17 +5,47 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-5 lg:gap-7.5 mb-10">
|
<style>
|
||||||
|
.loading-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
display: none;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
.loading-spinner {
|
||||||
|
border: 4px solid #f3f3f3;
|
||||||
|
border-top: 4px solid #3498db;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
0% { transform: rotate(0deg); }
|
||||||
|
100% { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="loading-overlay" id="loadingOverlay">
|
||||||
|
<div class="loading-spinner"></div>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-1 gap-5 mb-10 lg:grid-cols-4 lg:gap-7.5">
|
||||||
<div class="col-span-1">
|
<div class="col-span-1">
|
||||||
<div class="card border border-agi-100 card-grid min-w-full">
|
<div class="min-w-full border card border-agi-100 card-grid">
|
||||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
Filter
|
Filter
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body px-5">
|
<div class="px-5 card-body">
|
||||||
<form id="filter-form">
|
<form id="filter-form">
|
||||||
<div class="grid gap-4 w-full p-5">
|
<div class="grid gap-4 p-5 w-full">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="kategori" class="block text-sm font-medium text-gray-700">Kategori</label>
|
<label for="kategori" class="block text-sm font-medium text-gray-700">Kategori</label>
|
||||||
@@ -77,14 +107,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||||
<input type="date" id="start_date" name="start_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
<input type="date" id="start_date" name="start_date" class="block px-3 py-2 mt-1 w-full bg-white rounded-md border border-gray-300 shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
||||||
<input type="date" id="end_date" name="end_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
<input type="date" id="end_date" name="end_date" class="block px-3 py-2 mt-1 w-full bg-white rounded-md border border-gray-300 shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="submit" class="w-full inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
<div class="flex items-center">
|
||||||
|
<input id="show_all" name="show_all" type="checkbox" class="w-4 h-4 text-indigo-600 bg-gray-100 rounded border-gray-300 focus:ring-indigo-500 focus:ring-2">
|
||||||
|
<label for="show_all" class="ml-2 text-sm font-medium text-gray-700">Tampilkan Semua Data</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button type="submit" class="inline-flex justify-center px-4 py-2 w-full text-sm font-medium text-white bg-indigo-600 rounded-md border border-transparent shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||||
Apply Filters
|
Apply Filters
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,21 +131,21 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-3">
|
<div class="col-span-3">
|
||||||
<div class="card border border-agi-100 card-grid min-w-full">
|
<div class="min-w-full border card border-agi-100 card-grid">
|
||||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
Maps
|
Maps
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body px-5">
|
<div class="px-5 card-body">
|
||||||
<div id="map" style="height: 700px; width: 100%;"></div>
|
<div id="map" style="height: 700px; width: 100%;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||||
<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="bank-data-table" data-api-url="{{ route('bank-data.datatables') }}">
|
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="bank-data-table" data-api-url="{{ route('bank-data.datatables') }}">
|
||||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
Daftar Bank Data
|
Daftar Bank Data
|
||||||
</h3>
|
</h3>
|
||||||
@@ -128,7 +164,7 @@
|
|||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="scrollable-x-auto">
|
<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">
|
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border" data-datatable-table="true">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="w-14">
|
<th class="w-14">
|
||||||
@@ -174,13 +210,13 @@
|
|||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</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-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex gap-2 items-center">
|
||||||
Show
|
Show
|
||||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||||
page
|
page
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex gap-4 items-center">
|
||||||
<span data-datatable-info="true"> </span>
|
<span data-datatable-info="true"> </span>
|
||||||
<div class="pagination" data-datatable-pagination="true">
|
<div class="pagination" data-datatable-pagination="true">
|
||||||
</div>
|
</div>
|
||||||
@@ -190,10 +226,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="imageModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
<div id="imageModal" class="hidden fixed inset-0 z-50 justify-center items-center bg-black bg-opacity-50">
|
||||||
<div class="bg-white p-4 rounded-lg max-w-3xl max-h-[100vh] overflow-auto">
|
<div class="bg-white p-4 rounded-lg max-w-3xl max-h-[100vh] overflow-auto">
|
||||||
<img id="modalImage" src="" alt="Zoomed Image" class="max-w-full h-auto">
|
<img id="modalImage" src="" alt="Zoomed Image" class="max-w-full h-auto">
|
||||||
<button id="closeModal" class="mt-4 px-4 py-2 bg-red-300 text-gray-800 rounded hover:bg-red-400" onclick="closeImageModal()">Close</button>
|
<button id="closeModal" class="px-4 py-2 mt-4 text-gray-800 bg-red-300 rounded hover:bg-red-400" onclick="closeImageModal()">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
@@ -261,8 +297,9 @@
|
|||||||
|
|
||||||
const markerColors = {
|
const markerColors = {
|
||||||
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
||||||
penilaian: 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
|
internal: 'http://maps.google.com/mapfiles/ms/icons/orange-dot.png',
|
||||||
input: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'
|
input: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png',
|
||||||
|
kjpp: 'http://maps.google.com/mapfiles/ms/icons/purple-dot.png'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lat && lng) {
|
if (lat && lng) {
|
||||||
@@ -277,95 +314,95 @@
|
|||||||
const contentString = `
|
const contentString = `
|
||||||
<div id='content' style='width: 550px; max-width: 100%;'>
|
<div id='content' style='width: 550px; max-width: 100%;'>
|
||||||
<div id='siteNotice'></div>
|
<div id='siteNotice'></div>
|
||||||
<h2 class='card-title mb-5'>
|
<h2 class='mb-5 card-title'>
|
||||||
${item.jenis_aset}
|
${item.jenis_aset}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid gap-3">
|
<div class="grid gap-3">
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Tanggal Penilaian
|
Tanggal Penilaian
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${window.formatTanggalIndonesia(item.tanggal)}
|
${window.formatTanggalIndonesia(item.tanggal)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Tahun
|
Tahun
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${item.tahun}
|
${item.tahun}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Luas Tanah
|
Luas Tanah
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${item.luas_tanah} m²
|
${item.luas_tanah} m²
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Luas Bangunan
|
Luas Bangunan
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${item.luas_bangunan} m²
|
${item.luas_bangunan} m²
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Harga
|
Harga
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${window.formatRupiah(item.harga)}
|
${window.formatRupiah(item.harga)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-center'>
|
||||||
<div class='flex items-center gap-1.5'>
|
<div class='flex gap-1.5 items-center'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Nilai Pasar
|
Nilai Pasar
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='lg:text-right'>
|
<span class='lg:text-right'>
|
||||||
${window.formatRupiah(item.nilai_pasar)}
|
${window.formatRupiah(item.nilai_pasar)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-t border-gray-300 border-dashed"></div>
|
<div class="border-t border-gray-300 border-dashed"></div>
|
||||||
<div class='flex items-start justify-between flex-wrap gap-1.5'>
|
<div class='flex flex-wrap gap-1.5 justify-between items-start'>
|
||||||
<div class='flex items-start gap-1.5'>
|
<div class='flex gap-1.5 items-start'>
|
||||||
<span class='text-sm font-normal text-gray-900'>
|
<span class='text-sm font-normal text-gray-900'>
|
||||||
Location
|
Location
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
<div class='flex gap-6 items-center text-sm font-medium text-gray-800'>
|
||||||
<span class='text-right whitespace-normal break-words'>
|
<span class='text-right whitespace-normal break-words'>
|
||||||
${item.address.split(' ').reduce((acc, word, index, array) => {
|
${item.address.split(' ').reduce((acc, word, index, array) => {
|
||||||
if (index > 0 && index % 7 === 0) {
|
if (index > 0 && index % 7 === 0) {
|
||||||
@@ -378,16 +415,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${item.photos && item.photos.length > 0 ? `
|
${item.photos && item.photos.length > 0 ? `
|
||||||
<div class="photo-gallery mb-5">
|
<div class="mb-5 photo-gallery">
|
||||||
<div class="main-photo mb-2">
|
<div class="mb-2 main-photo">
|
||||||
<img src="storage/${item.photos[0]}" alt="${item.jenis_aset}"
|
<img src="storage/${item.photos[0]}" alt="${item.jenis_aset}"
|
||||||
style="width: 100%; height: auto; object-fit: cover; cursor: pointer;"
|
style="width: 100%; height: auto; object-fit: cover; cursor: pointer;"
|
||||||
onclick="openImageModal(this.src)">
|
onclick="openImageModal(this.src)">
|
||||||
</div>
|
</div>
|
||||||
<div class="thumbnail-container flex gap-2 overflow-x-auto">
|
<div class="flex overflow-x-auto gap-2 thumbnail-container">
|
||||||
${item.photos.map((photo, index) => `
|
${item.photos.map((photo, index) => `
|
||||||
<img src="storage/${photo}" alt="${item.jenis_aset} ${index + 1}"
|
<img src="storage/${photo}" alt="${item.jenis_aset} ${index + 1}"
|
||||||
class="thumbnail cursor-pointer"
|
class="cursor-pointer thumbnail"
|
||||||
style="width: 60px; height: 60px; object-fit: cover;"
|
style="width: 60px; height: 60px; object-fit: cover;"
|
||||||
onclick="changeMainPhoto(this, ${index})">
|
onclick="changeMainPhoto(this, ${index})">
|
||||||
`).join('')}
|
`).join('')}
|
||||||
@@ -462,6 +499,16 @@
|
|||||||
const dataTableOptions = {
|
const dataTableOptions = {
|
||||||
apiEndpoint: apiUrl,
|
apiEndpoint: apiUrl,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
|
ajax: {
|
||||||
|
data: function(data) {
|
||||||
|
// Add show_all parameter if checkbox is checked
|
||||||
|
const showAllCheckbox = document.getElementById('show_all');
|
||||||
|
if (showAllCheckbox && showAllCheckbox.checked) {
|
||||||
|
data.show_all = true;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
},
|
||||||
columns: {
|
columns: {
|
||||||
select: {
|
select: {
|
||||||
render: (item, data, context) => {
|
render: (item, data, context) => {
|
||||||
@@ -535,11 +582,36 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filterForm = document.getElementById('filter-form');
|
const filterForm = document.getElementById('filter-form');
|
||||||
|
const loadingOverlay = document.getElementById('loadingOverlay');
|
||||||
|
|
||||||
|
function showLoading() {
|
||||||
|
loadingOverlay.style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideLoading() {
|
||||||
|
loadingOverlay.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
filterForm.addEventListener('submit', function (e) {
|
filterForm.addEventListener('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
showLoading();
|
||||||
|
|
||||||
const formData = new FormData(this);
|
const formData = new FormData(this);
|
||||||
const filters = Object.fromEntries(formData.entries());
|
const filters = Object.fromEntries(formData.entries());
|
||||||
|
|
||||||
|
// Check if show_all is checked
|
||||||
|
const showAllCheckbox = document.getElementById('show_all');
|
||||||
|
if (showAllCheckbox.checked) {
|
||||||
|
filters.show_all = true;
|
||||||
|
// Hide pagination controls when showing all data
|
||||||
|
document.querySelector('[data-datatable-pagination="true"]').style.display = 'none';
|
||||||
|
document.querySelector('[data-datatable-size="true"]').closest('div').style.display = 'none';
|
||||||
|
} else {
|
||||||
|
// Show pagination controls when using pagination
|
||||||
|
document.querySelector('[data-datatable-pagination="true"]').style.display = 'block';
|
||||||
|
document.querySelector('[data-datatable-size="true"]').closest('div').style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
// Apply the new search/filter
|
// Apply the new search/filter
|
||||||
if (filters) {
|
if (filters) {
|
||||||
dataTable.search(filters, true);
|
dataTable.search(filters, true);
|
||||||
@@ -547,16 +619,26 @@
|
|||||||
|
|
||||||
// Reload the table to apply the new filters
|
// Reload the table to apply the new filters
|
||||||
dataTable.reload();
|
dataTable.reload();
|
||||||
|
|
||||||
|
// Hide loading after a short delay to allow table to update
|
||||||
|
setTimeout(hideLoading, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
function updatePagination(response) {
|
function updatePagination(response) {
|
||||||
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
||||||
|
const showAllCheckbox = document.getElementById('show_all');
|
||||||
|
|
||||||
if (paginationInfo) {
|
if (paginationInfo) {
|
||||||
if (response.recordsFiltered > 0) {
|
if (response.recordsFiltered > 0) {
|
||||||
|
if (showAllCheckbox && showAllCheckbox.checked) {
|
||||||
|
// Show all data message when show_all is active
|
||||||
|
paginationInfo.textContent = `Showing all ${response.recordsFiltered} entries`;
|
||||||
|
} else {
|
||||||
|
// Normal pagination message
|
||||||
const start = (response.page - 1) * response.pageSize + 1;
|
const start = (response.page - 1) * response.pageSize + 1;
|
||||||
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
||||||
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
paginationInfo.textContent = 'No entries to show';
|
paginationInfo.textContent = 'No entries to show';
|
||||||
}
|
}
|
||||||
@@ -567,6 +649,17 @@
|
|||||||
initMap();
|
initMap();
|
||||||
initializeDataTable();
|
initializeDataTable();
|
||||||
|
|
||||||
|
// Load all data on first initialization
|
||||||
|
setTimeout(() => {
|
||||||
|
const showAllCheckbox = document.getElementById('show_all');
|
||||||
|
showAllCheckbox.checked = true; // Check the show all checkbox by default
|
||||||
|
|
||||||
|
// Trigger filter submit to load all data
|
||||||
|
const filterForm = document.getElementById('filter-form');
|
||||||
|
const event = new Event('submit');
|
||||||
|
filterForm.dispatchEvent(event);
|
||||||
|
}, 500);
|
||||||
|
|
||||||
dataTable.on('draw', () => {
|
dataTable.on('draw', () => {
|
||||||
console.log("Table redrawn");
|
console.log("Table redrawn");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -302,9 +302,20 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Tambahkan event listener untuk currency format
|
// Tambahkan event listener untuk currency format
|
||||||
newNPWRow.querySelectorAll('.currency-format').forEach(input => {
|
newNPWRow.querySelectorAll('.currency').forEach(input => {
|
||||||
input.addEventListener('input', function() {
|
input.addEventListener('change', function() {
|
||||||
formatCurrency(this);
|
window.IMask(this, {
|
||||||
|
mask: Number, // enable number mask
|
||||||
|
// other options are optional with defaults below
|
||||||
|
scale: 0, // digits after point, 0 for integers
|
||||||
|
thousandsSeparator: ".", // any single char
|
||||||
|
padFractionalZeros: false, // if true, then pads zeros at end to the length of scale
|
||||||
|
normalizeZeros: true, // appends or removes zeros at ends
|
||||||
|
radix: ",", // fractional delimiter
|
||||||
|
mapToRadix: ["."], // symbols to process as radix
|
||||||
|
|
||||||
|
autofix: true,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -355,7 +366,7 @@
|
|||||||
class="w-full currency"
|
class="w-full currency"
|
||||||
name="nilai_npw_${npwCounter}_1"
|
name="nilai_npw_${npwCounter}_1"
|
||||||
placeholder="Harga per meter"
|
placeholder="Harga per meter"
|
||||||
value="${npw.nilai_1 || ''}"
|
value="${npw.nilai_1 || '0'}"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -387,10 +398,36 @@
|
|||||||
calculateTotal();
|
calculateTotal();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Tambahkan event listener untuk currency format
|
// Initialize currency formatting for existing values
|
||||||
newNPWRow.querySelectorAll('.currency-format').forEach(input => {
|
newNPWRow.querySelectorAll('.currency').forEach(input => {
|
||||||
input.addEventListener('input', function() {
|
// Apply IMask immediately for existing values
|
||||||
formatCurrency(this);
|
if (input.value && input.value !== '0') {
|
||||||
|
window.IMask(input, {
|
||||||
|
mask: Number,
|
||||||
|
scale: 0,
|
||||||
|
thousandsSeparator: ".",
|
||||||
|
padFractionalZeros: false,
|
||||||
|
normalizeZeros: true,
|
||||||
|
radix: ",",
|
||||||
|
mapToRadix: ["."],
|
||||||
|
autofix: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also add blur event for future editing
|
||||||
|
input.addEventListener('blur', function() {
|
||||||
|
if (!this.imask) {
|
||||||
|
window.IMask(this, {
|
||||||
|
mask: Number,
|
||||||
|
scale: 0,
|
||||||
|
thousandsSeparator: ".",
|
||||||
|
padFractionalZeros: false,
|
||||||
|
normalizeZeros: true,
|
||||||
|
radix: ",",
|
||||||
|
mapToRadix: ["."],
|
||||||
|
autofix: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -406,7 +443,7 @@
|
|||||||
|
|
||||||
// Panggil fungsi load NPW saat halaman dimuat
|
// Panggil fungsi load NPW saat halaman dimuat
|
||||||
loadSavedNPW();
|
loadSavedNPW();
|
||||||
document.querySelectorAll('.currency-format').forEach(input => {
|
document.querySelectorAll('.currency').forEach(input => {
|
||||||
input.addEventListener('input', function() {
|
input.addEventListener('input', function() {
|
||||||
formatCurrency(this);
|
formatCurrency(this);
|
||||||
});
|
});
|
||||||
@@ -492,7 +529,7 @@
|
|||||||
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
||||||
|
|
||||||
if (luasInput && nilaiInput && outputElement) {
|
if (luasInput && nilaiInput && outputElement) {
|
||||||
const luas = parseInput(luasInput.value);
|
const luas = parseFloat(luasInput.value.replace(/[^0-9.]/g, '')) || 0;
|
||||||
const nilai = parseInput(nilaiInput.value);
|
const nilai = parseInput(nilaiInput.value);
|
||||||
const hasil = luas * nilai;
|
const hasil = luas * nilai;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,78 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<style>
|
<style>
|
||||||
|
/* Styling untuk sidebar kategori */
|
||||||
|
.category-sidebar {
|
||||||
|
background: #f8fafc;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 1.5rem;
|
||||||
|
height: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
margin: 0.25rem 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-item:hover {
|
||||||
|
background: #e2e8f0;
|
||||||
|
border-color: #cbd5e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-item.active {
|
||||||
|
background: #3b82f6;
|
||||||
|
color: white;
|
||||||
|
border-color: #2563eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-count {
|
||||||
|
background: #e2e8f0;
|
||||||
|
color: #64748b;
|
||||||
|
padding: 0.25rem 0.5rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-item.active .category-count {
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-title {
|
||||||
|
font-size: 1.125rem;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Loading state */
|
||||||
|
body.loading {
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.loading * {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.category-sidebar {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-item {
|
||||||
|
padding: 0.5rem 0.75rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
#previewContent {
|
#previewContent {
|
||||||
height: 400px;
|
height: 400px;
|
||||||
@@ -15,6 +87,33 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-7 lg:flex-row">
|
||||||
|
<!-- Sidebar Kategori -->
|
||||||
|
<div class="w-full lg:w-80">
|
||||||
|
<div class="category-sidebar">
|
||||||
|
<h3 class="sidebar-title">
|
||||||
|
<i class="mr-2 ki-filled ki-category"></i>
|
||||||
|
Kategori
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<!-- Semua Kategori -->
|
||||||
|
<div class="category-item {{ !request('category') ? 'active' : '' }}" onclick="filterByCategory('', 'Semua Kategori')">
|
||||||
|
<span>Semua Kategori</span>
|
||||||
|
<span class="category-count">{{ $total ?? 0 }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Daftar Kategori -->
|
||||||
|
@foreach ($categories as $category)
|
||||||
|
<div class="category-item {{ request('category') == $category->id ? 'active' : '' }}" onclick="filterByCategory({{ $category->id }}, '{{ $category->name }}')">
|
||||||
|
<span>{{ $category->name }}</span>
|
||||||
|
<span class="category-count">{{ $category->daftarPustaka_count ?? 0 }}</span>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Konten Utama -->
|
||||||
|
<div class="flex-1">
|
||||||
<div class="flex flex-col gap-7 items-stretch">
|
<div class="flex flex-col gap-7 items-stretch">
|
||||||
<div class="flex gap-3 items-center w-full">
|
<div class="flex gap-3 items-center w-full">
|
||||||
<div class="w-full input">
|
<div class="w-full input">
|
||||||
@@ -43,12 +142,6 @@
|
|||||||
{{ $total }} items.
|
{{ $total }} items.
|
||||||
</h3>
|
</h3>
|
||||||
<div class="flex gap-2.5">
|
<div class="flex gap-2.5">
|
||||||
<select id="category_id" name="category_id" class="select tomselect w-[300px]" multiple>
|
|
||||||
<option value="" selected disabled>Filter by Category</option>
|
|
||||||
@foreach ($categories as $item)
|
|
||||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
<div class="flex toggle-group" data-kt-tabs="true" data-kt-tabs-initialized="true">
|
<div class="flex toggle-group" data-kt-tabs="true" data-kt-tabs-initialized="true">
|
||||||
<a class="btn btn-icon active selected" data-kt-tab-toggle="#daftar_pustaka_grid" onclick="showGrid()"
|
<a class="btn btn-icon active selected" data-kt-tab-toggle="#daftar_pustaka_grid" onclick="showGrid()"
|
||||||
href="javascript:void(0)">
|
href="javascript:void(0)">
|
||||||
@@ -74,8 +167,8 @@
|
|||||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-3 lg:grid-cols-4" id="daftar_pustaka_grid">
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-3 lg:grid-cols-4" id="daftar_pustaka_grid">
|
||||||
@if (isset($daftar_pustaka))
|
@if (isset($daftar_pustaka))
|
||||||
@foreach ($daftar_pustaka as $item)
|
@foreach ($daftar_pustaka as $item)
|
||||||
<div class="border shadow-none card">
|
<div class="flex flex-col border shadow-none card">
|
||||||
<a class="show-pustaka h-[300px] bg-gray-200 w-full block" href="{{ route('daftar-pustaka.show', $item->id) }}"
|
<a class="show-pustaka h-[150px] bg-gray-200 w-full block" href="{{ route('daftar-pustaka.show', $item->id) }}"
|
||||||
data-url="{{ $item->attachment }}">
|
data-url="{{ $item->attachment }}">
|
||||||
<div class="flex overflow-hidden justify-center items-center p-4 w-full h-full">
|
<div class="flex overflow-hidden justify-center items-center p-4 w-full h-full">
|
||||||
<div class="flex justify-center items-center text-red-500 rounded">
|
<div class="flex justify-center items-center text-red-500 rounded">
|
||||||
@@ -84,39 +177,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="flex flex-col flex-grow p-4 card-body">
|
||||||
|
<div>
|
||||||
|
<p class="text-xs text-gray-700 badge badge-xs badge-outline badge-success">
|
||||||
|
# {{ $item->category->name }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex-grow mt-2">
|
||||||
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
||||||
|
<h3 class="text-sm font-bold text-gray-900 hover:text-primary">
|
||||||
<h3 class="font-medium text-gray-900 cursor-pointer text-md hover:text-primary">
|
|
||||||
{{ $item->judul }}</h3>
|
{{ $item->judul }}</h3>
|
||||||
<p class="text-gray-700 text-2sm">
|
<p class="text-xs text-gray-700">
|
||||||
{{-- batasi panjang deskripsi 50 --}}
|
{{-- batasi panjang deskripsi 50 --}}
|
||||||
{{ substr($item->deskripsi, 0, 50) }}
|
{{ substr($item->deskripsi, 0, 50) }}
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
<div class="flex gap-2.5 justify-between items-center mt-2">
|
</div>
|
||||||
<p class="text-xs text-gray-700 rounded-full badge badge-xs badge-outline badge-success">
|
|
||||||
# {{ $item->category->name }}</p>
|
|
||||||
|
|
||||||
@auth
|
|
||||||
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
||||||
<div>
|
<div class="flex gap-2 items-center mt-5">
|
||||||
<a class="btn btn-xs btn-danger" onclick="deleteData({{ $item->id }})">
|
<a class="w-full text-center btn btn-xs btn-danger" onclick="deleteData({{ $item->id }})">
|
||||||
<i class="ki-filled ki-trash">
|
<i class="ki-filled ki-trash"></i>
|
||||||
</i>
|
|
||||||
Hapus
|
Hapus
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-xs btn-info"
|
<a class="w-full text-center btn btn-xs btn-primary" href="{{ route('daftar-pustaka.edit', $item->id) }}">
|
||||||
href="{{ route('daftar-pustaka.edit', $item->id) }}">
|
<i class="ki-filled ki-pencil"></i>
|
||||||
<i class="ki-filled ki-pencil">
|
|
||||||
</i>
|
|
||||||
Edit
|
Edit
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endauth
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -143,9 +230,11 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
||||||
<div class="flex flex-col gap-2 cursor-pointer">
|
<div class="flex flex-col cursor-pointer">
|
||||||
<div class="flex items-center mt-1">
|
<p class="text-xs text-gray-700 badge badge-xs badge-outline badge-success">
|
||||||
<a class="text-sm font-medium hover:text-primary text-mono leading-5.5">
|
# {{ $item->category->name }}</p>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<a class="text-sm font-bold hover:text-primary text-mono leading-5.5">
|
||||||
{{ $item->judul }}
|
{{ $item->judul }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -161,8 +250,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-1.5 items-center">
|
<div class="flex gap-1.5 items-center">
|
||||||
<p class="text-xs text-gray-700 rounded-full badge badge-sm badge-outline badge-success">
|
|
||||||
# {{ $item->category->name }}</p>
|
|
||||||
@auth
|
@auth
|
||||||
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
||||||
<div>
|
<div>
|
||||||
@@ -277,14 +364,18 @@
|
|||||||
function filterSearch() {
|
function filterSearch() {
|
||||||
const search = document.getElementById('search')?.value || '';
|
const search = document.getElementById('search')?.value || '';
|
||||||
|
|
||||||
const select = document.getElementById('category_id');
|
const params = new URLSearchParams(window.location.search);
|
||||||
const selectedCategories = Array.from(select.selectedOptions).map(option => option.value);
|
|
||||||
|
|
||||||
const categoryParam = selectedCategories.join(',');
|
if (search) {
|
||||||
|
params.set('search', search);
|
||||||
|
} else {
|
||||||
|
params.delete('search');
|
||||||
|
}
|
||||||
|
|
||||||
const url = "{{ route('daftar-pustaka.index') }}?search=" + encodeURIComponent(search) + "&category=" +
|
// Reset to first page when searching
|
||||||
encodeURIComponent(categoryParam);
|
params.set('page', '1');
|
||||||
window.location.href = url;
|
|
||||||
|
window.location.href = `{{ route('daftar-pustaka.index') }}?${params.toString()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -292,5 +383,37 @@
|
|||||||
const url = "{{ route('daftar-pustaka.index') }}";
|
const url = "{{ route('daftar-pustaka.index') }}";
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterByCategory(categoryId, categoryName) {
|
||||||
|
// Add loading state
|
||||||
|
document.body.classList.add('loading');
|
||||||
|
|
||||||
|
// Update active state
|
||||||
|
document.querySelectorAll('.category-item').forEach(item => {
|
||||||
|
item.classList.remove('active');
|
||||||
|
});
|
||||||
|
event.currentTarget.classList.add('active');
|
||||||
|
|
||||||
|
// Get current search parameter
|
||||||
|
const search = document.getElementById('search')?.value || '';
|
||||||
|
|
||||||
|
// Build URL with category parameter
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
if (search) {
|
||||||
|
params.set('search', search);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (categoryId) {
|
||||||
|
params.set('category', categoryId);
|
||||||
|
} else {
|
||||||
|
params.delete('category');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset to first page when filtering
|
||||||
|
params.set('page', '1');
|
||||||
|
|
||||||
|
window.location.href = `{{ route('daftar-pustaka.index') }}?${params.toString()}`;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_jalan_utama'] ?? '-' }}</td>
|
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_jalan_utama'] ?? '-' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 2px; vertical-align: top;">Jalan Lingkungan</td>
|
<td style="padding: 2px; vertical-align: top;">Jalan Utama</td>
|
||||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jalan_linkungan'] ?? '-' }}</td>
|
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jalan_linkungan'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 2px; vertical-align: top;">Jarak CBD</td>
|
<td style="padding: 2px; vertical-align: top;">Jarak CBD</td>
|
||||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||||
|
|||||||
@@ -112,7 +112,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Tusuk Sate</td>
|
<td>Tusuk Sate</td>
|
||||||
<td>:</td>
|
<td>:</td>
|
||||||
|
|||||||
@@ -136,6 +136,7 @@
|
|||||||
$fallbackPath = null;
|
$fallbackPath = null;
|
||||||
|
|
||||||
// Jika file asli tidak ditemukan, buat fallback path
|
// Jika file asli tidak ditemukan, buat fallback path
|
||||||
|
|
||||||
if ($statusLpj == 1) {
|
if ($statusLpj == 1) {
|
||||||
$fullOriginalPath = storage_path('app/public/' . $originalPath);
|
$fullOriginalPath = storage_path('app/public/' . $originalPath);
|
||||||
|
|
||||||
@@ -154,10 +155,9 @@
|
|||||||
? $fallbackPath
|
? $fallbackPath
|
||||||
: $originalPath;
|
: $originalPath;
|
||||||
|
|
||||||
$filePath =
|
$resizedPath = resize_image($pathToUse, 800, 400, 25);
|
||||||
$statusLpj == 1
|
|
||||||
? storage_path('app/public/' . $pathToUse)
|
$filePath = storage_path('app/public/' . $resizedPath);
|
||||||
: asset('storage/' . $pathToUse);
|
|
||||||
|
|
||||||
$extension = strtolower(pathinfo($pathToUse, PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($pathToUse, PATHINFO_EXTENSION));
|
||||||
$isImage = in_array($extension, [
|
$isImage = in_array($extension, [
|
||||||
@@ -248,12 +248,16 @@
|
|||||||
style="align-content: center; text-align: center; margin-bottom: 20px">
|
style="align-content: center; text-align: center; margin-bottom: 20px">
|
||||||
@foreach ($chunkedPhotos as $item)
|
@foreach ($chunkedPhotos as $item)
|
||||||
@php
|
@php
|
||||||
|
$originalPath = $item['path'];
|
||||||
|
$resizedPath = resize_image($originalPath, 800, 400, 25);
|
||||||
|
|
||||||
|
|
||||||
$filePath =
|
$filePath =
|
||||||
$statusLpj == 1
|
$statusLpj == 1
|
||||||
? storage_path('app/public/' . $item['path'])
|
? storage_path('app/public/' . $resizedPath)
|
||||||
: asset('storage/' . $item['path']);
|
: asset('storage/' . $resizedPath);
|
||||||
|
|
||||||
$extension = strtolower(pathinfo($item['path'], PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($originalPath, PATHINFO_EXTENSION));
|
||||||
$isImage = in_array($extension, [
|
$isImage = in_array($extension, [
|
||||||
'jpg',
|
'jpg',
|
||||||
'jpeg',
|
'jpeg',
|
||||||
|
|||||||
@@ -582,16 +582,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
||||||
<td width="25%" style="padding: 3px; text-align:right">
|
<td width="25%" style="padding: 3px; text-align:right">
|
||||||
{{ formatRupiah($npw['nilai_1'] ?? 0, 0, false) ?? '' }}
|
{{ number_format((float) str_replace(['Rp', '.', ','], '', $npw['nilai_1'] ?? 0), 0, ',', '.') }}
|
||||||
</td>
|
|
||||||
<td width="5" style="padding: 3px; text-align: center;">
|
|
||||||
=
|
|
||||||
</td>
|
</td>
|
||||||
|
<td width="5" style="padding: 3px; text-align: center;">=</td>
|
||||||
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
||||||
{{ formatRupiah($npw['nilai_2'] ?? 0, 0, false) ?? '' }}
|
{{ number_format((float) str_replace(['Rp', '.', ','], '', $npw['nilai_2'] ?? 0), 0, ',', '.') }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@php $totalNilaiPasarWajar += str_replace(['Rp', '.'], '', $npw['nilai_2']); @endphp
|
@php $totalNilaiPasarWajar += str_replace(['Rp', '.', ','], '', $npw['nilai_2'] ?? 0); @endphp
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
<tr>
|
<tr>
|
||||||
@@ -626,7 +624,6 @@
|
|||||||
: $likuidasiCalc;
|
: $likuidasiCalc;
|
||||||
@endphp
|
@endphp
|
||||||
<td style="padding: 3px; text-align: right;font-weight: bold;">{{ number_format($likuidasiFinal, 0, ',', '.') }}</td>
|
<td style="padding: 3px; text-align: right;font-weight: bold;">{{ number_format($likuidasiFinal, 0, ',', '.') }}</td>
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -370,7 +370,6 @@
|
|||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (isset($lpjData['npw_tambahan']))
|
@if (isset($lpjData['npw_tambahan']))
|
||||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||||
<tr>
|
<tr>
|
||||||
@@ -382,15 +381,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
||||||
<td width="25%" style="padding: 3px; text-align:right">
|
<td width="25%" style="padding: 3px; text-align:right">
|
||||||
{{ number_format($npw['nilai_1'], 0, ',', '.') ?? '' }}
|
{{ number_format((float) str_replace(['Rp', '.', ','], '', $npw['nilai_1'] ?? 0), 0, ',', '.') }}
|
||||||
</td>
|
</td>
|
||||||
<td width="5" style="padding: 3px; text-align: center;">=</td>
|
<td width="5" style="padding: 3px; text-align: center;">=</td>
|
||||||
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
||||||
{{ number_format($npw['nilai_2'], 0, ',', '.') ?? '' }}
|
{{ number_format((float) str_replace(['Rp', '.', ','], '', $npw['nilai_2'] ?? 0), 0, ',', '.') }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@php $totalNilaiPasarWajar += $npw['nilai_2']; @endphp
|
@php $totalNilaiPasarWajar += str_replace(['Rp', '.', ','], '', $npw['nilai_2'] ?? 0); @endphp
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
147
resources/views/referensi_link/create.blade.php
Normal file
147
resources/views/referensi_link/create.blade.php
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
|
<form method="POST" action="{{ route('basicdata.referensi-link.store') }}">
|
||||||
|
@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">
|
||||||
|
Tambah Referensi Link
|
||||||
|
</h3>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<a href="{{ route('basicdata.referensi-link.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">
|
||||||
|
Nama Referensi Link <span class="text-danger">*</span>
|
||||||
|
</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="{{ old('name') }}"
|
||||||
|
placeholder="Masukkan nama referensi link"
|
||||||
|
required>
|
||||||
|
@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">
|
||||||
|
Link URL <span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('link') border-danger bg-danger-light @enderror"
|
||||||
|
type="url"
|
||||||
|
name="link"
|
||||||
|
value="{{ old('link') }}"
|
||||||
|
placeholder="https://example.com"
|
||||||
|
required>
|
||||||
|
@error('link')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Pastikan link diawali dengan http:// atau https://</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Kategori
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('kategori') border-danger bg-danger-light @enderror"
|
||||||
|
type="text"
|
||||||
|
name="kategori"
|
||||||
|
value="{{ old('kategori') }}"
|
||||||
|
placeholder="Misal: regulasi, panduan, dll">
|
||||||
|
@error('kategori')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Kosongkan jika tidak ada kategori</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Deskripsi
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<textarea class="textarea @error('deskripsi') border-danger bg-danger-light @enderror"
|
||||||
|
name="deskripsi"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Masukkan deskripsi lengkap referensi link">{{ old('deskripsi') }}</textarea>
|
||||||
|
@error('deskripsi')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Status Aktif
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" name="is_active" value="1" {{ old('is_active', true) ? 'checked' : '' }}>
|
||||||
|
<span class="switch-slider"></span>
|
||||||
|
</label>
|
||||||
|
<span class="ml-3 text-sm text-gray-600">Aktifkan referensi link ini</span>
|
||||||
|
@error('is_active')
|
||||||
|
<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 Tampil
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('urutan') border-danger bg-danger-light @enderror"
|
||||||
|
type="number"
|
||||||
|
name="urutan"
|
||||||
|
value="{{ old('urutan', 0) }}"
|
||||||
|
min="0"
|
||||||
|
placeholder="0">
|
||||||
|
@error('urutan')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Semakin kecil angka, semakin atas posisinya</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer justify-end">
|
||||||
|
<div class="flex flex-wrap gap-2">
|
||||||
|
<a href="{{ route('basicdata.referensi-link.index') }}" class="btn btn-light">
|
||||||
|
<i class="ki-filled ki-exit-left"></i> Batal
|
||||||
|
</a>
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
<i class="ki-filled ki-check"></i> Simpan
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
// Auto-add https:// if not present
|
||||||
|
document.querySelector('input[name="link"]').addEventListener('blur', function() {
|
||||||
|
let value = this.value.trim();
|
||||||
|
if (value && !value.match(/^https?:\/\//i)) {
|
||||||
|
this.value = 'https://' + value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
148
resources/views/referensi_link/edit.blade.php
Normal file
148
resources/views/referensi_link/edit.blade.php
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
|
<form method="POST" action="{{ route('basicdata.referensi-link.update', $referensiLink->id) }}">
|
||||||
|
@csrf
|
||||||
|
@method('PUT')
|
||||||
|
<div class="card border border-agi-100 pb-2.5">
|
||||||
|
<div class="card-header bg-agi-50" id="basic_settings">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Edit Referensi Link
|
||||||
|
</h3>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<a href="{{ route('basicdata.referensi-link.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">
|
||||||
|
Nama Referensi Link <span class="text-danger">*</span>
|
||||||
|
</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="{{ old('name', $referensiLink->name) }}"
|
||||||
|
placeholder="Masukkan nama referensi link"
|
||||||
|
required>
|
||||||
|
@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">
|
||||||
|
Link URL <span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('link') border-danger bg-danger-light @enderror"
|
||||||
|
type="url"
|
||||||
|
name="link"
|
||||||
|
value="{{ old('link', $referensiLink->link) }}"
|
||||||
|
placeholder="https://example.com"
|
||||||
|
required>
|
||||||
|
@error('link')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Pastikan link diawali dengan http:// atau https://</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Kategori
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('kategori') border-danger bg-danger-light @enderror"
|
||||||
|
type="text"
|
||||||
|
name="kategori"
|
||||||
|
value="{{ old('kategori', $referensiLink->kategori) }}"
|
||||||
|
placeholder="Misal: regulasi, panduan, dll">
|
||||||
|
@error('kategori')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Kosongkan jika tidak ada kategori</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Deskripsi
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<textarea class="textarea @error('deskripsi') border-danger bg-danger-light @enderror"
|
||||||
|
name="deskripsi"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Masukkan deskripsi lengkap referensi link">{{ old('deskripsi', $referensiLink->deskripsi) }}</textarea>
|
||||||
|
@error('deskripsi')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
|
<label class="form-label max-w-56">
|
||||||
|
Status Aktif
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" name="is_active" value="1" {{ old('is_active', $referensiLink->is_active) ? 'checked' : '' }}>
|
||||||
|
<span class="switch-slider"></span>
|
||||||
|
</label>
|
||||||
|
<span class="ml-3 text-sm text-gray-600">Aktifkan referensi link ini</span>
|
||||||
|
@error('is_active')
|
||||||
|
<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 Tampil
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<input class="input @error('urutan') border-danger bg-danger-light @enderror"
|
||||||
|
type="number"
|
||||||
|
name="urutan"
|
||||||
|
value="{{ old('urutan', $referensiLink->urutan) }}"
|
||||||
|
min="0"
|
||||||
|
placeholder="0">
|
||||||
|
@error('urutan')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
<div class="form-hint">Semakin kecil angka, semakin atas posisinya</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer justify-end">
|
||||||
|
<div class="flex flex-wrap gap-2">
|
||||||
|
<a href="{{ route('basicdata.referensi-link.index') }}" class="btn btn-light">
|
||||||
|
<i class="ki-filled ki-exit-left"></i> Batal
|
||||||
|
</a>
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
<i class="ki-filled ki-check"></i> Update
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
// Auto-add https:// if not present
|
||||||
|
document.querySelector('input[name="link"]').addEventListener('blur', function() {
|
||||||
|
let value = this.value.trim();
|
||||||
|
if (value && !value.match(/^https?:\/\//i)) {
|
||||||
|
this.value = 'https://' + value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
56
resources/views/referensi_link/import.blade.php
Normal file
56
resources/views/referensi_link/import.blade.php
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render('basicdata.referensi-link') }}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="grid">
|
||||||
|
<div class="card border border-agi-100 min-w-full">
|
||||||
|
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||||
|
<h3 class="card-title">Import Referensi Link</h3>
|
||||||
|
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||||
|
<a class="btn btn-sm btn-light" href="{{ route('basicdata.referensi-link.download-template') }}">Download Template Excel</a>
|
||||||
|
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.referensi-link.index') }}">Kembali ke Daftar</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form id="importPageForm" action="{{ route('basicdata.referensi-link.import.process') }}" method="POST" enctype="multipart/form-data" class="space-y-6">
|
||||||
|
@csrf
|
||||||
|
<div>
|
||||||
|
<label class="form-label">File Excel</label>
|
||||||
|
<input type="file" name="file" class="input" accept=".xlsx,.xls" required>
|
||||||
|
<div class="form-hint">Format file: .xlsx atau .xls, maksimal 10MB</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<div class="alert-description">
|
||||||
|
<strong>Format kolom yang didukung:</strong>
|
||||||
|
<div>Nama, Link, Kategori, Deskripsi, Status Aktif, Urutan</div>
|
||||||
|
<div class="mt-2">Contoh baris:</div>
|
||||||
|
<div class="mt-1">Contoh Referensi | https://example.com | panduan | Deskripsi contoh referensi link | aktif | 1</div>
|
||||||
|
<div>Contoh Regulasi | https://regulasi.example.com | regulasi | Deskripsi regulasi | aktif | 2</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex gap-3">
|
||||||
|
<button type="submit" class="btn btn-primary">Import</button>
|
||||||
|
<a href="{{ route('basicdata.referensi-link.index') }}" class="btn btn-light">Batal</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script type="module">
|
||||||
|
const form = document.getElementById('importPageForm');
|
||||||
|
const submitBtn = form.querySelector('button[type="submit"]');
|
||||||
|
|
||||||
|
form.addEventListener('submit', function(e) {
|
||||||
|
submitBtn.disabled = true;
|
||||||
|
submitBtn.innerHTML = '<i class="ki-filled ki-loading"></i> Mengimport...';
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
272
resources/views/referensi_link/index.blade.php
Normal file
272
resources/views/referensi_link/index.blade.php
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render('basicdata.referensi-link') }}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="grid">
|
||||||
|
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="referensi-link-table" data-api-url="{{ route('basicdata.referensi-link.datatables') }}">
|
||||||
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Daftar Referensi Link
|
||||||
|
</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 Referensi Link" 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>
|
||||||
|
<button class="btn btn-sm btn-light" onclick="showImportModal()"> Import Excel </button>
|
||||||
|
<a class="btn btn-sm btn-light" href="{{ route('basicdata.referensi-link.export') }}"> Export to Excel </a>
|
||||||
|
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.referensi-link.create') }}"> Tambah Referensi Link </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="scrollable-x-auto">
|
||||||
|
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border" 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-[200px]" data-datatable-column="name">
|
||||||
|
<span class="sort"> <span class="sort-label"> Nama </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[250px]" data-datatable-column="link">
|
||||||
|
<span class="sort"> <span class="sort-label"> Link </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="kategori">
|
||||||
|
<span class="sort"> <span class="sort-label"> Kategori </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="status_badge">
|
||||||
|
<span class="sort"> <span class="sort-label"> Status </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[80px]" data-datatable-column="urutan">
|
||||||
|
<span class="sort"> <span class="sort-label"> Urutan </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px] text-center" data-datatable-column="actions">Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||||
|
<div class="flex gap-2 items-center">
|
||||||
|
Show
|
||||||
|
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select>
|
||||||
|
per page
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-4 items-center text-gray-700">
|
||||||
|
<span>Total <span data-datatable-info="true"></span> records</span>
|
||||||
|
<div class="pagination" data-datatable-pagination="true"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Import Modal -->
|
||||||
|
<div class="modal fade" id="importModal" tabindex="-1" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-title">Import Referensi Link</h3>
|
||||||
|
<button type="button" class="btn btn-sm btn-icon btn-light btn-clear" data-modal-dismiss="true">
|
||||||
|
<i class="ki-filled ki-cross"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form id="importForm" action="{{ route('basicdata.referensi-link.import.process') }}" method="POST" enctype="multipart/form-data">
|
||||||
|
@csrf
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="form-label">File Excel</label>
|
||||||
|
<input type="file" name="file" class="input" accept=".xlsx,.xls" required>
|
||||||
|
<div class="form-hint">Format file: .xlsx atau .xls, maksimal 10MB</div>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<div class="alert-description">
|
||||||
|
<strong>Format file yang didukung:</strong><br>
|
||||||
|
- Nama, Link, Kategori, Deskripsi, Status Aktif, Urutan<br>
|
||||||
|
<a href="{{ route('basicdata.referensi-link.download-template') }}" class="text-primary hover:underline">
|
||||||
|
Download template Excel
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-light" data-modal-dismiss="true">Batal</button>
|
||||||
|
<button type="submit" class="btn btn-primary">Import</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@push('scripts')
|
||||||
|
<script type="text/javascript">
|
||||||
|
function deleteData(id) {
|
||||||
|
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/referensi-link/${id}`, {
|
||||||
|
type: 'DELETE'
|
||||||
|
}).then(() => {
|
||||||
|
swal.fire('Deleted!', 'Data berhasil dihapus.', 'success').then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
Swal.fire('Error!', 'Terjadi kesalahan saat menghapus.', 'error');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script type="module">
|
||||||
|
const element = document.querySelector('#referensi-link-table');
|
||||||
|
const searchInput = document.getElementById('search');
|
||||||
|
|
||||||
|
const apiUrl = element.getAttribute('data-api-url');
|
||||||
|
const dataTableOptions = {
|
||||||
|
apiEndpoint: apiUrl,
|
||||||
|
pageSize: 5,
|
||||||
|
columns: {
|
||||||
|
select: {
|
||||||
|
render: (item, data) => {
|
||||||
|
const checkbox = document.createElement('input');
|
||||||
|
checkbox.className = 'checkbox checkbox-sm';
|
||||||
|
checkbox.type = 'checkbox';
|
||||||
|
checkbox.value = String(data.id);
|
||||||
|
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||||
|
return checkbox.outerHTML.trim();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
name: { title: 'Nama' },
|
||||||
|
link: {
|
||||||
|
title: 'Link',
|
||||||
|
render: (item, data) => data.link,
|
||||||
|
},
|
||||||
|
kategori: { title: 'Kategori' },
|
||||||
|
status_badge: {
|
||||||
|
title: 'Status',
|
||||||
|
render: (item, data) => data.status_badge,
|
||||||
|
},
|
||||||
|
urutan: { title: 'Urutan' },
|
||||||
|
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/referensi-link/${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);
|
||||||
|
searchInput.addEventListener('input', function () {
|
||||||
|
const searchValue = this.value.trim();
|
||||||
|
dataTable.search(searchValue, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.showImportModal = function () {
|
||||||
|
const modal = new KTModal('#importModal');
|
||||||
|
modal.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('importForm').addEventListener('submit', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const form = this;
|
||||||
|
const submitBtn = form.querySelector('button[type="submit"]');
|
||||||
|
|
||||||
|
submitBtn.disabled = true;
|
||||||
|
submitBtn.innerHTML = '<i class="ki-filled ki-loading"></i> Mengimport...';
|
||||||
|
|
||||||
|
const formData = new FormData(form);
|
||||||
|
|
||||||
|
fetch(form.action, {
|
||||||
|
method: 'POST',
|
||||||
|
body: formData,
|
||||||
|
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' }
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
showToast('success', 'Import berhasil!', data.message);
|
||||||
|
dataTable.reload();
|
||||||
|
const modal = KTModal.getInstance('#importModal');
|
||||||
|
modal.hide();
|
||||||
|
form.reset();
|
||||||
|
} else {
|
||||||
|
showToast('error', 'Import gagal!', data.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
showToast('error', 'Error!', 'Terjadi kesalahan saat import data');
|
||||||
|
console.error('Import error:', error);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submitBtn.disabled = false;
|
||||||
|
submitBtn.innerHTML = 'Import';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
window.toggleStatus = function (id, currentStatus) {
|
||||||
|
const newStatus = !currentStatus;
|
||||||
|
const statusText = newStatus ? 'Aktif' : 'Tidak Aktif';
|
||||||
|
|
||||||
|
if (confirm(`Apakah Anda yakin ingin mengubah status menjadi ${statusText}?`)) {
|
||||||
|
fetch(`{{ url('basicdata/referensi-link') }}/${id}/toggle-status`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ is_active: newStatus })
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
showToast('success', 'Berhasil!', data.message);
|
||||||
|
dataTable.reload();
|
||||||
|
} else {
|
||||||
|
showToast('error', 'Gagal!', data.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
showToast('error', 'Error!', 'Terjadi kesalahan saat mengubah status');
|
||||||
|
console.error('Status toggle error:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
@php
|
@php
|
||||||
$statusKey = isset($forminspeksi['asset']['alamat']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
$statusKey = isset($forminspeksi['asset']['alamat']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||||
$address = $forminspeksi['asset']['alamat'][$statusKey] ?? null;
|
$address = $forminspeksi['asset']['alamat'][$statusKey] ?? null;
|
||||||
|
$cekAlamat = $address ?? '';
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div id="alamat_form" class="grid gap-2 mt-5" style="display: none;">
|
<div id="alamat_form" class="grid gap-2 mt-5" style="display: none;">
|
||||||
|
|||||||
@@ -370,6 +370,19 @@ Breadcrumbs::for('basicdata.jenis-penilaian.edit', function (BreadcrumbTrail $tr
|
|||||||
$trail->push('Edit Jenis Penilaian');
|
$trail->push('Edit Jenis Penilaian');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('basicdata.referensi-link', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('basicdata');
|
||||||
|
$trail->push('Referensi Link', route('basicdata.referensi-link.index'));
|
||||||
|
});
|
||||||
|
Breadcrumbs::for('basicdata.referensi-link.create', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('basicdata.referensi-link');
|
||||||
|
$trail->push('Tambah Referensi Link', route('basicdata.referensi-link.create'));
|
||||||
|
});
|
||||||
|
Breadcrumbs::for('basicdata.referensi-link.edit', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('basicdata.referensi-link');
|
||||||
|
$trail->push('Edit Referensi Link');
|
||||||
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('penilaian', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('penilaian', function (BreadcrumbTrail $trail) {
|
||||||
$trail->push('Penilaian', route('penilaian.index'));
|
$trail->push('Penilaian', route('penilaian.index'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,6 +56,8 @@
|
|||||||
use Modules\Lpj\Http\Controllers\TenderController;
|
use Modules\Lpj\Http\Controllers\TenderController;
|
||||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||||
|
use Modules\Lpj\Http\Controllers\ImageController;
|
||||||
|
use Modules\Lpj\Http\Controllers\ReferensiLinkController;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -71,6 +73,8 @@
|
|||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::get('api/check-penawaran/{nomor_registrasi}', [TenderController::class, 'checkPenawaranExistence']);
|
Route::get('api/check-penawaran/{nomor_registrasi}', [TenderController::class, 'checkPenawaranExistence']);
|
||||||
|
|
||||||
|
Route::get('images/{path}', [ImageController::class, 'show'])->name('lpj.image.show');
|
||||||
|
|
||||||
Route::name('basicdata.')->prefix('basic-data')->group(function () {
|
Route::name('basicdata.')->prefix('basic-data')->group(function () {
|
||||||
|
|
||||||
Route::name('jenis-lampiran.')->prefix('jenis-lampiran')->group(function () {
|
Route::name('jenis-lampiran.')->prefix('jenis-lampiran')->group(function () {
|
||||||
@@ -179,6 +183,30 @@
|
|||||||
});
|
});
|
||||||
Route::resource('status-permohonan', StatusPermohonanController::class);
|
Route::resource('status-permohonan', StatusPermohonanController::class);
|
||||||
|
|
||||||
|
// Referensi Link routes
|
||||||
|
Route::name('referensi-link.')->prefix('referensi-link')->group(function () {
|
||||||
|
Route::get('datatables', [ReferensiLinkController::class, 'dataTable'])->name('datatables');
|
||||||
|
Route::get('export', [ReferensiLinkController::class, 'export'])->name('export');
|
||||||
|
Route::get('download-template', [ReferensiLinkController::class, 'downloadTemplate'])->name('download-template');
|
||||||
|
Route::get('import', [ReferensiLinkController::class, 'import'])->name('import');
|
||||||
|
Route::post('import', [ReferensiLinkController::class, 'importProcess'])->name('import.process');
|
||||||
|
Route::post('{id}/toggle-status', [ReferensiLinkController::class, 'toggleStatus'])->name('toggle-status');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::resource('referensi-link', ReferensiLinkController::class, [
|
||||||
|
'names' => [
|
||||||
|
'index' => 'referensi-link.index',
|
||||||
|
'show' => 'referensi-link.show',
|
||||||
|
'create' => 'referensi-link.create',
|
||||||
|
'store' => 'referensi-link.store',
|
||||||
|
'edit' => 'referensi-link.edit',
|
||||||
|
'update' => 'referensi-link.update',
|
||||||
|
'destroy' => 'referensi-link.destroy',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
Route::resource('referensi-link', ReferensiLinkController::class);
|
||||||
|
|
||||||
Route::name('region.')->prefix('region')->group(function () {
|
Route::name('region.')->prefix('region')->group(function () {
|
||||||
Route::get('restore/{id}', [RegionController::class, 'restore'])->name('restore');
|
Route::get('restore/{id}', [RegionController::class, 'restore'])->name('restore');
|
||||||
Route::get('datatables', [RegionController::class, 'dataForDatatables'])->name('datatables');
|
Route::get('datatables', [RegionController::class, 'dataForDatatables'])->name('datatables');
|
||||||
|
|||||||
BIN
tests/.DS_Store
vendored
Normal file
BIN
tests/.DS_Store
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user