update data pemanding dan otorisator, pembuatan seeder kjpp mengunakan exel

This commit is contained in:
majid
2024-12-11 17:34:51 +07:00
parent 5dc95d3339
commit bb1ad785a5
14 changed files with 1136 additions and 766 deletions

View File

@@ -0,0 +1,55 @@
<script>
function showLoadingSwal(message) {
Swal.fire({
title: message,
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
}
});
}
function hideLoadingSwal() {
Swal.close();
}
function previewImage(input, imageId) {
const preview = document.getElementById(imageId);
if (input.files && input.files[0]) {
const reader = new FileReader();
reader.onload = function(e) {
preview.src = e.target.result;
preview.classList.remove('hidden');
}
reader.readAsDataURL(input.files[0]);
}
}
function formatNumber(input) {
let value = input.value.replace(/[^\d.]/g, '');
input.value = value;
}
function formatCurrency(value) {
if (!value) return '';
// Jika input adalah elemen, ambil nilainya
const numericValue = typeof value === 'string' ? value : value.value;
// Hapus semua karakter non-digit
const cleanValue = numericValue.toString().replace(/[^\d]/g, '');
// Format ke currency
const formattedValue = new Intl.NumberFormat('id-ID').format(cleanValue);
// Jika input adalah elemen, update nilainya
if (typeof value !== 'string') {
value.value = formattedValue;
}
return formattedValue;
}
</script>