Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. for (var i = 0 ; i<tfactura.length ; i++){
  2. var nombre2 = tfactura[i];
  3. var cantidad = tcantidad[i];
  4. var precio = tprecio[i];
  5. $.ajax({
  6. type: "GET",
  7. url: "factura1",
  8. data: {nombre2: nombre2, cantidad: cantidad, precio: precio},
  9. dataType: 'json'
  10. });
  11. }
  12.  
  13. public function factura1(Request $request){
  14. $precio = $request->precio;
  15. $nombre = $request->nombre2;
  16. $cantidad = $request->cantidad;
  17.  
  18. $request->session()->push('nombres', $nombre);
  19. $request->session()->push('precios2', $precio);
  20. $request->session()->push('cantidades', $cantidad);
  21. }
  22.  
  23. public function borrarSessiones(){
  24. session()->forget(['cantidades', 'precios2','nombres']);
  25. }
  26.  
  27. function borrarS(){
  28. $.ajax({
  29. type: "GET",
  30. url: "borrarSessiones",
  31. dataType: 'json'
  32. });
  33.  
  34. function recuperarD2(){
  35. $.ajax({
  36. type: "GET",
  37. url: "recuperarD2",
  38. dataType: 'json',
  39. success : function (response){
  40. for ( var i=0; i<response.length; i++){
  41. tfactura[i] = response[i];
  42. }
  43. recuperarD3();
  44. }
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement