Skip to content
Snippets Groups Projects
Commit 6de9dd73 authored by clement's avatar clement
Browse files

Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi

parents 52d1cc23 5359a4e3
No related branches found
No related tags found
No related merge requests found
......@@ -24,15 +24,15 @@ class ForeignField extends Field {
if($this->primary && $form->action == "Modifier") { $disabled = "disabled"; }
$html = '<div class="form-group">
<label for="form'.$this->name.'">'.$this->label.'</label>
<select class="form-control" name="'.$this->name.'">';
foreach ($this->choices as $value) {
if($this->value == $value->{$value->_primaryAttr}()) { $selected = "selected"; } else { $selected = ""; }
$html .= "<option value=".$value->{$value->_primaryAttr}()." ".$selected." >".$value->str()."</option>";
}
$html.= '</select>
</div>';
<label for="form'.$this->name.'">'.$this->label.'</label>
<select class="form-control" name="'.$this->name.'">';
foreach ($this->choices as $value) {
if($this->value == $value->{$value->_primaryAttr}()) { $selected = "selected"; } else { $selected = ""; }
$html .= "<option value=".$value->{$value->_primaryAttr}()." ".$selected." >".$value->str()."</option>";
}
$html.= '</select>
</div>';
return $html;
}
......@@ -50,4 +50,11 @@ class ForeignField extends Field {
return true;
}
public function show() {
$classname = $this->name;
$item = new $classname;
$item->select($this->value);
return $item->str();
}
}
......@@ -6,13 +6,13 @@
<table class="table">
<thead>
<th>t1</th>
<th><?php print_r($stats->nbAnimalMoyClient()); ?></th>
<th>Facture moyenne par client : </th>
<th><?php $tmp = $stats->factureMoyClient(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></th>
</thead>
<tbody>
<tr>
<td>Nombre moyen d'animal par client : </td>
<td><?php $tmp = $stats->nbAnimalMoyClient(); $nb_formated = number_format($tmp, 2, ',', ' '); echo $nb_formated["value"]; ?></td>
<td><?php $tmp = $stats->nbAnimalMoyClient(); $nb_formated = number_format($tmp["value"], 2, ',', ' '); echo $nb_formated; ?></td>
</tr>
</tbody>
</table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment