index.ctp 3.45 KB
<div class="materiels index">
<?php echo '<h2><i class="icon-list"></i> Liste des matériels (nombre pas impléménté)</h2>'; ?>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th><?= $this->Paginator->sort('designation','Désignation') ?></th>
                <th><?= $this->Paginator->sort('numero_laboratoire', 'N° interne (labo)') ?></th>
                <th><?= $this->Paginator->sort('categorie_id', 'Catégorie') ?></th>
                <th><?= $this->Paginator->sort('organisme_id', 'Org.') ?></th>
                <th><?= $this->Paginator->sort('numero_inventaire_organisme', 'N° Invent. Org.') ?></th>
                <th><?= $this->Paginator->sort('nom_responsable', 'Responsable') ?></th>
                <th><?= $this->Paginator->sort('status', 'Statut') ?></th>
                <th><?= $this->Paginator->sort('date_acquisition', 'Date Achat') ?></th>
                <th><?= $this->Paginator->sort('etiquette', 'Et') ?></th>
                <th class="actions"><?= __('') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($materiels as $materiel): ?>
            <tr>
 				<td><?= $materiel->has('designation') ? $this->Html->link($materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $materiel->id]) : '' ?></td>
                <td><?= h($materiel->numero_laboratoire) ?></td>
                <td><?= $materiel->has('category') ? h($materiel->category->nom) : '' ?></td>
                <td><?= $materiel->has('organisme') ? h($materiel->organisme->nom) : '' ?></td>
                <td><?= h($materiel->numero_inventaire_organisme) ?></td>
                <td><?= h($materiel->nom_responsable) ?></td>
                <td><?= h($materiel->status) ?></td>
                <td><?= h($materiel->date_acquisition) ?></td>
                <td><?php if (h($materiel->etiquette) == '1') { echo 'Y'; } else { echo 'N'; } ?></td>

                <td class="actions" style="padding: 6px 0;">
                    <?= $this->Html->link(__('<i class="icon-pencil"></i>'), ['action' => 'edit', $materiel->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    
                    <?php 
                    //A implementer --> bouton valider/archivé
					//$this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $materiel->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ])
					
                    //A implementer --> bouton suppression caché si matériel validé
                    ?>
                    <?= $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $materiel->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false ], ['confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $materiel->id)]) ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    
    <h3><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></h3>
    
    <div class="paging" style="color: black;">
    		<?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?>
            <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?>
            <?= $this->Paginator->numbers(['separator' => '']) ?>
            <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?>
            <?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?>
    </div>
</div>