����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.206
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 :  /var/www/html/muebles/application/collection/nppBackup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/muebles/application/collection/nppBackup/j_item.js.2025-01-02_002937.bak
$(document).ready( function () 
{
	set_focus("#txtdatein");
	
	 $("#txtdatein").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtdateout");
		}
      });
	  
	   $("#txtdateout").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#btnCalcularCobranza");
		}
      });
	  //txtIdEmpl
	   $("#txtIdEmpl").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#btnBuscar");
		}
      });
	
});


//Calcular cobranza se hace los viernes y se checa que semana es 
//para saber cuales cuentas si se van a cobrar
//
$(document).on( "click","#btnCalcularCobranza", function() {
	
		var txtdatein = $("#txtdatein").val();
			
			if(txtdatein == '' || txtdatein == null)
				{
					$.notify({
						message: "Primero Digite el fecha inicial"
					},{
						type: 'warning',
						delay: 8000,
					});
					return;
				}
				
		var txtdateout = $("#txtdateout").val();
			
			if(txtdateout == '' || txtdateout == null)
				{
					$.notify({
						message: "Primero Digite fecha final"
					},{
						type: 'warning',
						delay: 8000,
					});
					return;
				}		
	
			$.notify({
						message: "Generando Cobranza....Verifique!"
					},{
						type: 'info',
						delay: 8000,
				});
	//funcion generar cobranza			
	init_data_without_cobrador(txtdatein,txtdateout);
});

function init_data_without_cobrador(txtdatein,txtdateout){
	
	var value = {
		txtdatein : txtdatein,
		txtdateout: txtdateout,
		method : "getdata_without_cobrador"
	};
	$('#table_search').DataTable({
		"paging": true,
		"destroy": 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_client" },
		{ "data": "name_client" },
		{ "data": "sale_date" },
		{ "data": "mercancia" },
		{ "data": "total" },
		{ "data": "txtpayment_period" },
		{ "data": "enganche" },
		{ "data": "pay_min" },
		{ "data": "payday" },
		{ "data": "paydate" },
		{ "data": "fechaUltimoAbono" },
		{ "data": "atrazo" },
		{ "data": "montoAtrazo" },
		{ "data": "balance" },
		]
	});
	$("#table_search_filter").addClass("pull-right");
	
	 
				set_focus("#txtIdEmpl");
		
}

//datos iniciales de cobranza 
function init_data(){
	
	var value = {
		method : "getdata"
	};
	$('#table_search').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": "sale_id" },
		{ "data": "id_client" },
		{ "data": "name_client" },
		{ "data": "sale_date" },
		{ "data": "total" },
		{ "data": "pay_min" },
		{ "data": "payday" },
		{ "data": "txtpayment_period" },
		{ "data": "enganche" },
		{ "data": "date_pay1" },
		{ "data": "balance" },
		{ "data": "id_collector" },
		{ "data": "cobrador" },
		{ "data": "button" },
		]
	});
	$("#table_search_filter").addClass("pull-right");
	
}

$(document).ready(function(){
   $("#selector-seller").load('../model/select_seller.php');
});


//BUSCAR EMPLEADO COBRADOR
		$( "#txtsearchitem" ).autocomplete({
		search  : function(){$(this).addClass('working');},
		open    : function(){$(this).removeClass('working');},
		source: function(request, response) {
			$.getJSON("autocomplete_item.php", { term: $('#txtsearchitem').val() }, 
				response); },
			minLength:1,
			select:function(event, ui){
				
				$("#txtIdEmpl").val(ui.item.id_empl);	
				
			}
		}).autocomplete( "instance" )._renderItem = function( ul, item ) {
		return $( "<li>" )
		.append( "<dl><dt>"+item.label + "</dt>"+item.id_ruta+ "</dl>"  )
		.appendTo( ul );
};

//BUSCAR VENTAS CON RELACION A VENDEDOR
$(document).on( "click","#btnBuscar", function() {
	
		//console.log("buscar por cobrador");
						
			var id_empl = $("#txtIdEmpl").val();
			
			if(id_empl == '' || id_empl == null)
				{
					$.notify({
						message: "Primero Digite el nombre del cobrador para continuar"
					},{
						type: 'warning',
						delay: 8000,
					});
					return;
				}
				var btnBuscar = document.getElementById('btnBuscar');
				var btnSearch = document.getElementById('txtsearchitem');
			//hacemos el proceso de busqueda y refrescamos la tabla	
				list_data(id_empl);
				btnBuscar.disabled=true;
				btnSearch.disabled=true;
			
});

