index.ctp 3.17 KB

<div class="emprunts index">
<?php echo '<h2><i class="icon-list"></i> Liste des emprunts</h2>'; ?>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th><?= $this->Paginator->sort('id', 'N°') ?></th>
                <th><?= $this->Paginator->sort('materiel_id', 'Matériel') ?></th>
                <th><?= $this->Paginator->sort('numero_laboratoire', 'N° interne (labo)') ?></th>
                <th><?= $this->Paginator->sort('emprunt_interne', 'Type') ?></th>
                <th><?= $this->Paginator->sort('date_emprunt' ,'Date emprunt') ?></th>
                <th><?= $this->Paginator->sort('date_retour_emprunt', 'Date retour') ?></th>
				<th><?= $this->Paginator->sort('nom_emprunteur', 'Emprunteur') ?></th>
				<th><?= $this->Paginator->sort('e_lieu_stockage', 'Lieu stockage') ?></th>
         		
         		<th class="actions"><?= __('') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($emprunts as $emprunt): ?>
            <tr>
                <td><?php echo $this->Html->link('Emprunt '.$this->Number->format($emprunt->id), ['action' => 'view', $emprunt->id])?></td>
                <td><?= $emprunt->has('materiel') ? $this->Html->link($emprunt->materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $emprunt->materiel->id]) : '' ?></td>
                <td><?= $emprunt->has('materiel') ? h($emprunt->materiel->numero_laboratoire) : '' ?></td>
                <td><?php if (h($emprunt->emprunt_interne) == '1') { echo 'Interne'; } else { echo 'Externe'; } ?></td>
                <td><?= h($emprunt->date_emprunt) ?></td>
                <td><?= h($emprunt->date_retour_emprunt) ?></td>
                <td><?= h($emprunt->nom_emprunteur) ?></td>
                <td><?php if (h($emprunt->emprunt_interne) == '1') { echo $sites[h($emprunt->e_lieu_stockage)].'-'.h($emprunt->e_lieu_detail); } else { echo h($emprunt->laboratoire); }  ?></td>

                <td class="actions" style="padding: 6px 0;">
                    <?= $this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $emprunt->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    <?= $this->Html->link(__('<i class="icon-pencil"></i>'), ['action' => 'edit', $emprunt->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    <?= $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $emprunt->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $emprunt->id)]) ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    
      	<p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p>
      	
   	<div class="paging">
            <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?>
            <?= $this->Paginator->numbers(['separator' => '']) ?>
            <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?>
    </div>
</div>

    	<div class="actions">
			<?php echo $this->element('menu') ?>
		</div>