<?php
require_once 'conf.php';

// STEP 0 : Get the values 
foreach ($_REQUEST as $var => $val) {
	$request[$var] = $val;
}

// STEP 1 : soap flow options
$options = array(
	'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
	'cache_wsdl' => WSDL_CACHE_NONE,
	'soap_version' => SOAP_1_1,
	'encoding' => 'UTF-8'
);
// STEP 2 : Soap client initialization
$client = new SoapClient(WS_GATEWAY . 'business-lines-v2?wsdl', $options);

// STEP 3 : Soap call on GET method of business-lines-v2 webservice
$result = $client->get(array('parameters'=>array(
	'wsLogin'=> WS_LOGIN,
	'wsPassword'=> WS_PSW,
	'locale' => $request['locale']
)));
?>
<select onchange="changeWebsiteTopic(this.value,'<?php echo $request['locale']; ?>')" style="width:300px;" name="websiteBusinessLineId">
	<option value="0">----- choisissez -----</option>
<?php 
foreach ($result->getResult->businessLines->item as $business) {
	echo '<option value="'.$business->id.'">'.$business->label.'</option>' . "\n";
}
?>
</select> 