//BUSCAR VENTAS CON RELACION A VENDEDOR
$(document).on( "click","#btnBuscarRecibir", function() {
	
		
						
			var id_empl = $("#txtIdEmpl").val();
			
			if(id_empl == '' || id_empl == null)
				{
					$.notify({
						message: "Primero Digite el nombre del cobrador para continuar"
					},{
						type: 'warning',
						delay: 8000,
					});
					return;
				}
				var btnBuscar = document.getElementById('btnBuscarRecibir');
				var btnSearch = document.getElementById('txtsearchitem');
			//hacemos el proceso de busqueda y refrescamos la tabla	
				list_dataR(id_empl);
				btnBuscar.disabled=true;
				btnSearch.disabled=true;
			
});


//buscar por cobrador asignar cobranza
function list_data(id_empl){
	var value = {
		id_empl : id_empl,
		method : "list_data"
	};
	$('#table_search').DataTable({
		"paging": true,
		"destroy": true,
		"lengthChange": false,
		"searching": true,
		"ordering": true,
		"info": false,
		"responsive": true,
		"autoWidth": false,
		"pageLength": 50,
		"Search": "Buscar:",
		"dom": '<"top"f>rtip',
		"ajax": {
			"url": "c_search_item.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		/*
			{ "data": "id_client" },
		{ "data": "name_client" },
		{ "data": "sale_date" },
		{ "data": "mercancia" },
		{ "data": "total" },
		{ "data": "txtpayment_period" },
		{ "data": "enganche" },
		{ "data": "pay_min" },
		{ "data": "payday" },
		{ "data": "paydate" },
		{ "data": "fechaUltimoAbono" },
		{ "data": "atrazo" },
		{ "data": "montoAtrazo" },
		{ "data": "balance" },
		
		*/
		{ "data": "id_client" },
		{ "data": "name_client" },
		{ "data": "fecha_venta" },
		{ "data": "mercancia" },
		{ "data": "total" },
		{ "data": "txtpayment_period" },
		{ "data": "enganche" },
		{ "data": "pay_min" },
		{ "data": "payday" },
		{ "data": "fecha_venta" },
		{ "data": "fechaUltimoAbono" },
		{ "data": "semanaAtrazadas" },
		{ "data": "montoAbonosAtrazados" },
		{ "data": "balance" },
		{ "data": "boton" },
		
		]
	});
	$("#table_search_filter").addClass("pull-right");
	
	set_focus("#AsignarCobranza");
	
}

function list_dataR(id_empl){
	var value = {
		id_empl : id_empl,
		method : "list_dataR"
	};
	$('#table_recibe').DataTable({
		"paging": true,
		"lengthChange": false,
		"searching": true,
		"ordering": true,
		"info": false,
		"responsive": true,
		"autoWidth": false,
		"pageLength": 50,
		"Search": "Buscar:",
		"dom": '<"top"f>rtip',
		"ajax": {
			"url": "c_search_item.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		{ "data": "sale_date" },
		{ "data": "total" },
		{ "data": "enganche" },
		{ "data": "date_pay1" },
		{ "data": "pay_min" },
		{ "data": "payday" },
		{ "data": "txtpayment_period" },
		{ "data": "fechaUltimoAbono" },
		{ "data": "semanaAtrazadas" },
		{ "data": "montoAbonosAtrazados" },
		{ "data": "balance" },
		{ "data": "id_collector" },
		]
	});
	$("#table_recibe_filter").addClass("pull-right");
	
}
		
//buscar detalles de la venta y datos del cliente
$(document).on( "click",".btnedit", function() {
	
	var id_item = $(this).attr("id_item");
	$("#Detallesdmodal").modal("show");
	
});

//cambiar de ruta
$(document).on( "click",".btndelete", function() {
	var id_item = $(this).attr("id_item");
	var barcode = $(this).attr("barcode");
	
	$("#passwordmodal").modal("show");
	$("#txthidetrxid").val($(this).attr("id_item"));
	$("#txthiddentrans").val(barcode);
	$("#notepassword").html("Por Favor Ingrese contraseña para continuar!");
	set_focus("#txtpass");
	

});

//funcion detalles
function getDetails(){
	
	var value = {
		id_item: id_item,
		method : "get_detail_item"
	};
	$.ajax(
	{
		url : "c_item.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			var hasil = jQuery.parseJSON(data);
			data = hasil.data;
			$("#inputcrud").val("E");
			
			//se se deshabilita input barcode
			$("#txtcodebar").val(data.barcode);
			var BarcodeInput = document.getElementById('txtcodebar');
			BarcodeInput.disabled =true;
			$("#txtiditem").val(data.id_item);
			$("#txtname").val($.trim(data.item_name));
			$("#txtunit").val($.trim(data.unit));
			$("#txtstock").val(data.stock);
			$("#txtprice").val(addCommas(data.price));
			$("#txtnote").val($.trim(data.note));
			$("#Detallesdmodal").modal('show');
			
			set_focus("#txtname");
			
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			alert("Error de busqueta");
		}
	});
	
}

