You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

  1. <?php
  2. require_once "/var/www/html/pedvenesp/prgdmug/F_DMUG.php";
  3. $v_suc = "";
  4. $v_ped = "";
  5. foreach($_POST as $campo => $valor)
  6. {
  7. if($campo=="suc")
  8. $v_suc=$valor;
  9. if($campo=="ped")
  10. $v_ped=$valor;
  11. error_log("campo :".$campo);
  12. }
  13. //error_log("---sucursal---: " . $v_suc ."---ped---:" . $v_ped);
  14. $server= "localhost";
  15. $port = 1030;
  16. $hs = "DEMIURGO10-MCANET";
  17. $user = "general";
  18. $pass = "123456789";
  19. error_log("Buscando productos por medio de filtros");
  20. $pid = getmypid();
  21. $limit = 100;
  22. $veces_error_server = 0;
  23. /* Crea un objeto para el manejo postgres */
  24. $ConDMUG = new ConexDMUG( $server , $port , $hs ,$user , $pass );
  25. $ConDMUG->SetProgram( "Detalle_pedesp" );
  26. $ConDMUG->SetParameter( "sucursal" , $v_suc );
  27. $ConDMUG->SetParameter( "pedido" , $v_ped);
  28. if ( $ConDMUG->Execute_DMUG() < 0)
  29. {
  30. error_log("$veces_error_server".$veces_error_server);
  31. $veces_error_server++;
  32. if ( $veces_error_server > 2 )
  33. {
  34. error_log("exit();");
  35. exit();
  36. }
  37. sleep(5);
  38. continue;
  39. }
  40. error_log("XML: " . $ConDMUG->xmlraw);
  41. $RESULTADO = $ConDMUG->GetChild( "STRERROR" );
  42. echo json_encode($ConDMUG->xmlrequest);
  43. $ConDMUG->CloseConex();
  44. exit();
  45. ?>