927 lines
27 KiB
PHP
927 lines
27 KiB
PHP
|
|
<script>
|
|
var KTAppSettings = { "breakpoints": { "sm": 576, "md": 768, "lg": 992, "xl": 1200, "xxl": 1200 }, "colors": { "theme": { "base": { "white": "#ffffff", "primary": "#6993FF", "secondary": "#E5EAEE", "success": "#1BC5BD", "info": "#8950FC", "warning": "#FFA800", "danger": "#F64E60", "light": "#F3F6F9", "dark": "#212121" }, "light": { "white": "#ffffff", "primary": "#E1E9FF", "secondary": "#ECF0F3", "success": "#C9F7F5", "info": "#EEE5FF", "warning": "#FFF4DE", "danger": "#FFE2E5", "light": "#F3F6F9", "dark": "#D6D6E0" }, "inverse": { "white": "#ffffff", "primary": "#ffffff", "secondary": "#212121", "success": "#ffffff", "info": "#ffffff", "warning": "#ffffff", "danger": "#ffffff", "light": "#464E5F", "dark": "#ffffff" } }, "gray": { "gray-100": "#F3F6F9", "gray-200": "#ECF0F3", "gray-300": "#E5EAEE", "gray-400": "#D6D6E0", "gray-500": "#B5B5C3", "gray-600": "#80808F", "gray-700": "#464E5F", "gray-800": "#1B283F", "gray-900": "#212121" } }, "font-family": "Poppins" };
|
|
</script>
|
|
|
|
<script src="{{ asset('assets/plugins/global/plugins.bundle.min.js?v=7.0.5') }}"></script>
|
|
<script src="{{ asset('assets/plugins/custom/prismjs/prismjs.bundle.min.js?v=7.0.5') }}"></script>
|
|
<script src="{{ asset('assets/js/script2.js') }}"></script>
|
|
|
|
<script src="{{ asset('assets/js/pages/widgets.min.js?v=7.0.5') }}"></script>
|
|
<script src="{{ asset('assets/plugins/custom/datatables/datatables.bundle.min.js?v=7.0.5') }}"></script>
|
|
<script src="{{ asset('assets/validator/bootstrapValidator.min.js')}}" type="text/javascript"></script>
|
|
<script src="{{ asset('js/chartjs.js')}}" type="text/javascript"></script>
|
|
<script src="{{ asset('js/qrcode.min.js')}}" type="text/javascript" ></script>
|
|
<script src="{{ asset('assets/js/pagination.min.js') }}" type="text/javascript"></script>
|
|
<script src="{{ asset('assets/js/autoNumeric.min.js')}}" type="text/javascript"></script>
|
|
<script src="{{ asset('js/shortcut.js')}}"></script>
|
|
<script src="{{ asset('js/onscan.min.js')}}"></script>
|
|
<script src="{{ asset('assets/js/moment.js')}}"></script>
|
|
<script>
|
|
|
|
|
|
var base_url = "{{ url('/') }}";
|
|
var btnLoader = KTUtil.getById("znBtnLoader");
|
|
|
|
var KTSessionTimeoutDemo = function() {
|
|
var initDemo = function() {
|
|
$.sessionTimeout({
|
|
title: "Session Timeout",
|
|
message: "",
|
|
keepAlive:false,
|
|
redirUrl: "{{route('getlogout')}}",
|
|
logoutUrl: "{{route('getlogout')}}",
|
|
warnAfter: 4200000,
|
|
redirAfter: 4230000,
|
|
ignoreUserActivity: false,
|
|
countdownMessage: "Your session is about to expire in {timer} seconds.",
|
|
countdownBar: true
|
|
});
|
|
}
|
|
|
|
return {
|
|
//main function to initiate the module
|
|
init: function() {
|
|
initDemo();
|
|
}
|
|
};
|
|
}();
|
|
|
|
jQuery(document).ready(function() {
|
|
|
|
|
|
|
|
KTSessionTimeoutDemo.init();
|
|
// $('#formData').on('keypress', function (e) {
|
|
// var keyCode = e.keyCode || e.which;
|
|
// if (keyCode === 13) {
|
|
// e.preventDefault();
|
|
// document.getElementById("znBtnLoader").click();
|
|
// }
|
|
// });
|
|
|
|
toastr.options = {
|
|
"debug": false,
|
|
"positionClass": "toast-bottom-right",
|
|
"onclick": null,
|
|
"fadeIn": 300,
|
|
"fadeOut": 300,
|
|
"timeOut": 1000,
|
|
"extendedTimeOut": 1000
|
|
}
|
|
});
|
|
|
|
function reInitForm() {
|
|
|
|
$('.znDate').datepicker({
|
|
rtl: KTUtil.isRTL(),
|
|
orientation: "bottom left",
|
|
todayHighlight: true,
|
|
format: 'dd-mm-yyyy',
|
|
autoclose: true,
|
|
});
|
|
|
|
$('.yearFormat').datepicker({
|
|
rtl: KTUtil.isRTL(),
|
|
orientation: "bottom left",
|
|
todayHighlight: true,
|
|
autoclose: true,
|
|
format: "yyyy",
|
|
viewMode: "years",
|
|
minViewMode: "years"
|
|
});
|
|
|
|
$('.monthFormat').datepicker({
|
|
rtl: KTUtil.isRTL(),
|
|
orientation: "bottom left",
|
|
todayHighlight: true,
|
|
autoclose: true,
|
|
format: "MM",
|
|
viewMode: "months",
|
|
minViewMode: "months",
|
|
});
|
|
|
|
// INPUT FORM
|
|
$(".znDate_inputmask").inputmask("99-99-9999", {
|
|
"placeholder": "dd-mm-yyyy"
|
|
});
|
|
|
|
$('.max-notif').maxlength({
|
|
warningClass: "label label-warning label-rounded label-inline",
|
|
limitReachedClass: "label label-success label-rounded label-inline",
|
|
appendToParent: true
|
|
});
|
|
$('.select2').select2({
|
|
placeholder: "Silahkan Pilih"
|
|
});
|
|
|
|
$(".znNumber").inputmask('decimal', {
|
|
rightAlign: false
|
|
});
|
|
|
|
$('.selectpicker').selectpicker('render');
|
|
|
|
$(".znCurrency").inputmask('Rp 999.999.999.999,99', {
|
|
numericInput: true,
|
|
});
|
|
|
|
$('.selectpicker').selectpicker('render');
|
|
|
|
$('.znHour').timepicker({
|
|
minuteStep: 1,
|
|
defaultTime: '',
|
|
showSeconds: true,
|
|
showMeridian: false,
|
|
snapToStep: true
|
|
});
|
|
|
|
$('.custom-file-input').on('change', function() {
|
|
var fileName = $(this).val();
|
|
$(this).next('.custom-file-label').addClass("selected").html(fileName);
|
|
});
|
|
}
|
|
|
|
function initMaskMoneyClass(cs) {
|
|
const numberic = new AutoNumeric(cs, {
|
|
decimalCharacter : ',',
|
|
digitGroupSeparator : '.'
|
|
});
|
|
}
|
|
|
|
function G_limit(text, limit) {
|
|
return text.length > limit ? text.substring(0, limit) + "..." : text;
|
|
}
|
|
|
|
function G_deleteDokumen(id,trigger,jenis) {
|
|
|
|
popConfirm("Konfirmasi Hapus Dokumen",
|
|
`
|
|
<div class="mt-2">Yakin Akan Hapus Dokumen Ini ?</div>`, function () {
|
|
$('#znNotif').modal('hide');
|
|
|
|
let formData = new FormData();
|
|
formData.append('id', id);
|
|
|
|
doPost('management_audit/act_any/hapus_dokumen', formData, function (msg, res) {
|
|
//console.log(res);
|
|
if (res.rc == 0) {
|
|
znNotif("success", res.rm);
|
|
get_list_dokumen(trigger,jenis);
|
|
}else{
|
|
znNotif("warning", 'Terjadi Kesalahan !');
|
|
}
|
|
|
|
})
|
|
});
|
|
}
|
|
|
|
function znNotif(type, text) {
|
|
let icon;
|
|
switch (type) {
|
|
case 'success':
|
|
$('#znAlert-title').html('Berhasil');
|
|
icon = `<i class="la la-check-circle zn-notif-icon text-success"></i>`;
|
|
break;
|
|
case 'danger':
|
|
$('#znAlert-title').html('Gagal');
|
|
icon = `<i class="la la-remove zn-notif-icon text-danger"></i>`;
|
|
break;
|
|
case 'warning':
|
|
$('#znAlert-title').html('Peringatan');
|
|
icon = `<i class="la la-comment-o zn-notif-icon text-warning"></i>`;
|
|
break;
|
|
case 'info':
|
|
$('#znAlert-title').html('Informasi');
|
|
icon = `<i class="la la-info-circle zn-notif-icon text-info"></i>`;
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
$('#znAlertModal').addClass('modal-sm');
|
|
$('#znAlert-title').addClass('text-' + type);
|
|
$('.zn-card').addClass('wave-' + type);
|
|
$('#znAlert-icon').html(icon);
|
|
$('#znAlert-text').html(text);
|
|
$('#znAlert-action').hide();
|
|
$('#znAlert').modal('show');
|
|
setTimeout(function () {
|
|
$('#znAlert').modal('hide');
|
|
$('.zn-card').removeClass('wave-' + type);
|
|
$('#znAlert-title').removeClass('text-' + type);
|
|
}, 2000);
|
|
}
|
|
|
|
function znNotifConfirm(text) {
|
|
$('#znModal').removeClass('modal-sm');
|
|
let icon = `<i class="la la-question-circle zn-notif-icon text-success"></i>`;
|
|
$('#znNotif-title').addClass('text-success');
|
|
$('.zn-card').addClass('wave-success');
|
|
$('#znNotif-icon').html(icon);
|
|
$('#znNotif-text').html(text);
|
|
$('#znNotif-title').html('Konfirmasi');
|
|
$('#znNotif-action').show();
|
|
$('#znNotif').modal('show');
|
|
}
|
|
|
|
function znNotifConfirmClose() {
|
|
$('#znNotif').modal('hide');
|
|
}
|
|
|
|
function znModal(id) {
|
|
$('#'+id).modal('show');
|
|
}
|
|
|
|
function darkTheme() {
|
|
|
|
let theme;
|
|
if ($('#setThemeDark').is(':checked')) {
|
|
$('#kt_body').addClass('zn-bg-texture-dark');
|
|
$('#kt_body').addClass('dark');
|
|
theme = 'dark';
|
|
}else{
|
|
$('#kt_body').removeClass('zn-bg-texture-dark');
|
|
$('#kt_body').removeClass('dark');
|
|
theme = 'white';
|
|
}
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '{{ route('set_session_theme') }}',
|
|
data: {
|
|
theme:theme
|
|
},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (response) {
|
|
//console.log(response.rm);
|
|
}
|
|
}).done(function (msg) {
|
|
}).fail(function (msg) {
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function znGetTable(dAct,dColum,dColumStyle,id) {
|
|
var table = $('#'+id).DataTable({
|
|
aaSorting: [],
|
|
aLengthMenu: [[5,10, 25, 50, -1], [5, 10, 25, 50, "All"]],
|
|
processing: true,
|
|
serverSide: true,
|
|
pageLength : 10,
|
|
responsive: true,
|
|
destroy:true,
|
|
// dom: `<'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>`,
|
|
language: {
|
|
'lengthMenu': 'Display _MENU_',
|
|
},
|
|
columnDefs: dColumStyle,
|
|
ajax: {
|
|
"url" : dAct,
|
|
"error": function(jqXHR, textStatus, errorThrown)
|
|
{
|
|
znNotif("warning","Koneksi Bermasalah, Terjadi Kesalahan Saat Pengambilan Data !");
|
|
}
|
|
},
|
|
columns: dColum
|
|
});
|
|
|
|
return table;
|
|
}
|
|
|
|
function znGetTableManual(dAct, dColum, dColumStyle, id) {
|
|
var table = $('#' + id).DataTable({
|
|
aaSorting: [],
|
|
processing: true,
|
|
serverSide: true,
|
|
pageLength: 5,
|
|
responsive: true,
|
|
destroy:true,
|
|
paging:false,
|
|
lengthMenu:false,
|
|
bInfo : false,
|
|
searching: false,
|
|
ordering:false,
|
|
// dom: `<'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>`,
|
|
language: {
|
|
'lengthMenu': 'Display _MENU_',
|
|
},
|
|
columnDefs: dColumStyle,
|
|
ajax: {
|
|
"url": dAct,
|
|
"error": function (jqXHR, textStatus, errorThrown) {
|
|
znNotif("warning", "Koneksi Bermasalah, Terjadi Kesalahan Saat Pengambilan Data !");
|
|
}
|
|
},
|
|
columns: dColum
|
|
});
|
|
|
|
return table;
|
|
}
|
|
|
|
|
|
//todo ajax content loader
|
|
function loadContent(e, elm) {
|
|
e.preventDefault();
|
|
let path = $(elm).attr('href').replace('#', '');
|
|
|
|
$("[id^='sb-']").removeClass('zn-menu-active');
|
|
$("#sb-"+elm.id).addClass('zn-menu-active');
|
|
$('#kt_aside_close_btn').click();
|
|
// $('#kt_quick_notifications_close').click();
|
|
|
|
showPage(path);
|
|
}
|
|
|
|
function showPage(url) {
|
|
|
|
|
|
$('#pageLoad').fadeOut();
|
|
znLoadingPage();
|
|
|
|
if ( typeof(window.history.pushState) == 'function' ) {
|
|
var stateObj ={
|
|
title: 'backhistory',
|
|
url: url,
|
|
} ;
|
|
window.history.pushState (stateObj, 'backhistory', url) ;
|
|
}
|
|
|
|
|
|
let state = {name: "name", page: 'History', url:url};
|
|
doGet(url, function (msg, data) {
|
|
|
|
znLoadingPageEnd();
|
|
if (data == null){
|
|
toastr.error(msg);
|
|
}else {
|
|
znLoadingPageEnd();
|
|
$('#pageLoad').html(data).fadeIn();
|
|
window.history.replaceState(state, "History", url);
|
|
animateCSS('#pageLoad', 'fadeInRight', function () {
|
|
});
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function animateCSS(element, animationName, callback) {
|
|
const node = document.querySelector(element)
|
|
node.classList.add('animated', animationName)
|
|
|
|
function handleAnimationEnd() {
|
|
node.classList.remove('animated', animationName)
|
|
node.removeEventListener('animationend', handleAnimationEnd)
|
|
|
|
if (typeof callback === 'function') callback()
|
|
}
|
|
|
|
node.addEventListener('animationend', handleAnimationEnd)
|
|
}
|
|
|
|
|
|
function doPost(url, formData, callback) {
|
|
$.ajax({
|
|
processData: false,
|
|
contentType: false,
|
|
type: 'POST',
|
|
global: false,
|
|
url: url,
|
|
data: formData,
|
|
success: function (response) {
|
|
// todo improve sesuai kebutuhan nantiya
|
|
if (typeof callback == 'function') {
|
|
callback("", response);
|
|
}
|
|
},
|
|
error: function (jqXHR, textStatus, errorThrown) {
|
|
// if (jqXHR.status === 401){
|
|
// window.location.replace("/login");
|
|
// }else {
|
|
// if (typeof callback == 'function') {
|
|
// callback(jqXHR.responseJSON.message, null);
|
|
// }
|
|
// }
|
|
}
|
|
});
|
|
}
|
|
function doGet(url, callback) {
|
|
$.get(url, function (response, status, xhr) {
|
|
if (typeof callback == 'function') {
|
|
callback("", response);
|
|
}
|
|
}).fail(function (response) {
|
|
// if (response.status === 401){
|
|
// window.location.replace("/login");
|
|
// }else {
|
|
// if (typeof callback == 'function') {
|
|
// callback(response.responseJSON.message, null);
|
|
// }
|
|
// }
|
|
});
|
|
}
|
|
|
|
function znLoadingModal(form) {
|
|
KTApp.block('#'+form+' .modal-content', {
|
|
overlayColor: '#000000',
|
|
state: 'primary',
|
|
message: 'Processing...'
|
|
});
|
|
}
|
|
|
|
function znLoadingModalEnd(form) {
|
|
KTApp.unblock('#'+form+' .modal-content');
|
|
}
|
|
|
|
function znLoadingPage() {
|
|
KTApp.blockPage({
|
|
overlayColor: '#000000',
|
|
state: 'primary',
|
|
message: 'Processing...'
|
|
});
|
|
}
|
|
|
|
function znLoadingPageEnd() {
|
|
KTApp.unblockPage();
|
|
}
|
|
|
|
|
|
function znToNumber(objek) {
|
|
var separator = "";
|
|
var a = objek.value;
|
|
var b = a.replace(/[^\d]/g, "");
|
|
var c = "";
|
|
var panjang = b.length;
|
|
var j = 0; for (var i = panjang; i > 0; i--) {
|
|
j = j + 1; if (((j % 3) == 1) && (j != 1)) {
|
|
c = b.substr(i - 1, 1) + separator + c;
|
|
} else {
|
|
c = b.substr(i - 1, 1) + c;
|
|
}
|
|
} objek.value = c;
|
|
}
|
|
|
|
function znClearNPWP(npwp){
|
|
var new_npwp = npwp.replace(/\./g, "");
|
|
new_npwp = new_npwp.replace(/\,/g, "");
|
|
new_npwp = new_npwp.replace(/\-/g, "");
|
|
return new_npwp;
|
|
}
|
|
|
|
function znNumFormatClear(data) {
|
|
return data.replace(/\./g,'');
|
|
}
|
|
|
|
function znToMoney(objek) {
|
|
var separator = ".";
|
|
var a = objek.value;
|
|
var b = a.replace(/[^\d]/g, "");
|
|
var c = "";
|
|
var panjang = b.length;
|
|
var j = 0; for (var i = panjang; i > 0; i--) {
|
|
j = j + 1; if (((j % 3) == 1) && (j != 1)) {
|
|
c = b.substr(i - 1, 1) + separator + c;
|
|
} else {
|
|
c = b.substr(i - 1, 1) + c;
|
|
}
|
|
} objek.value = c;
|
|
}
|
|
|
|
|
|
function znNumFormat(nStr) {
|
|
nStr += '';
|
|
x = nStr.split('.');
|
|
x1 = x[0];
|
|
x2 = x.length > 1 ? '.' + x[1] : '';
|
|
var rgx = /(\d+)(\d{3})/;
|
|
while (rgx.test(x1)) {
|
|
x1 = x1.replace(rgx, '$1' + '.' + '$2');
|
|
}
|
|
return x1 + x2;
|
|
}
|
|
|
|
function znNumFormatDec(amount, decimalCount = 2, decimal = ",", thousands = ".") {
|
|
try {
|
|
decimalCount = Math.abs(decimalCount);
|
|
decimalCount = isNaN(decimalCount) ? 2 : decimalCount;
|
|
|
|
const negativeSign = amount < 0 ? "-" : "";
|
|
|
|
let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString();
|
|
let j = (i.length > 3) ? i.length % 3 : 0;
|
|
|
|
return negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : "");
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
function znToRupiahDec(objek) {
|
|
$(".money").maskMoney({prefix:'', allowNegative: true, thousands:'.', decimal:',', affixesStay: false});
|
|
}
|
|
|
|
// USER MANAGEMENT
|
|
function sendData(id,status,text,Dtable,isTeller) {
|
|
znNotifConfirm("Anda Yakin Akan Melakukan "+text+" ?");
|
|
$('#znNotif-title').html(text);
|
|
$('#znNotif-action').html(
|
|
`<button onclick="actSendData(`+id+`,`+status+`,'`+Dtable+`','`+isTeller+`')" class="btn btn-light-primary font-weight-bold mr-2">Yes</button>
|
|
<button onclick="znNotifConfirmClose()" class="btn btn-hover-bg-dark btn-text-dark btn-hover-text-white border-0 font-weight-bold mr-2">No</button>
|
|
`);
|
|
}
|
|
|
|
function approveData(id,status,Dtable,isTeller) {
|
|
znNotifConfirm("Anda Yakin Akan Menyetujui ?");
|
|
$('#znNotif-title').html('Setujui');
|
|
$('#znNotif-action').html(
|
|
`<button onclick="actApproveData(`+id+`,`+status+`,'`+Dtable+`','`+isTeller+`')" class="btn btn-light-primary font-weight-bold mr-2">Yes</button>
|
|
<button onclick="znNotifConfirmClose()" class="btn btn-hover-bg-dark btn-text-dark btn-hover-text-white border-0 font-weight-bold mr-2">No</button>
|
|
`);
|
|
}
|
|
|
|
function unregData(id,status,Dtable) {
|
|
znNotifConfirm("Anda Yakin Akan Menyetujui Unreg ?");
|
|
$('#znNotif-title').html('Setujui');
|
|
$('#znNotif-action').html(
|
|
`<button onclick="actUnregData(`+id+`,`+status+`,'`+Dtable+`')" class="btn btn-light-primary font-weight-bold mr-2">Yes</button>
|
|
<button onclick="znNotifConfirmClose()" class="btn btn-hover-bg-dark btn-text-dark btn-hover-text-white border-0 font-weight-bold mr-2">No</button>
|
|
`);
|
|
}
|
|
|
|
function rejectData(id,status,Dtable) {
|
|
znNotifConfirm("Anda Yakin Akan Membatalkan ?");
|
|
$('#znNotif-title').html('Batalkan');
|
|
$('#znNotif-action').html(
|
|
`<button onclick="actRejectData(`+id+`,`+status+`,'`+Dtable+`')" class="btn btn-light-primary font-weight-bold mr-2">Yes</button>
|
|
<button onclick="znNotifConfirmClose()" class="btn btn-hover-bg-dark btn-text-dark btn-hover-text-white border-0 font-weight-bold mr-2">No</button>
|
|
`);
|
|
}
|
|
function popConfirm(title, text, callback) {
|
|
$('#znModal').removeClass('modal-sm');
|
|
let icon = `<i class="la la-question-circle zn-notif-icon text-success"></i>`;
|
|
$('#znNotif-title').addClass('text-success');
|
|
$('.zn-card').addClass('wave-success');
|
|
$('#znNotif-icon').html(icon);
|
|
$('#znNotif-text').html(text);
|
|
$('#znNotif-title').html(title);
|
|
$('#znNotif-action').show();
|
|
$('#btnNotifYes').prop("onclick", null).off("click");
|
|
$('#btnNotifYes').click(function () {
|
|
$('#znNotif').modal('hide');
|
|
if (typeof callback == 'function') {
|
|
callback();
|
|
}
|
|
});
|
|
$('#znNotif').modal('show');
|
|
}
|
|
|
|
function znFormatDate(dates) {
|
|
var date = new Date(dates);
|
|
|
|
var monthNames = [
|
|
"Januari", "Februari", "Maret",
|
|
"April", "Mei", "Juni", "Juli",
|
|
"Agustus", "September", "Oktober",
|
|
"November", "Desember"
|
|
];
|
|
|
|
var day = date.getDate();
|
|
var monthIndex = date.getMonth();
|
|
var year = date.getFullYear();
|
|
|
|
return day + ' ' + monthNames[(monthIndex)] + ' ' + year;
|
|
}
|
|
|
|
function znFormatDatetime(dates) {
|
|
var date = new Date(dates);
|
|
|
|
var monthNames = [
|
|
"Januari", "Februari", "Maret",
|
|
"April", "Mei", "Juni", "Juli",
|
|
"Agustus", "September", "Oktober",
|
|
"November", "Desember"
|
|
];
|
|
|
|
var day = date.getDate();
|
|
var monthIndex = date.getMonth();
|
|
var year = date.getFullYear();
|
|
var hour = date.getHours();
|
|
var minute = date.getMinutes();
|
|
var sec = date.getSeconds();
|
|
|
|
return day + ' ' + monthNames[(monthIndex)] + ' ' + year + ', '+hour+':'+minute+':'+sec;
|
|
}
|
|
|
|
// INIT
|
|
jQuery(document).ready(function() {
|
|
$.ajaxSetup({
|
|
headers: {
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
}
|
|
});
|
|
|
|
let currentTheme = "{{ session('theme') }}";
|
|
let currentBahasa = "{{ session('bahasa') }}";
|
|
|
|
if (currentBahasa == 'id') {
|
|
$('#flagBahasa').attr("src","{{ asset('assets/media/svg/flags/209-indonesia.svg')}}");
|
|
} else {
|
|
$('#flagBahasa').attr("src","{{ asset('assets/media/svg/flags/226-united-states.svg')}}");
|
|
}
|
|
|
|
if (currentTheme == 'dark') {
|
|
$("#setThemeDark").prop( "checked", true );
|
|
// $('#kt_body').addClass('zn-bg-texture-dark');
|
|
// $('#kt_body').addClass('dark');
|
|
}else{
|
|
$("#setThemeDark").prop( "checked", false );
|
|
// $('#kt_body').removeClass('zn-bg-texture-dark');
|
|
// $('#kt_body').removeClass('dark');
|
|
}
|
|
|
|
$('.znSelect2').select2({
|
|
placeholder: "Pilih"
|
|
});
|
|
|
|
$('.znDate').datepicker({
|
|
rtl: KTUtil.isRTL(),
|
|
orientation: "bottom left",
|
|
todayHighlight: true,
|
|
format: 'dd-mm-yyyy',
|
|
autoclose: true,
|
|
});
|
|
|
|
$('.max-notif').maxlength({
|
|
warningClass: "label label-warning label-rounded label-inline",
|
|
limitReachedClass: "label label-success label-rounded label-inline",
|
|
appendToParent: true
|
|
});
|
|
|
|
// INPUT FORM
|
|
$(".znDate").inputmask("99-99-9999", {
|
|
"placeholder": "dd-mm-yyyy"
|
|
});
|
|
|
|
$(".znNumber").inputmask('decimal', {
|
|
rightAlign: false
|
|
});
|
|
|
|
$(".znCurrency").inputmask('Rp 999.999.999,99', {
|
|
numericInput: true
|
|
});
|
|
|
|
$(".znPhone").inputmask({
|
|
"mask": "999999999999999",
|
|
placeholder: ""
|
|
});
|
|
|
|
$(".znNo").inputmask({
|
|
"mask": "9999999999999999999999999999999999999999",
|
|
placeholder: ""
|
|
});
|
|
|
|
|
|
|
|
// INPUT FORM
|
|
|
|
|
|
|
|
var table = $('.znDatatable');
|
|
|
|
// begin first table
|
|
table.DataTable({
|
|
responsive: true,
|
|
|
|
// DOM Layout settings
|
|
dom: `<'row'<'col-sm-12'tr>>
|
|
<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7 dataTables_pager'lp>>`,
|
|
|
|
lengthMenu: [5, 10, 25, 50],
|
|
|
|
pageLength: 10,
|
|
|
|
language: {
|
|
'lengthMenu': 'Display _MENU_',
|
|
},
|
|
|
|
// Order settings
|
|
order: [[1, 'desc']],
|
|
|
|
headerCallback: function(thead, data, start, end, display) {
|
|
thead.getElementsByTagName('th')[0].innerHTML = `
|
|
<label class="checkbox checkbox-single">
|
|
<input type="checkbox" value="" class="group-checkable"/>
|
|
<span></span>
|
|
</label>`;
|
|
},
|
|
|
|
columnDefs: [
|
|
{
|
|
targets: 0,
|
|
width: '30px',
|
|
className: 'dt-left',
|
|
orderable: false,
|
|
render: function(data, type, full, meta) {
|
|
return `
|
|
<label class="checkbox checkbox-single">
|
|
<input type="checkbox" value="" class="checkable"/>
|
|
<span></span>
|
|
</label>`;
|
|
},
|
|
},
|
|
|
|
],
|
|
});
|
|
});
|
|
|
|
function setSubmenu(type){
|
|
if(type == 'hide'){
|
|
$('#kt_aside').width(65);
|
|
$('#contentView').css('paddingLeft','65px');
|
|
}else{
|
|
$('#kt_aside').width(300);
|
|
$('#contentView').css('paddingLeft','300px');
|
|
}
|
|
}
|
|
|
|
function convertDate(dateInput) {
|
|
var startDate = dateInput;
|
|
var parts = startDate.split("-");
|
|
var sd = new Date(Number(parts[2]), Number(parts[1]) - 1, Number(parts[0]));
|
|
return sd;
|
|
}
|
|
|
|
|
|
// function initNoDec() {
|
|
// if ($(".noDec")[0]){
|
|
// const anElement = new AutoNumeric.multiple(".noDec", {
|
|
// decimalCharacter : ',',
|
|
// digitGroupSeparator : '.'
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
function G_cetakAny(typeExport,type,act,getid) {
|
|
|
|
let merchant_filter = $('#merchant_filter').val();
|
|
|
|
|
|
switch (type) {
|
|
case "laporan_billing":
|
|
var query = {
|
|
startDate: $('#berkala_startDate').val(),
|
|
endDate: $('#berkala_endDate').val(),
|
|
merchant_filter: merchant_filter,
|
|
}
|
|
break;
|
|
|
|
case "laporan_order":
|
|
var query = {
|
|
startDate: $('#berkala_startDate').val(),
|
|
endDate: $('#berkala_endDate').val(),
|
|
merchant_filter: merchant_filter,
|
|
}
|
|
break;
|
|
|
|
case "laporan_transaction":
|
|
var query = {
|
|
startDate: $('#berkala_startDate').val(),
|
|
endDate: $('#berkala_endDate').val(),
|
|
merchant_filter: merchant_filter,
|
|
}
|
|
break;
|
|
|
|
case "laporan_gross":
|
|
var query = {
|
|
startDate: $('#berkala_startDate').val(),
|
|
endDate: $('#berkala_endDate').val(),
|
|
merchant_filter: merchant_filter,
|
|
}
|
|
break;
|
|
}
|
|
|
|
window.open('/global/'+typeExport+'/'+type+'?'+$.param(query), "_blank");
|
|
// this.print();
|
|
}
|
|
|
|
function znRandomString(length) {
|
|
var result = '';
|
|
var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*';
|
|
var charactersLength = characters.length;
|
|
for ( var i = 0; i < length; i++ ) {
|
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
function znFormatDateNum(dates) {
|
|
var date = new Date(dates);
|
|
|
|
var day = date.getDate();
|
|
var monthIndex = date.getMonth();
|
|
var year = date.getFullYear();
|
|
|
|
//console.log(day + '-' + monthIndex + '-' + year);
|
|
|
|
return ("0" + (day)).slice(-2) + '-' + ("0" + (monthIndex + 1)).slice(-2) + '-' + year;
|
|
}
|
|
|
|
function G_FormatDate(dates,type) {
|
|
var date = new Date(dates);
|
|
|
|
var monthNames = [
|
|
"Januari", "Februari", "Maret",
|
|
"April", "Mei", "Juni", "Juli",
|
|
"Agustus", "September", "Oktober",
|
|
"November", "Desember"
|
|
];
|
|
|
|
var monthNamesSmall = [
|
|
"Jan", "Feb", "Mar",
|
|
"Apr", "Mei", "Jun", "Jul",
|
|
"Ags", "Sep", "Okt",
|
|
"Nov", "Des"
|
|
];
|
|
|
|
var day = date.getDate();
|
|
var monthIndex = date.getMonth();
|
|
var year = date.getFullYear();
|
|
var hour = date.getHours();
|
|
var minute = date.getMinutes();
|
|
var sec = date.getSeconds();
|
|
|
|
switch (type) {
|
|
case 'd':
|
|
return day;
|
|
break;
|
|
case 'm':
|
|
return monthIndex+1;
|
|
break;
|
|
case 'mm':
|
|
return monthNamesSmall[(monthIndex)];
|
|
break;
|
|
case 'M':
|
|
return monthNames[(monthIndex)];
|
|
break;
|
|
case 'Y':
|
|
return year;
|
|
break;
|
|
case 'd-m-Y':
|
|
return day+'-'+monthIndex+'-'+year;
|
|
break;
|
|
case 'd-M-Y':
|
|
return day+' '+monthNames[(monthIndex)]+' '+year;
|
|
break;
|
|
case 'd-m-Y H:i:s':
|
|
return day+'-'+monthIndex+'-'+year+ ', '+hour+':'+minute+':'+sec;
|
|
break;
|
|
case 'd-M-Y H:i:s':
|
|
return day+' '+monthNames[(monthIndex)]+' '+year+ ', '+hour+':'+minute+':'+sec;
|
|
break;
|
|
}
|
|
}
|
|
|
|
function znClearInput(objek) {
|
|
var separator = "";
|
|
var a = objek.value;
|
|
// var b = a.replace(/\'/g, "");
|
|
var b = a.replace(/[^a-zA-Z0-9_@,./:()% ]/g, "");
|
|
objek.value = b;
|
|
|
|
}
|
|
function znClearInputUsername(objek) {
|
|
var separator = "";
|
|
var a = objek.value;
|
|
// var b = a.replace(/\'/g, "");
|
|
var b = a.replace(/[^a-zA-Z0-9]/g, "");
|
|
objek.value = b;
|
|
|
|
}
|
|
|
|
function copyKey() {
|
|
|
|
var copyText = document.getElementById("set_key");
|
|
|
|
/* Select the text field */
|
|
copyText.select();
|
|
copyText.setSelectionRange(0, 99999); /* For mobile devices */
|
|
|
|
/* Copy the text inside the text field */
|
|
navigator.clipboard.writeText(copyText.value);
|
|
|
|
/* Alert the copied text */
|
|
// alert("Copied the text: " + copyText.value);
|
|
|
|
// var copyText = document.getElementById(id);
|
|
|
|
// copyText.select();
|
|
// copyText.setSelectionRange(0, 99999); /* For mobile devices */
|
|
|
|
// navigator.clipboard.writeText(copyText.value);
|
|
|
|
znNotif("success", "Berhasil Copy Key");
|
|
|
|
}
|
|
</script>
|