//asignamos cobranza a ruta al repartidor correspondiente
$(document).on( "click","#AsignarCobranza", function() {
		SavePendingRoute();
});




$(document).on( "click","#btnCambiarCobrador", function() {
			$.notify({
						message: "Cambio de Ruta Exitosa....Verifique!"
					},{
						type: 'info',
						delay: 3000,
				});
});

$(document).on( "click","#btnReset", function() {
		$("#txtIdEmpl").val(" ");
});

//funcion detalles
function SavePendingRoute(){
	var id_empl = $("#txtIdEmpl").val();
	
	var value = {
		id_empl: id_empl,
		method : "save_trans"
	};
	$.ajax(
	{
		url : "c_pos.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			var hasil = jQuery.parseJSON(data);
			data = hasil.data;
			$.notify({
						message: "Se Aplico Cobranza a ruta: " + id_empl
					},{
						type: 'info',
						delay: 5000,
				});
			
			xid_sales =data.cobrador;
			
			if(data.result == true){
				$.notify({
						message: "Registros....Guardados!"
					},{
						type: 'success',
						delay: 5000,
				});
			}
							var mapForm = document.createElement("form");
									mapForm.target = "Map";
									mapForm.method = "POST"; // or "post" if appropriate
									mapForm.action = "purchase.php";
									
									var mapInput = document.createElement("input");
									mapInput.type = "hidden";
									mapInput.name = "cobrador";
									mapInput.value = xid_sales;
									mapInput.visibility = true;
									mapForm.appendChild(mapInput);
									
									document.body.appendChild(mapForm);

									map = window.open("", "Map", "status=0,title=0,height=300,width=600,scrollbars=1");

								if (map) {
									mapForm.submit();
								} else {
									$.notify({
										message: " Revisar Explorador, ventanas emergentes "
									},{
										type: 'Debes permitir ventanas emergentes para que puedas imprimir ticket',
										delay: 5000,
									});
									
								}
			
			
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			alert("Error de insercion");
		}
	});
	
}




















//++++++++++++++++++++++++++++++++++++++++++++++++++++

$(document).on( "click","#btnadd", function() {
	$(".contentharga").remove();
	$("#modalmasteritem").modal('show');
	
	newitem();
});


$(document).on( "click","#in_button", function() {
	$("#Entradadmodal").modal('show');
});

function newitem()
{
	$("#txtiditem").val("*New");
	$("#txtcodebar").val("");
	$("#txtname").val("");
	$("#txtstock").val(0);
	$("#txtprice").val(0);
	$("#txtnote").val("");
	$("#inputcrud").val("N");
	
	//actualizado al 20/04/2021
	var BarcodeInput = document.getElementById('txtcodebar');
	BarcodeInput.disabled =false;

	$("#txtunit").change();
	set_focus("#txtcodebar");
}



