corretta chiamata ad un servizio senza dto ed eliminati problemi con variabile non definita

This commit is contained in:
2021-04-02 10:10:13 +02:00
parent cb4b012f32
commit cb6a54ec64
9 changed files with 20 additions and 19 deletions

View File

@@ -99,5 +99,5 @@ if(isset($_POST['cod_articolo'])){
VALUES ('$gest_ord', '{$_SESSION['data_ord']}', '$num_ord', '$riga_ordine', NULL, '$data_cons', '$codice_articolo', '$descrizione_articolo', '$unt_ord', '1', '$qta_ord', '$qta_omg', '$qta_reso', NULL, '$val_unt', NULL, '$qta_cnf', '$sconto5', '$sconto6', '$sconto7', '$sconto8', '0', '0', '$id_ord', '$serie', $cod_promo, '$flag_reso_riv')");
}
}
$str_header = isset($str_header) ? $str_header : "";
header('Location: carrello.php'.$str_header);

View File

@@ -336,6 +336,7 @@ foreach ($_POST as $key => $value){
}
}
$str_header = isset($str_header) ? $str_header : "";
if($i>0){
header("Location: carrello.php".$str_header);
} else{

View File

@@ -6,7 +6,7 @@ class Curl
/**
* @var string
*/
private $uri = 'http://192.168.3.15:8080/ems-api/';
private $uri = 'http://localhost:8080/ems-api/';
/**
* @var array
*/
@@ -58,6 +58,7 @@ class Curl
public function addHeaders($currentHeader = array())
{
$this->headers = array_merge($this->headers, $currentHeader);
return $this;
}
public function setHeaders()

View File

@@ -41,7 +41,7 @@ service($this->serviceName)
public $return;
public function __construct($endpoint = 'http://192.168.3.15:8080')
public function __construct($endpoint = 'http://localhost:8080')
{
/********* to use this class for different APIs, just change the service Root Path ***/
$this->endpoint = $endpoint;
@@ -276,7 +276,7 @@ service($this->serviceName)
/*7=>"Content-Length: ".count($this->body)*/
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -347,7 +347,7 @@ service($this->serviceName)
/*7=>"Content-Length: ".count($this->body)*/
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -393,7 +393,7 @@ service($this->serviceName)
6 => "password: " . $this->password
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -441,7 +441,7 @@ service($this->serviceName)
6 => "password: " . $this->password
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -478,7 +478,7 @@ service($this->serviceName)
6 => "password: " . $this->password
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -515,7 +515,7 @@ service($this->serviceName)
6 => "password: " . $this->password
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -552,7 +552,7 @@ service($this->serviceName)
6 => "password: " . $this->password
);
$curl = new Curl($this->serviceRootPath . $this->serviceName . '?profileDb=' . $this->profileDb);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();
@@ -591,7 +591,7 @@ service($this->serviceName)
'&dataDoc=' . $this->body['dataDoc'] . '&serDoc=' . $this->body['serDoc'] . '&numDoc=' . $this->body['numDoc'] .
'&codAnag=' . $this->body['codAnag'] . '&codDtip=' . $this->body['codDtip'] . '&versione=' . $this->body['versione']
);
/******** if url is not specified, default is = 'http://192.168.3.15:8080/ems-api/' ***********/
/******** if url is not specified, default is = 'http://localhost:8080/ems-api/' ***********/
/** $this->return = inserire qui la risposta di Curl. return conterrà a sua volta returnID ed error text **/
$curl->addHeaders($header);
$curl->setHeaders();

View File

@@ -12,7 +12,7 @@ class cust_conf extends common{
public $db_name = array( "studioml" => "DULCIAR", "cliente" => "DULCIAR");
public $db_username = array( "studioml" => "sa", "cliente" => "sa");
public $db_password = array( "studioml" => "sa", "cliente" => "sa");
public $endPoint = array( "studioml" => "192.168.3.15:8080", "cliente" => "192.168.1.5:8080");
public $endPoint = array( "studioml" => "localhost:8080", "cliente" => "192.168.1.5:8080");
public $web_username = array( "studioml" => "DULCIAR", "cliente" => "DULCIAR");
public $web_password = array( "studioml" => "DULCIAR", "cliente" => "DULCIAR");
public $lanipmask = array( "studioml" => "192.168.2", "cliente" => "192.168.1");

View File

@@ -11,7 +11,7 @@ class cust_conf extends common{
public $db_name = array( "studioml" => "GRAMM", "cliente" => "GRAMM");
public $db_username = array( "studioml" => "sa", "cliente" => "sa");
public $db_password = array( "studioml" => "sa", "cliente" => "sa");
public $endPoint = array( "studioml" => "192.168.3.15:8080", "cliente" => "192.2.0.6:8080");
public $endPoint = array( "studioml" => "localhost:8080", "cliente" => "192.2.0.6:8080");
public $web_username = array( "studioml" => "GRAMM", "cliente" => "GRAMM");
public $web_password = array( "studioml" => "GRAMM", "cliente" => "GRAMM");
public $lanipmask = array( "studioml" => "192.168.2", "cliente" => "192.2.0");

View File

@@ -10,7 +10,7 @@ class cust_conf extends common{
public $db_name = array( "studioml" => "vgalimenti", "cliente" => "vgalimenti");
public $db_username = array( "studioml" => "sa", "cliente" => "sa");
public $db_password = array( "studioml" => "sa", "cliente" => "sa");
public $endPoint = array( "studioml" => "192.168.3.15:8080", "cliente" => "10.107.107.8:8080");
public $endPoint = array( "studioml" => "localhost:8080", "cliente" => "10.107.107.8:8080");
public $web_username = array( "studioml" => "VGALIMENTI", "cliente" => "VGALIMENTI");
public $web_password = array( "studioml" => "VGALIMENTI", "cliente" => "VGALIMENTI");
public $lanipmask = array( "studioml" => "192.168.2", "cliente" => "10.107.107");

View File

@@ -248,10 +248,10 @@ function getNewNumOrd($gestione, $serie, $anno)
$client = new RestCall($db->getEndpoint());
$body = array(
"as_gestione" => $gestione, /***string **/
"as_serie" => $serie, /** string */
"ai_anno" => $anno, /* int */
"ai_numOrd" => 0 /* int */
"gestione" => $gestione, /***string **/
"serie" => $serie, /** string */
"anno" => $anno, /* int */
"numOrd" => 0 /* int */
);
$params = array(

View File

@@ -115,7 +115,6 @@ class Mssql {
function halt($msg) {
printf("Database error: %s\n", $msg);
printf("MsSQL Error: %s (%s)\n");
die("Session stopped.");
}
function rs2Array() {