Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <td>Vendible?</td>
  2. <td><input type="checkbox" name="cboxvendibleEdit" id="var6" />
  3. </td>
  4.  
  5.  
  6.  
  7. if (isset($_POST['xCodigo']))
  8. {
  9. $id = $_POST['xCodigo'];
  10. $v0 = $_POST['xDescripcion'];;
  11. $v1 = $_POST['xpreciocompra'];;
  12. $v2 = $_POST['xprecioventa'];;
  13. $v3 = $_POST['xcombocategoria'];;
  14. $v4 = $_POST['xcombomarca'];;
  15. $v5 = $_POST['xcomboseccion'];;
  16. $v6 = ($_POST['cboxvendibleEdit']) ? 1 : 0;
  17. $conexion->edit($id,$v0,$v1,$v2,$v3,$v4,$v5,$v6);
  18.  
  19. //boton actualizar
  20. $('#actualizar').on('click', function(){
  21. var v0 = $('#var0').val();
  22. var v1 = $('#var1').val();
  23. var v2 = $('#var2').val();
  24. var v3 = $('#var3').val();
  25. var v4 = $('#var4').val();
  26. var v5 = $('#var5').val();
  27. var v6 = $('#var6').val();
  28. if (v0.length>0) { //valida requerido
  29. $('#xmensaje').html('<p></p>');
  30. var xparametros = $('#formUpdate').serialize();
  31. $.ajax({ //envia POST a otro php
  32. type: 'POST',
  33. url: 'item.iud.php',
  34. data: xparametros,
  35. success: function(data){
  36. var url = document.URL;
  37. location.href = url;
  38. }
  39. });
  40. }
  41. else {
  42. $('#xmensaje').html('<p class="alert alert-danger">Faltan algunos datos!</p>');
  43. }
  44. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement