createElement('GetItemCounters'); $reqga->appendChild($rootga); $rootga->setAttribute('id', utf8_encode($stknum)); $rootga->setAttribute('unrestricted', 'true'); $message = $reqga->saveXML(); $file = 'https://' . $host . ':' . $hostport . '/~xml/' . $hostdossier; // $ch = curl_init($file); $header = array(); $length = strlen($message); array_push($header, 'Content-Type: text/xml; charset=UTF-8'); array_push($header, 'Content-Length: ' . (string)$length); array_push($header, 'Authorization: Basic ' . base64_encode($loginintegral . ':' . $passwordintegral)); curl_setopt($ch, CURLOPT_URL, $file); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POSTFIELDS, $message); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_SSLVERSION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $tmp = curl_exec($ch); $ch_info = curl_getinfo($ch); // curl_close($ch); if ($ch_info['http_code'] != 200) return FALSE; $tmp = preg_replace("[\n\r\t]", "", $tmp); if ($tmp == '') return FALSE; $respga = new DOMDocument(); return ($respga->loadXML($tmp) && GetItemCountersDetail($respga, $stknum, $zone1, $zone2, $zone3, $zone4)); } function GetItemcountersDetail($respga, $stknum, &$zone1, &$zone2, &$zone3, &$zone4){ $zone1 = 0; $zone2 = 0; $zone3 = 0; $zone4 = 0; $rootga = $respga->documentElement; if ($rootga->tagName != 'GetItemCountersResult') return FALSE; $rootga = $rootga->firstChild; if ($rootga->tagName == 'Error') return FALSE; $rootga = $rootga->firstChild; if ($rootga->tagName == 'Error') return FALSE; $zonecount = $rootga->getAttribute('count'); $zones = $rootga->getElementsByTagName("Zone"); if ($zones != '0') { foreach($zones as $zone){ $zoneid = $zone->getAttribute('id'); $aantal[$zoneid] = $zone->getElementsByTagName("QtStock")->item(0)->nodeValue; $zone1 = (double)$aantal['1']; $zone2 = (double)$aantal['2']; $zone3 = (double)$aantal['3']; $zone4 = (double)$aantal['4']; } } return TRUE; } ?>
Intercycle Logo
Login :

Password :