--- /dev/null
+<h1>
+ <?php echo $this->Html->link(
+ 'Nouveau produit',
+ array('controller' => 'products', 'action' => 'add')
+); ?>
+</h1>
+<table>
+ <tr>
+ <th>Nom</th>
+ <th>Versions</th>
+ <th>Actions</th>
+ </tr>
+
+ <?php if(isset($products)) { foreach ($products as $product): ?>
+ <tr>
+ <td><?php echo $product['Product']['name']; ?></td>
+ <td>
+ <?php echo $this->Html->link(
+ 'Nouvelle version',
+ array('controller' => 'versions', 'action' => 'add', $product['Product']['id'])
+ ); ?>
+ <table>
+ <tr>
+ <th>Valeur</th>
+ <th>Type</th>
+ <th>Actions</th>
+ </tr>
+ <?php if(isset($versions)) { foreach ($versions as $version): if($version['Version']['product'] == $product['Product']['id']) { ?>
+ <tr>
+ <td><?php echo $version['Version']['value']; ?></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>
+ </tr>
+ <?php } endforeach; } ?>
+ </table>
+ </td>
+ <td>
+ <?php echo $this->Html->link(
+ $this->Html->image('edit.jpg', array('class' => 'button')),
+ array('controller' => 'products', 'action' => 'edit', $product['Product']['id']),
+ array('escape' => false)
+ ).' '.
+ $this->Form->postLink(
+ $this->Html->image('delete.png', array('class' => 'button')),
+ array('action' => 'delete', $product['Product']['id']),
+ array('escape' => false, 'confirm' => 'Etes-vous certain ?')
+ );
+ ?>
+ </td>
+ </tr>
+ <?php endforeach; }?>
+</table>