'."\n"; $html.= '  '."\n"; $html.= ' '.$lib.''."\n"; if ($title!='') { $title = ' title="'.$title.'"'; } $html.= ' '.$data.''."\n"; $html.= ''."\n"; print $html; } // --------------------------------------------------------------------------- // // getArray // --------------------------------------------------------------------------- // function getArray($obj) { if (is_array($obj) == false) { return array($obj); } else { return $obj; } } // --------------------------------------------------------------------------- // // printObj // --------------------------------------------------------------------------- // function printObj($obj) { $ret = ''; foreach ($obj as $val) { if (is_object($val) == true) { $ret .= printObj($val); } else { $ret .= $val.' '; } } return $ret; } // --------------------------------------------------------------------------- // // Type de rapport // --------------------------------------------------------------------------- // require_once 'dbbootstrap.php'; setDbConn('giantclient'); $r = Doctrine_Query::create() ->from('Rapports') ->where('OrderId = ?', $commande_id) ->fetchOne(); print '
'; switch ($r->DataSetType) { case 'Full': print '

RAPPORT COMPLET

'; break; case 'Compact': print '

RAPPORT DE SYNTHESE

'; break; } $d = unserialize($r->DataSet); $c = $d->Company; print '

SOCIÉTÉ : '.$c->CompanyName->_.'

'; // --------------------------------------------------------------------------- // // Identite de l'entreprise // --------------------------------------------------------------------------- // print '

IDENTITE DE L\'ENTREPRISE

'; print ''; dRow('Numéro identifiant', $c->CompanyId); dRow('Numéro de TVA Intracom.', $c->Vat->VatNumber); dRow('Numéro de Securité Sociale', $c->SocialSecurityNumber); dRow('Etablissement actif', ($c->CompanyStatus == 'Active')? 'Oui':'Non'); print '
'; // --------------------------------------------------------------------------- // // Raison sociale et coordonnees // --------------------------------------------------------------------------- // print '

Raison sociale & Coordonnées

'; print ''; dRow('Raison Sociale', $c->CompanyName->_); dRow('Forme juridique', $c->LegalForm->CountryLegalForm->code.' : '. $c->LegalForm->CountryLegalForm->_); dRow('Adresse', $c->CompanyAddress->HouseNumber.' '. $c->CompanyAddress->Street.' '. $c->CompanyAddress->PostCode.' '. $c->CompanyAddress->City.' '. $c->CompanyAddress->Country); $libelle = 'Téléphone(s)'; foreach (getArray($c->TelephoneNumber) as $t) { $mobile = (isset($t->isMobile) == true && $t->isMobile == 1) ? ' (mobile)' : ''; dRow($libelle, $t->_.$mobile); $libelle = ''; } dRow('Fax', $c->Telefax); dRow('Site Internet', ''.$c->WebAddress.''); dRow('Courriel', ''. $c->EmailAddress.''); print '
'; // --------------------------------------------------------------------------- // // Activite(s) et chiffre d'affaire // --------------------------------------------------------------------------- // print '

Activité(s) & Chiffre d\'affaire

'; print ''; $libelle = 'Activité(s)'; foreach (getArray($c->Operations->IndustryCode) as $t) { dRow($libelle, $t->NaceCode.' '.$t->Description->_); $libelle = ''; } dRow('Capital', $c->FinancialSummary->AuthorizedCapital->_.' €'); $annee = 0; $total = 0; foreach (getArray($c->Employees) as $t) { if ($t->Period->EndDate->_ > $annee) { $annee = $t->Period->EndDate->_; $total = $t->TotalStaffEmployed; } } if ($total > 0) { dRow('Effectif de l\'entreprise', $total.' salarié(s) en '.substr($annee, 0, 4)); } print '
'; // --------------------------------------------------------------------------- // // Annonces legales // --------------------------------------------------------------------------- // print '

ANNONCES LÉGALES

'; print ''; foreach (getArray($c->Event) as $t) { if (isset($t->Value) == true) { dRow($t->Date->_, $t->Description->_.' '.printObj($t->Value)); } else { dRow($t->Date->_, $t->Description->_); } } print '
'; // --------------------------------------------------------------------------- // // Dirigeants // --------------------------------------------------------------------------- // print '

DIRIGEANTS

'; print ''; foreach (getArray($c->Position) as $i => $t) { if (isset($t->Person) == false) { continue; } $date = ''; if (isset($t->Period->StartDate) == true) { $date .= $t->Period->StartDate->_; } $date .= '-'; if (isset($t->Period->EndDate) == true) { $date .= $t->Period->EndDate->_; } dRow($date, $t->PositionTitle->_.' '. $t->Person->LastName.' '. $t->Person->FirstName); } print '
'; // --------------------------------------------------------------------------- // // Synthese // --------------------------------------------------------------------------- // print '

Synthèse

'; print ''; dRow('Revenue', $c->FinancialSummary->Revenue->_); dRow('TotalEquity', $c->FinancialSummary->TotalEquity->_); dRow('ProfitLossBeforeTax', $c->FinancialSummary->ProfitLossBeforeTax->_); dRow('ProfitLoss', $c->FinancialSummary->ProfitLoss->_); dRow('WorkingCapital', $c->FinancialSummary->WorkingCapital->_); dRow('AuthorizedCapital', $c->FinancialSummary->AuthorizedCapital->_); dRow('PaidUpCapital', $c->FinancialSummary->PaidUpCapital->_); print '
'; print '
'; ?>