index.ctp 4.25 KB
<?php
/**
 * @var \App\View\AppView $this
 * @var \App\Model\Entity\Projet[]|\Cake\Collection\CollectionInterface $projets
 */

// Variables définies par le controleur
$projets = $projets;
//debug($projets);
?>

<b><u><?= $this->Html->link(__('Nouveau Projet'), ['action' => 'add']) ?></li></u></b>
<br />
<br />
<!-- 
<nav class="large-3 medium-4 columns" id="actions-sidebar">
    <ul class="side-nav">
        <li class="heading"><S= __('Actions :') S></li>
        <li><S= $this->Html->link(__('New Projet'), ['action' => 'add']) ?></li>
        <li><S= $this->Html->link(__('List Groupes Thematiques'), ['controller' => 'GroupesThematiques', 'action' => 'index']) S></li>
        <li><S= $this->Html->link(__('New Groupes Thematique'), ['controller' => 'GroupesThematiques', 'action' => 'add']) S></li>
        <li><S= $this->Html->link(__('List Users'), ['controller' => 'Users', 'action' => 'index']) ?></li>
        <li><S= $this->Html->link(__('New User'), ['controller' => 'Users', 'action' => 'add']) ?></li>
        <li><S= $this->Html->link(__('List Materiels'), ['controller' => 'Materiels', 'action' => 'index']) ?></li>
        <li><S= $this->Html->link(__('New Materiel'), ['controller' => 'Materiels', 'action' => 'add']) ?></li>
    </ul>
</nav>
-->

<div class="projets index large-9 medium-8 columns content">
    <h3><?= __('Projets') ?></h3>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
            	<!-- 
                <th scope="col"><S= $this->Paginator->sort('id') ?></th>
               	-->
                <th scope="col"><?= $this->Paginator->sort('nom') ?></th>
                <th scope="col"><?= $this->Paginator->sort('groupes_thematique_id', 'Groupe thématique') ?></th>
                <th scope="col"><?= $this->Paginator->sort('chef_science_id', 'Responsable scientifique') ?></th>
                <th scope="col"><?= $this->Paginator->sort('chef_projet_id', 'Chef de projet') ?></th>
                <th scope="col"><?= $this->Paginator->sort('date_start', 'Date début') ?></th>
                <th scope="col"><?= $this->Paginator->sort('date_stop', 'Date fin') ?></th>
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($projets as $projet): ?>
            <tr>
            	<!-- 
                <td><S= $this->Number->format($projet->id) ?></td>
                <td><S= $this->Number->format($projet->chef_science_id) ?></td>
            	 -->
                <td><?= h($projet->nom) ?></td>
                <td><?= $projet->has('groupe_thematique') ? 
                    $this->Html->link($projet->groupe_thematique->nom, ['controller' => 'GroupesThematiques', 'action' => 'view', $projet->groupes_thematique_id]) 
                    : '' ?>
                </td>
                <td><?= $projet->has('chef_science_id') ? $this->Html->link($projet->Pi->nom, ['controller' => 'Users', 'action' => 'view', $projet->chef_science_id]) : '' ?></td>
                <td><?= $projet->has('chef_projet_id') ? $this->Html->link($projet->Pm->nom, ['controller' => 'Users', 'action' => 'view', $projet->chef_projet_id]) : '' ?></td>
                <td><?= h($projet->date_start) ?></td>
                <td><?= h($projet->date_stop) ?></td>
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['action' => 'view', $projet->id]) ?>
                    <?= $this->Html->link(__('Edit'), ['action' => 'edit', $projet->id]) ?>
                    <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $projet->id], ['confirm' => __('Are you sure you want to delete # {0}?', $projet->id)]) ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <div class="paginator">
        <ul class="pagination">
            <?= $this->Paginator->first('<< ' . __('first')) ?>
            <?= $this->Paginator->prev('< ' . __('previous')) ?>
            <?= $this->Paginator->numbers() ?>
            <?= $this->Paginator->next(__('next') . ' >') ?>
            <?= $this->Paginator->last(__('last') . ' >>') ?>
        </ul>
        <p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
    </div>
</div>