index.ctp 2.13 KB

<div class="sites index">
<?php echo '<h2><i class="icon-list"></i> Liste des sites</h2>'; ?>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th><?= $this->Paginator->sort('nom', 'Nom') ?></th>
                <th class="actions"><?= __('') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($sites as $site): ?>
            <tr>
                <td class="smallText"><?= $this->Html->link($site->nom, ['action' => 'view', $site->id]) ?></td>

                <td class="actions" style="padding: 6px 0;">
                    <?= $this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $site->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    
                    <?php if (in_array($role, ['Administration Plus', 'Super Administrateur'])) { ?>
                    <?= $this->Html->link(__('<i class="icon-pencil"></i>'), ['action' => 'edit', $site->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    <?php } ?>
                    
                    <?php if (in_array($role, ['Super Administrateur'])) { ?>
                    <?= $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $site->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $site->id)]) ?>
                	<?php } ?>
                </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') ?>
			<?php echo $this->element('menu_index', 
			[ 'pluralHumanName' => 'Sites',
			'singularHumanName' => 'Site' ]) ?>
		</div>