| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/imobles/ui/lib/jslib/ |
Upload File : |
/* global _list_units, app_url, _L, existingFiles */
$(document).ready(function () {
$(".progress").hide();
$("#emsg").hide();
$(".select2").select2({
theme: "bootstrap"
});
$("#submit").click(function (e) {
e.preventDefault();
$('#ibox_form').block({ message: null });
var _url = $("#_url").val();
$.post(_url + 'ps/add-post/', $("#rform" ).serialize())
.done(function (data) {
setTimeout(function () {
var sbutton = $("#submit");
var _url = $("#_url").val();
if ($.isNumeric(data)) {
location.reload();
}
else {
$('#ibox_form').unblock();
$("#emsgbody").html(data);
$("#emsg").show("slow");
}
}, 2000);
});
});
loadUnits('');
});
//função que carrega as unidades de medidas no select
function loadUnits(val){
//carrega os grupos;
$.getJSON($("#_url").val() + 'unit/ajax-list',function (j) {
var options = '';
// options += '<option value="">'+ _L['Select'] + '</option>';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].id + '">'+ j[i].initials+" - " +j[i].name + '</option>';
//atribuo as opções retornadas a lista de unidades
//utilizzo para mostrar o ítem correto em estoque
// _list_units[j[i].id]=j[i].initials;
}
// $('#commercial_unit').html(options); //carrega nos dois select
// $('#tax_unit').html(options);
$('#unit').html(options);
if('val'!=''){
$('#unit').select2('val',val);
}
});
}