55 lines
1.3 KiB
JavaScript
Executable File
55 lines
1.3 KiB
JavaScript
Executable File
function DistribucionPedido(){
|
|
|
|
$("type").value = "actualizarDist";
|
|
|
|
new Ajax.Request(WEB_ROOT+'/ajax/pedidos-distribucion.php',
|
|
{
|
|
method:'post',
|
|
parameters: $('frmDistribucion').serialize(),
|
|
onLoading: function(){
|
|
$("loader").show();
|
|
},
|
|
onSuccess: function(transport){
|
|
var response = transport.responseText || "no response text";
|
|
var splitResponse = response.split("[#]");
|
|
console.log(response);
|
|
$("loader").hide();
|
|
|
|
if(splitResponse[0] == "ok")
|
|
window.location.href = WEB_ROOT + "/pedidos";
|
|
else{
|
|
ShowStatus(splitResponse[1]);
|
|
HideFview();
|
|
}
|
|
|
|
},
|
|
|
|
onFailure: function(){ alert('Something went wrong...') }
|
|
|
|
});
|
|
|
|
}//DistribucionPedido
|
|
|
|
function UpdateSaldoPrendas(id){
|
|
|
|
$("type").value = "updateSaldoPrendas";
|
|
$("idProd").value = id;
|
|
|
|
new Ajax.Request(WEB_ROOT+'/ajax/pedidos.php',
|
|
{
|
|
method:'post',
|
|
parameters: $('frmDistribucion').serialize(),
|
|
onSuccess: function(transport){
|
|
var response = transport.responseText || "no response text";
|
|
var splitResponse = response.split("[#]");
|
|
|
|
if(splitResponse[0] == "ok")
|
|
$("txtCantPrendas_"+id).innerHTML = splitResponse[1];
|
|
|
|
},
|
|
|
|
onFailure: function(){ alert('Something went wrong...') }
|
|
|
|
});
|
|
|
|
} |