Тема: PHP SoapClient
Допоможіть розшифрувати файл php. Що за що відповідає?
[code=PHP]
<?if(!defined("TDM_PROLOG_INCLUDED") || TDM_PROLOG_INCLUDED!==true)die();
if(extension_loaded('soap')) {
$SClient = @new SoapClient("http://назав сайту/....../soap.wsdl", array('encoding'=>'utf8'));
foreach($arWsParts as $arPart){
$arCRes = $SClient->GetPrice($arPart['ARTICLE'], $arPart['BRAND'], $arWS['LOGIN'], $arWS['PASSW'], $arWS['CURRENCY']); //Number, Brand, Login, Pass, Currency (Бренд и валюта не обязательные поля)
//echo '<pre>'; print_r($arCRes); echo '</pre>';
if($arCRes['Error']==''){
foreach($arCRes as $arRes){
//Make valid Price array
$arPrice = TDMPriceArray();
$arPrice["LINK_TO_BKEY"] = $arPart['BKEY']; //If links (cross) number returned
$arPrice["LINK_TO_AKEY"] = $arPart['AKEY']; //If links (cross) number returned
//Webservice data
$arPrice["ARTICLE"] = $arRes['Number'];
$arPrice["ALT_NAME"] = $arRes['Name'];
$arPrice["BRAND"] = $arRes['Brand'];
$arPrice["PRICE"] = floatval($arRes['Price']);
$arPrice["CURRENCY"] = $arRes['Currency'];
$arPrice["DAY"] = $arRes['DeliveryTime'];
$arPrice["AVAILABLE"] = $arRes['Quantity'];
$arPrice["STOCK"] = $arRes['SupplierCode'];
//Price options
$arOps = Array();
if($arRes['Weight']>0){$arOps['WEIGHT']=($arRes['Weight']*1000);}
if($arRes['DamagedFlag']=='Y'){$arOps['DAMAGED']=1;}
if($arRes['UsedFlag']=='Y'){$arOps['USED']=1;}
if($arRes['RestoredFlag']=='Y'){$arOps['RESTORED']=1;}
$arPrice["OPTIONS"] = TDMOptionsImplode($arOps,$arPrice);
//Add new record
$arPrices[] = $arPrice;
}
}else{
if($arCRes['Error']=='Details http://назав сайту/index.php?act=show_page&cmd=limits'){
$ERROR = 'Error. <a href="http://назав сайту/index.php?act=show_page&cmd=limits" target="_blank">Details here</a>';
}
}
}
}
?>[/code]