Primer commit del sistema avantika sin cambios
This commit is contained in:
98
javascript/envios-tienda-cedis.js
Executable file
98
javascript/envios-tienda-cedis.js
Executable file
@@ -0,0 +1,98 @@
|
||||
Event.observe(window, 'load', function() {
|
||||
|
||||
AddEditEnviosListeners = function(e) {
|
||||
|
||||
var el = e.element();
|
||||
var del = el.hasClassName('spanEnviar');
|
||||
var id = el.identify();
|
||||
|
||||
if(del == true){
|
||||
EnviarEnvio(id);
|
||||
return;
|
||||
}
|
||||
|
||||
del = el.hasClassName('spanAdd');
|
||||
if(del == true){
|
||||
RecibirEnvio(id);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($('contenido')!= undefined)
|
||||
$('contenido').observe("click", AddEditEnviosListeners);
|
||||
|
||||
});
|
||||
|
||||
function EnviarEnvio(id){
|
||||
|
||||
var message = "Enviar Productos?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios.php',{
|
||||
method:'post',
|
||||
parameters: {type: "updateEnvioDevolucion", envioId: id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
//ShowStatus(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function RecibirEnvio(id){
|
||||
|
||||
var message = "Productos recibido?";
|
||||
|
||||
if(!confirm(message)){
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios.php',{
|
||||
method:'post',
|
||||
parameters: {type: "updateEnvioDevolucion", envioId: id},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
//ShowStatus(splitResponse[1]);
|
||||
$('contenido').innerHTML = splitResponse[2];
|
||||
},
|
||||
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function Search()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/envios.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmSearch').serialize(),
|
||||
onLoading: function(){
|
||||
$('loadBusqueda').show();
|
||||
$('contenido').innerHTML = '';
|
||||
},
|
||||
onSuccess: function(transport){
|
||||
var response = transport.responseText || "no response text";
|
||||
var splitResponse = response.split("[#]");
|
||||
|
||||
$('loadBusqueda').hide();
|
||||
|
||||
if(splitResponse[0] == "ok")
|
||||
$('contenido').innerHTML = splitResponse[1];
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user