Skip to content
Snippets Groups Projects
Commit a35eea3e authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fixing cas vide

parent a2bbbdc3
No related branches found
No related tags found
No related merge requests found
Pipeline #38417 passed
...@@ -12,6 +12,7 @@ use UnicaenAutoform\Entity\Db\Champ; ...@@ -12,6 +12,7 @@ use UnicaenAutoform\Entity\Db\Champ;
<?php echo $champ->getLibelle(); ?>&nbsp;: <?php echo $champ->getLibelle(); ?>&nbsp;:
<?php $libelles = explode(';',$champ->getOptions()); ?> <?php $libelles = explode(';',$champ->getOptions()); ?>
<?php $size = max(count($libelles), count($splits)); ?> <?php $size = max(count($libelles), count($splits)); ?>
<div>
<ul > <ul >
<?php for($position = 0 ; $position < $size ; $position ++) : ?> <?php for($position = 0 ; $position < $size ; $position ++) : ?>
<li> <li>
...@@ -24,4 +25,5 @@ use UnicaenAutoform\Entity\Db\Champ; ...@@ -24,4 +25,5 @@ use UnicaenAutoform\Entity\Db\Champ;
</li> </li>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
</div>
<?php endif; ?> <?php endif; ?>
...@@ -12,7 +12,7 @@ $nbFields = count($fields); ...@@ -12,7 +12,7 @@ $nbFields = count($fields);
$libelles = []; $libelles = [];
foreach ($fields as $field) { foreach ($fields as $field) {
$liste = explode('|',$field); $liste = explode('|',$field);
$libelles[] = $liste[1]; $libelles[] = $liste[1]??"Aucun·e";
} }
$reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data); $reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data);
...@@ -20,6 +20,9 @@ $reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data); ...@@ -20,6 +20,9 @@ $reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data);
?> ?>
<?php echo $champ->getLibelle(); ?>&nbsp;: <?php echo $champ->getLibelle(); ?>&nbsp;:
<?php if (empty($reponses) OR str_replace(";","",$reponses[0]) === "") : ?>
aucun·e
<?php else : ?>
<?php foreach ($reponses as $reponse) : ?> <?php foreach ($reponses as $reponse) : ?>
<ul> <ul>
<?php if ($data !== 'null') : ?> <?php if ($data !== 'null') : ?>
...@@ -32,4 +35,6 @@ $reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data); ...@@ -32,4 +35,6 @@ $reponses = explode(Champ::SEPARATOR_PLUS_CUSTOM_GROUP, (string) $data);
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
<br>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>
...@@ -12,7 +12,7 @@ use UnicaenAutoform\Entity\Db\Champ; ...@@ -12,7 +12,7 @@ use UnicaenAutoform\Entity\Db\Champ;
<?php echo $champ->getLibelle(); ?>&nbsp;: <?php echo $champ->getLibelle(); ?>&nbsp;:
<?php echo $libelles = explode(';',$champ->getOptions()); ?> <?php echo $libelles = explode(';',$champ->getOptions()); ?>
<?php $size = max(count($libelles), count($splits)); ?> <?php $size = max(count($libelles), count($splits)); ?>
<ul> <ul srt>
<?php for($position = 0 ; $position < $size ; $position ++) : ?> <?php for($position = 0 ; $position < $size ; $position ++) : ?>
<li> <li>
<?php $sub = explode("|", $libelles[$position]); ?> <?php $sub = explode("|", $libelles[$position]); ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment