Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. var camposRequeridos={IDVisita: this.reparto.IDVisita, Expedicion: this.albaranes};
  2.  
  3. this.communicate.postRecogida(camposRequeridos);
  4.  
  5. export class CommunicateProvider {
  6. private defaultHeaders = {"Content-Type": "application/json"};
  7.  
  8. constructor(public http:HTTP,
  9. private auth: AuthProvider) {
  10. this.http.setDataSerializer('json');
  11. this.albaranes==null;
  12. this.cliente=null;
  13. this.reembolsos=0;
  14. }
  15.  
  16. get(URL, params, headers){
  17. let signedHeaders = this.auth.signRequest(headers);
  18. return this.http.get(URL, params, signedHeaders);
  19. }
  20.  
  21. post(URL, params, headers){
  22. let signedHeaders = this.auth.signRequest(headers);
  23. return this.http.post(URL, params, signedHeaders);
  24. }
  25.  
  26. postRecogida(camposRequeridos){
  27. return this.http.post(SERVER_URL + '/Recogida', camposRequeridos, this.auth.signRequest(this.defaultHeaders));
  28. }
  29. }
  30.  
  31. case 'POST':
  32. {
  33. parse_str($var, $POST);
  34. $_POST = array_merge((array)$_POST, (array)$POST);
  35. break;
  36. }
  37.  
  38. if(isset($_POST['Expedicion'])){
  39. if(is_string($_POST['Expedicion'])){
  40. $expediciones = json_decode($_POST['Expedicion'], true);
  41. }else{
  42. $expediciones = $_POST['Expedicion'];
  43. }
  44. }else{
  45. $expediciones = array();
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement