amelioration de l'affichage

This commit is contained in:
Sebastien BEAUGRAND 2010-09-03 13:42:06 +00:00
parent fccd872bf0
commit 21eb00ee91
2 changed files with 43 additions and 11 deletions

View File

@ -52,10 +52,7 @@ try {
// --------------------------------------------------------------------------- //
function afficheCompany(&$c, $deb, $num)
{
if ($num > 0) {
print '<li class="StyleInfoData" type="1" value="'.
($deb + $num + 1).'">';
}
print '<li class="StyleInfoData" type="1" value="'.($deb + $num + 1).'">';
print '<a href="?page=giant_identite&company='.$c->VatNumber.'">'.
$c->RegisteredName.'</a><br/>';
print '<b>Register number '.$c->CompanyRegisterNumber.'</b><br/>';

View File

@ -43,13 +43,44 @@ function printObj($obj)
foreach ($obj as $val) {
if (is_object($val) == true) {
$ret .= printObj($val);
} else {
} else if ($val == 'OldValue' ||
$val == 'NewValue') {
$ret .= '('.$val.') ';
} else if ($val != 'eq') {
$ret .= $val.' ';
}
}
return $ret;
}
// --------------------------------------------------------------------------- //
// cmp
// --------------------------------------------------------------------------- //
function cmp($a, $b)
{
if ($a->Date->_ == $b->Date->_) {
return 0;
}
return ($a->Date->_ < $b->Date->_) ? 1 : -1;
}
// --------------------------------------------------------------------------- //
// pdate
// --------------------------------------------------------------------------- //
function pdate($d)
{
$date = '';
$f = substr($d->format, 0, 1);
for ($i = 0; $i < strlen($d->format); ++$i) {
if (substr($d->format, $i, 1) != $f) {
$f = substr($d->format, $i, 1);
$date .= ' / ';
}
$date .= substr($d->_, $i, 1);
}
return $date;
}
// --------------------------------------------------------------------------- //
// Type de rapport
// --------------------------------------------------------------------------- //
@ -144,11 +175,15 @@ print '</table>';
// --------------------------------------------------------------------------- //
print '<h1>ANNONCES LÉGALES</h1>';
print '<table>';
foreach (getArray($c->Event) as $t) {
$tab = getArray($c->Event);
usort($tab, 'cmp');
foreach ($tab as $t) {
if (isset($t->Value) == true) {
dRow($t->Date->_, $t->Description->_.' '.printObj($t->Value));
dRow(pdate($t->Date), $t->Description->_.' '.printObj($t->Value));
} else if (isset($t->Description->_) == true) {
dRow(pdate($t->Date), $t->Description->_);
} else {
dRow($t->Date->_, $t->Description->_);
dRow(pdate($t->Date), '('.$t->EventCode.')');
}
}
print '</table>';
@ -164,11 +199,11 @@ foreach (getArray($c->Position) as $i => $t) {
}
$date = '';
if (isset($t->Period->StartDate) == true) {
$date .= $t->Period->StartDate->_;
$date .= pdate($t->Period->StartDate);
}
$date .= '-';
$date .= ' - ';
if (isset($t->Period->EndDate) == true) {
$date .= $t->Period->EndDate->_;
$date .= pdate($t->Period->EndDate);
}
dRow($date,
$t->PositionTitle->_.' '.