extranet/includes/giant/IdentiteGiant.php
2011-04-06 13:13:14 +00:00

54 lines
2.1 KiB
PHP

<?php
/**
* Controller pour L'identité de la société.
* Prepare les données a envoyer au Template.
*/
require_once 'giant/Config.php';
require_once 'giant/Client.php';
require_once ('dbbootstrap.php');
$soap_client = getClient($_GET['pays'], 'Search', SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
$params = new stdClass();
$params->IncludePhoneticMatches = false;
$params->IncludeSuggestions = false;
$formR = array('siret' => $_GET['company']);
$params->Query = new AdvancedSearch($formR);
$informations = SwitchWSDLFunction('AdvancedSearch', $params, $soap_client);
$identiteSociete = new GiantIdentite();
$identiteSociete->RegisteredName = $informations->Results->Company[0]->RegisteredName;
$identiteSociete->CompanyRegisterNumber = $informations->Results->Company[0]->CompanyRegisterNumber;
$identiteSociete->PostCodeAndCity = $identiteSociete->_createPostanCity(
$informations->Results->Company[0]->Address->PostCode,
$informations->Results->Company[0]->Address->City
);
$identiteSociete->Adress = $identiteSociete->_createAdress(
$informations->Results->Company[0]->Address->HouseNumber,
$informations->Results->Company[0]->Address->Street,
$informations->Results->Company[0]->Address->AddressType
);
$identiteSociete->TelephoneNumbers = $identiteSociete->_createTelephoneNumber(
$informations->Results->Company[0]->TelephoneNumbers
);
$identiteSociete->NaceCode = $informations->Results->Company[0]->NaceCodes;
$identiteSociete->LegalForm = $informations->Results->Company[0]->LegalForm;
$identiteSociete->VatNumber = $informations->Results->Company[0]->VatNumber;
$identiteSociete->CompanyWebSite = $informations->Results->Company[0]->CompanyWebSite;
$identiteSociete->CompanyEmail = $informations->Results->Company[0]->CompanyEmail;
setDbConn('giantclient');
$info = Doctrine_Query::create()
->select('Login, OrderDateTime, CompanyId, DataSetType')
->from('commande')
->where ('Login = :login')
->andWhere('CompanyId = :company')
->execute(array(
':login' => $_SESSION['tabInfo']['login'],
':company' => $_GET['company']), Doctrine_Core::HYDRATE_ARRAY);
?>