extranet/library/Giant/CreditData.lib.php
Damien LASSERRE c8ef0d9d17 Modification de giant
Création des acces au rapport ! + library réutilisable.
2011-07-04 15:26:22 +00:00

185 lines
6.5 KiB
PHP

<?php
define("DATA_SET_VERSION", 1.0);
Class CreditData extends GiantFunction
{
private $soapG;
protected $companyId;
protected $methodes = array(
'RetreiveOptions', 'OrderDataSet',
'RetrieveOrderStatus', 'RetrieveDataSet',
'StartInvestigation', 'StartMonitoring',
'UpdateMonitoringOptions', 'StopMonitoring',
'RetrieveMonitoringEventsForOrder', 'RetrieveMonitoringEventsForCustomer',
'RetrieveMonitoringEventsForConsumer', 'Ping'
);
public function __construct($soapG, $companyId)
{
$this->soapG = $soapG;
$this->companyId = $companyId;
$this->soapG->getAllMethodesFromWsdl('credit-data');
}
protected function RetreiveOptions()
{
$parametres = new stdClass();
$parametres->CompanyId = $this->companyId;
try {
$result = $this->soapG->RetrieveOptions($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function OrderDataSet($DataSetType, $Version = null, $LanguageCode = 'en')
{
$parametres = new stdClass();
$parametres->CompanyId = $this->companyId;
$parametres->DataSetType = $DataSetType;
$parametres->DataSetVersion = DATA_SET_VERSION;
$parametres->Version = $Version;
$parametres->LanguageCode = 'en';
try {
$result = $this->soapG->OrderDataSet($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveOrderStatus($InternalOrderId)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
try {
$result = $this->soapG->RetrieveOrderStatus($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveDataSet($InternalOrderId)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
try {
$result = $this->soapG->RetrieveDataSet($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StartInvestigation($DataSetType, $ServiceLevelName, $Version = null, $LanguageCode = null)
{
$parametres = new stdClass();
$parametres->DataSetType = $DataSetType;
$parametres->ServiceLevelName = $ServiceLevelName;
$parametres->Version = $Version;
$parametres->LanguageCode = $LanguageCode;
try {
$result = $this->soapG->StartInvestigation($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StartMonitoring($CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version = null, $LanguageCode = null)
{
$parametres = new stdClass();
$parametres->CategorieName = $CategorieName;
$parametres->EventType = $EventType;
$parametres->PreferredStartDate = $PreferredStartDate;
$parametres->PreferredEndDate = $PreferredEndDate;
$parametres->Version = $Version;
$parametres->LanguageCode = $LanguageCode;
try {
$result = $this->soapG->StartMonitoring($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function UpdateMonitoringOptions($InternalOrderId, $NewCategorieName, $NewEventType, $NewPreferredStartDate, $NewVersion = null, $NewLanguageCode = null)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->NewCategorieName = $NewCategorieName;
$parametres->NewEventType = $NewEventType;
$parametres->NewPreferredStartDate = $NewPreferredStartDate;
$parametres->NewVersion = $NewVersion;
$parametres->NewLanguageCode = $NewLanguageCode;
try {
$result = $this->soapG->UpdateMonitoringOptions($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function StopMonitoring($InternalOrderId, $PreferredEndDate)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->PreferredEndDate = $PreferredEndDate;
try {
$result = $this->soapG->StopMonitoring($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveMonitoringEventsForOrder($InternalOrderId, $StartFrom)
{
$parametres = new stdClass();
$parametres->InternalOrderId = $InternalOrderId;
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForOrder($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function RetrieveMonitoringEventsForCustomer($StartFrom)
{
$parametres = new stdClass();
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForCustomer($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();
}
return ($result);
}
protected function RetrieveMonitoringEventsForConsumer($StartFrom)
{
$parametres = new stdClass();
$parametres->StartFrom = $StartFrom;
try {
$result = $this->soapG->RetrieveMonitoringEventsForConsumer($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();}
return ($result);
}
protected function Ping($Type)
{
$parametres = new stdClass();
$parametres->Type = $Type;
try {
$result = $this->soapG->Ping($parametres);
} catch (SoapFault $soapFault) {
echo 'Erreur Soap : '.$soapFault->getMessage();
}
return ($result);
}
public function __destruct()
{
unset($this->soapG);
}
}
?>