$(document).on( "click","#btnsaveitem", function() {
	var id_item = $("#txtiditem").val();
	var barcode = $("#txtcodebar").val();
	var item_name = $("#txtname").val();
	var unit = $("#txtunit").val();
	var stock = cleanString($("#txtstock").val());
	var price = cleanString($("#txtprice").val());
	var note = $("#txtnote").val();
	var crud=$("#inputcrud").val();
	if(crud == 'E'){
		if(id_item == '' || id_item== null ){
			$.notify({
				message: "registro invalido"
			},{
				type: 'warning',
				delay: 8000,
			});		
			$("#txtiditem").focus();
			return;
		}	
	}
	
	
	if(item_name == '' || item_name== null ){
		$.notify({
			message: "por favor ingrese nombre"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtname").focus();
		return;
	}

	var value = {
		id_item: id_item,
		barcode: barcode,
		item_name: item_name,
		unit:unit,
		stock:stock,
		price:price,
		note:note,
		crud:crud,
		method : "save_item"
	};
	$(this).prop('disabled', true);
	proccess_waiting("#infoproses");
	$.ajax(
	{
		url : "c_item.php",
		type: "POST",
		data : value,
		success: function(data, textStatus, jqXHR)
		{
			$("#btnsaveitem").prop('disabled', false);
			$("#infoproses").html("");
			var data = jQuery.parseJSON(data);
			if(data.ceksat == 0){
				$.notify(data.error);
			}else{
				if(data.crud == 'N'){
					if(data.result == 1){
						$.notify('Registro Guardado!');
						var table = $('#table_item').DataTable(); 
						table.ajax.reload( null, false );
						newitem();				
					}else{
						$.notify({
							message: "Error save item, error :"+data.error
						},{
							type: 'danger',
							delay: 5000,
						});
						set_focus("#txtiditem");
					}
				}else if(data.crud == 'E'){
					if(data.result == 1){
						$.notify('Registro Actualizado');
						var table = $('#table_item').DataTable(); 
						table.ajax.reload( null, false );
						$("#modalmasteritem").modal("hide");
					}else{
						$.notify({
							message: "Error al actualizar item, error :"+data.error
						},{
							type: 'danger',
							delay: 5000,
						});					
						set_focus("#txtiditem");
					}
				}else{
					$.notify({
						message: "Registro Invalido!"
					},{
						type: 'danger',
						delay: 5000,
					});	
				}
			}
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
			$("#btnsaveitem").prop('disabled', false);
		}
	});
	
});

$(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();
});	

$(document).on( "click","#btnNewcategory", function() {
	$("#inputcrud2").val('N');
});		


$(document).ready(function(){
   $("#selector-seller").load('../model/select_category.php');
});


$(document).on("blur","#selector-seller",function (){
	var valor =  document.getElementById('selector-seller').value ;
	document.getElementById('id_seller').innerHTML = valor;
	document.getElementById('id_seller_ok').value = valor;
	
	var combo = document.getElementById("selector-seller");
	var selected = combo.options[combo.selectedIndex].text;
	
	$.notify({
		message: "Para Editar " + selected + " ahora escriba el nuevo nombre en el renglon, Para eliminarlo solo presione Eliminar "
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtname2").focus();
	
});

$(document).on( "click","#btnsavecategory", function() {

	var item_name = $("#txtname2").val();
	
	var crud=$("#inputcrud2").val();
	
	var cat = $("#id_seller_ok").val();
	
	if(crud == 'E'){
		if(cat == '' || cat == null ){
				$.notify({
					message: "Para Editar Selecciona primero que categoria se editara"
				},{
					type: 'warning',
					delay: 8000,
				});		
				$("#selector-seller").focus();
				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 = {
		item_name: item_name,
		cat: cat,
		crud:crud,
		method : "save_category"
	};
	$(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 == false){
						$.notify('Registro Guardado!');
						var table = $('#table_item').DataTable(); 
						table.ajax.reload( null, false );
										
					}else{
						$.notify({
							message: "Error al Guardar Categoria # :" + data.result
						},{
							type: 'danger',
							delay: 5000,
						});
						set_focus("#txtiditem");
					}
				}else{
					
					if(crud == 'E'){
						if(data.result == true){
							$.notify('Registro Actualizado!');
						}else{
							$.notify({
								message: "Error al Actualizar Categoria # :" + data.result
							},{
								type: 'danger',
								delay: 5000,
							});
							set_focus("#txtiditem");
						}
					}else{
						
						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");
								}
							}else{
									$.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);
		}
	});
	
});



$(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();
				var barcode = $("#txthiddentrans").val();
				
					swal({   
					title: "Borrar Producto",   
					text: "Eliminar artículo maestro con Codigo : " + barcode + " ?", 
					type: "warning",   
					showCancelButton: true,   
					confirmButtonColor: "#DD6B55",   
					confirmButtonText: "Borrar",   
					closeOnConfirm: true }, 
					function(){   
						var value = {
							id_item: id_item,
							method : "delete_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 Borrado');
									var table = $('#table_item').DataTable(); 
									table.ajax.reload( null, false );
									init_data();
								}else{
									$.notify({
										message: "Error Inesperado!, Valor Error : "+ data.error
									},{
										type: 'warning',
										delay: 8000,
									});	
								}
							},
							error: function(jqXHR, textStatus, errorThrown)
							{
								
								$.notify({
										message: "Error al borrar Registro, # : "+ data.error
									},{
										type: 'eror',
										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();
		}
	});


});

function openModalCollector(idCollector,saleId){
	$("#sale-id").val(saleId);
	$("#modal-change-collector").modal("show");
	$.ajax({
        url: "getCollectors.php",
        type: "post",
        data: {idCollector},
        success: function ({data}) {
			var list = $("#select-collectors");
			$.each(data, function(index, item) {
  				list.append(new Option(item.name, item.id_cust));
			});
        },
        error: function(jqXHR, textStatus, errorThrown) {
           console.log(textStatus, errorThrown);
        }
    })
}

function changeCollector(){
	
		let idCollector=$("#select-collectors").val();
		let saleId=$("#sale-id").val();
	console.log(idCollector,saleId);
	$.ajax({
        url: "changeCollector.php",
        type: "post",
        data:{idCollector,saleId},
        success: function (response) {
			console.log(response);
        },
        error: function(jqXHR, textStatus, errorThrown) {
           console.log(textStatus, errorThrown);
        }
    })
}

Youez - 2016 - github.com/yon3zu
LinuXploit