Commit 3b0bf46d authored by Jean-Baptiste Oellers's avatar Jean-Baptiste Oellers
Browse files

Display lists

parent a17538d3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -11,8 +11,11 @@ class ImmobilierLocalController extends AbstractOscarController implements \Osca

    public function immobilierLocalAction()
    {
        $all = $this->getEntityManager()->getRepository(\Oscar\Entity\ImmobilierLocal::class)->findAll();
        return ['immobilierLocal' => $all];
        $sites = $this->getEntityManager()->getRepository(\Oscar\Entity\Site::class)->findAll();
        $batiments = $this->getEntityManager()->getRepository(\Oscar\Entity\Batiment::class)->findAll();
        $niveaux = $this->getEntityManager()->getRepository(\Oscar\Entity\Niveau::class)->findAll();
        $locaux = $this->getEntityManager()->getRepository(\Oscar\Entity\ImmobilierLocal::class)->findAll();
        return ['sites' => $sites, 'batiments' => $batiments, 'niveaux' => $niveaux, 'immobilierLocal' => $locaux];
    }

}
+142 −30
Original line number Diff line number Diff line

<div class="container" style="margin-bottom: 5rem; padding-bottom: 5rem;">
  <div style="background-color: white; padding: 1rem; margin-bottom: 2rem; border-radius: 0 0 1rem 1rem;">
    <h1><span aria-label="immeuble" role="img">🏢</span>Liste des locaux</h1>
  </div>

  <div style="margin-bottom: 4rem; background-color: white; border-radius: 1rem; padding: 1rem; margin-top: 1rem;">
    <?php if(count($immobilierLocal) == 0): ?>
    <p>Aucun local n'a été renseigné pour l'instant.</p>
    <?php else: ?>
    <div id="locaux_table">
<style>
        #locaux_table table {
  table {
    width: 90%;
  }

        #locaux_table td,
        #locaux_table th {
  td,
  th {
    border: 1px solid rgb(190, 190, 190);
    padding: 0.5em 1em;
  }

        #locaux_table thead {
  thead {
    background-color: rgb(235, 235, 235);
  }

        #locaux_table tbody tr:nth-child(even) {
  tbody tr:nth-child(even) {
    background-color: rgb(235, 235, 235);
  }

        #locaux_table tbody tr:nth-child(odd) {
  tbody tr:nth-child(odd) {
    background-color: rgb(245, 245, 245);
  }

        #locaux_table tbody tr:hover {
  tbody tr:hover {
    background-color: rgb(220, 220, 220);
  }
</style>

<div class="container" style="margin-bottom: 5rem; padding-bottom: 5rem;">
  <div style="background-color: white; padding: 1rem; margin-bottom: 2rem; border-radius: 0 0 1rem 1rem;">
    <h1><span aria-label="immeuble" role="img">🏢</span>Liste des locaux</h1>
  </div>

  <div style="margin-bottom: 4rem; background-color: white; border-radius: 1rem; padding: 1rem; margin-top: 1rem;">
    <h3 style="margin-bottom: 2rem;">🌍 Liste des sites</h2>
    <?php if(count($sites) == 0): ?>
    <p>Aucun site n'a été renseigné pour l'instant.</p>
    <?php else: ?>
    <div>
      <table>
        <colgroup>
          <col span="1" style="width: 10%;">
          <col span="1" style="width: 40%;">
          <col span="1" style="width: 30%;">
          <col span="1" style="width: 20%;">
        </colgroup>
        <thead>
          <tr>
            <th>Id</th>
            <th>Nom</th>
            <th>Libellé</th>
            <th>Id source distante</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach( $sites as $i ): ?>
          <tr>
            <td><?= $i->getId() ?></td>
            <td><?= $i->nom ?></td>
            <td><?= $i->libelle ?></td>
            <td><?= $i->idSourceDistante ?></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>
    <?php endif; ?>
  </div>

  <div style="margin-bottom: 4rem; background-color: white; border-radius: 1rem; padding: 1rem; margin-top: 1rem;">
    <h3 style="margin-bottom: 2rem;">🏢 Liste des bâtiments</h2>
    <?php if(count($batiments) == 0): ?>
    <p>Aucun bâtiment n'a été renseigné pour l'instant.</p>
    <?php else: ?>
    <div>
      <table>
        <colgroup>
          <col span="1" style="width: 10%;">
          <col span="1" style="width: 40%;">
          <col span="1" style="width: 30%;">
          <col span="1" style="width: 20%;">
        </colgroup>
        <thead>
          <tr>
            <th>Id</th>
            <th>Nom</th>
            <th>Libellé</th>
            <th>Id source distante</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach( $batiments as $i ): ?>
          <tr>
            <td><?= $i->getId() ?></td>
            <td><?= $i->nom ?></td>
            <td><?= $i->libelle ?></td>
            <td><?= $i->idSourceDistante ?></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>
    <?php endif; ?>
  </div>

  <div style="margin-bottom: 4rem; background-color: white; border-radius: 1rem; padding: 1rem; margin-top: 1rem;">
    <h3 style="margin-bottom: 2rem;">🏢 Liste des niveaux</h2>
    <?php if(count($niveaux) == 0): ?>
    <p>Aucun niveau n'a été renseigné pour l'instant.</p>
    <?php else: ?>
    <div>
      <table>
        <colgroup>
          <col span="1" style="width: 10%;">
          <col span="1" style="width: 40%;">
          <col span="1" style="width: 30%;">
          <col span="1" style="width: 20%;">
        </colgroup>
        <thead>
          <tr>
            <th>Id</th>
            <th>Nom</th>
            <th>Libellé</th>
            <th>Id source distante</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach( $niveaux as $i ): ?>
          <tr>
            <td><?= $i->getId() ?></td>
            <td><?= $i->nom ?></td>
            <td><?= $i->libelle ?></td>
            <td><?= $i->idSourceDistante ?></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>
    <?php endif; ?>
  </div>

  <div style="margin-bottom: 4rem; background-color: white; border-radius: 1rem; padding: 1rem; margin-top: 1rem;">
    <h3 style="margin-bottom: 2rem;">🏢 Liste des locaux</h2>
    <?php if(count($immobilierLocal) == 0): ?>
    <p>Aucun local n'a été renseigné pour l'instant.</p>
    <?php else: ?>
    <div>
      <table>
        <colgroup>
          <col span="1" style="width: 60%;">
          <col span="1" style="width: 15%;">
          <col span="1" style="width: 25%;">
          <col span="1" style="width: 10%;">
          <col span="1" style="width: 40%;">
          <col span="1" style="width: 30%;">
          <col span="1" style="width: 20%;">
        </colgroup>
        <thead>
          <tr>
            <th>Id</th>
            <th>Nom</th>
            <th>Libellé</th>
            <th>Id source distante</th>
@@ -52,6 +163,7 @@
        <tbody>
          <?php foreach( $immobilierLocal as $i ): ?>
          <tr>
            <td><?= $i->getId() ?></td>
            <td><?= $i->nom ?></td>
            <td><?= $i->libelle ?></td>
            <td><?= $i->idSourceDistante ?></td>