MINI
C:
/
xampp
/
htdocs
/
hnj
/
htdocs
/
htdocs
/
plugins
/
custom
/
Upload File:
files >> C:/xampp/htdocs/hnj/htdocs/htdocs/plugins/custom/app.js
function DtNotif(talert,message,onclose){ if(talert=='success'){ ialert = 'fa fa-check-circle'; idelay = 1000; } else if (talert=='warning'){ ialert = 'fa fa-exclamation-circle'; idelay = 3000; } else if (talert=='info'){ ialert = 'fa fa-info-circle'; idelay = 1000; } else /* if (talert=='error')*/{ ialert = 'fa fa-exclamation-triangle'; idelay = 3000; } $.notify({ // options icon: ialert, message: message, },{ // settings element: 'body', position: 'fixed', type: talert, newest_on_top: true, showProgressbar: false, placement: { from: "top", align: "center" }, offset: 20, spacing: 10, z_index: 101031, delay: idelay, timer: 1000, animate: { enter: 'animated fadeInDown', exit: 'animated fadeOutUp' }, onClose: function(){ if(onclose === '' || onclose === 'undefined'){ //do nothing } else if(onclose ==='rPage'){ location.reload(); //Reload current page } else if(onclose === 'rTable'){ var oTable = oTable = $("#example").DataTable(); oTable.draw(false); //Redraw datatables } else{ location.replace(base_url+onclose); //redirect to new page } }, icon_type: 'class', }); } function ajax_post(form_id,act_name){ var form = $('#'+form_id); var formdata = false, name = 'act', value = act_name; if (window.FormData){ formdata = new FormData(form[0]); } formdata.append(name, value); $.ajax({ url: form.attr('action'), // form action url type: 'POST', // form submit method get/post dataType: 'json', // request type html/json/xml data: formdata ? formdata : form.serialize(), // serialize form data cache : false, contentType : false, processData : false, success: function(data) { // var result = $.parseJSON(data); if(data.status === 'success'){ $.notify({ // options icon: 'fa fa-check', message: data.message, },{ // settings element: 'body', position: 'fixed', type: "success", newest_on_top: true, showProgressbar: false, placement: { from: "top", align: "center" }, offset: 20, spacing: 10, z_index: 101031, delay: 3000, timer: 1000, animate: { enter: 'animated fadeInDown', exit: 'animated fadeOutUp' }, onClose: function(){ if(data.hasOwnProperty('redirect')){ if(data.redirect === 'reload'){ location.reload(); //Reload current page } else if(data.redirect === 'reload_table'){ oTable.draw(false); //Redraw datatables } else{ location.replace(base_url+data.redirect); //redirect to new page } } }, icon_type: 'class', }); } else { $.notify({ // options icon: 'fa fa-warning', message: data.message, },{ // settings element: 'body', position: 'fixed', type: data.status, newest_on_top: true, showProgressbar: false, placement: { from: "top", align: "center" }, offset: 20, spacing: 10, z_index: 101031, delay: 3000, timer: 1000, animate: { enter: 'animated fadeInDown', exit: 'animated fadeOutUp' }, onClose: function(){ if(result.hasOwnProperty('redirect')){ if(data.redirect === 'reload'){ location.reload(); //Reload current page } else if(data.redirect === 'reload_table'){ oTable.draw(false); //Redraw datatables } else{ location.replace(base_url+data.redirect); //redirect to new page } } }, icon_type: 'class', }); } }, error: function(e) { console.log(e) } }); } function modal_form(title,noty,form_id){ bootbox.dialog({ title: title, message:"<div id='form'></div>", buttons: { success: { label: rpss, className: "btn-success", callback: function() { if(form_submit(form_id,noty) !== false){ } else { return false; } } }, danger: { label: "cancel", className: "btn-black", callback: function() { $.activeitNoty({ type: 'danger', icon : 'fa fa-minus', message : cancdd, container : 'floating', timer : 3000 }); } } } }); } function gotoPage(url){ location.replace(base_url+url); }
Copyright ©2021 || Defacer Indonesia