<table>
<tr>
<th>Nom</th>
+ <th>Versions</th>
<th>Actions</th>
</tr>
<?php foreach ($produits as $produit): ?>
<tr>
<td><?php echo $produit['Produit']['nom']; ?></td>
+ <td>
+ <table>
+ <tr>
+ <th>Valeur</th>
+ <th>Type</th>
+ <th>Actions</th>
+ </tr>
+ <tr>
+ <?php foreach ($versions as $version): if($version['Version']['produit'] == $produit['Produit']['id']) { ?>
+ <td><?php echo $version['Version']['valeur']; ?></td>
+ <td><?php echo $version['Version']['nature']; ?></td>
+ <td>
+ <?php echo $this->Html->link(
+ $this->Html->image('edit.jpg', array('class' => 'button')),
+ array('controller' => 'versions', 'action' => 'edit', $version['Version']['id']),
+ array('escape' => false)
+ ).' '.
+ $this->Form->postLink(
+ $this->Html->image('delete.png', array('class' => 'button')),
+ array('action' => 'delete', $version['Version']['id']),
+ array('escape' => false, 'confirm' => 'Etes-vous certain ?')
+ );
+ ?>
+ </td>
+ <?php } endforeach; unset($version); ?>
+ </tr>
+ </table>
+ </td>
<td>
<?php echo $this->Html->link(
- 'Editer',
- array('controller' => 'produits', 'action' => 'edit', $produit['Produit']['id'])
- ).' - '.
+ $this->Html->image('edit.jpg', array('class' => 'button')),
+ array('controller' => 'produits', 'action' => 'edit', $produit['Produit']['id']),
+ array('escape' => false)
+ ).' '.
$this->Form->postLink(
- 'Supprimer',
+ $this->Html->image('delete.png', array('class' => 'button')),
array('action' => 'delete', $produit['Produit']['id']),
- array('confirm' => 'Etes-vous certain ?')
+ array('escape' => false, 'confirm' => 'Etes-vous certain ?')
);
?>
</td>