<?php

global $Route;
$metacss = "";
$barre = "";
ob_start();
?>
  <div class="row">
    <div class="col-md-6">
      <div class="panel panel-primary">
        <div class="panel-heading">
          <h3 class="panel-title">Informations marchés</h3>
        </div>
        <div class="panel-body">
          <?php
          if (count($aModel["infos"]) == 0) {
            echo '<p class="text-center">Aucune information marché</p>';
          } else {
            echo '<div class="border cm-scrollbar cm-table-w-scroll table-responsive table-400">';
            echo '<table class="table table-bordered table-striped table-fixed">';
            echo '<thead>';
            echo '<tr>';
            echo '<th class="header" scope="col" width="10%">Date</th>';
            echo '<th class="header" scope="col" width="20%">Titre</th>';
            echo '<th class="header" scope="col" width="50%">Infos</th>';
            echo '</tr>';
            echo '</thead>';
            echo '<tbody>';
            foreach ($aModel["infos"] as $info) {
              echo '<tr>';
              echo '<td >' . affiche_date($info["date_infos"]) . '</td>';
              echo '<td><strong>' . $info["titre_infos"] . '</strong></td>';
              // Afficher le texte avec les sauts de ligne
              $info["text_infos"] = str_replace("\n", "<br>", $info["text_infos"]);
              echo '<td>' . $info["text_infos"] . '</td>';
              echo '</tr>';
            }
            echo '</tbody>';
            echo '</table>';
            echo '</div>';
          }
          ?>
        </div>
      </div>
      <div class="panel panel-success">
        <div class="panel-heading">
          <h3 class="panel-title">Outils</h3>
        </div>
        <div class="panel-body" style="padding:5px;margin:0;">
          <button class="btn btn-sm btn-primary" id="btnExtractTPG">Extraire le tarif public général au format Excel</button>
        </div>
      </div>
    </div>
    <div class="col-md-6">
      <div class="diaporama">
        <img src="pub/res/img/diapo/1.png" alt="Image 1">
        <img src="pub/res/img/diapo/2.png" alt="Image 2">
        <img src="pub/res/img/diapo/3.png" alt="Image 3">
        <img src="pub/res/img/diapo/4.jpg" alt="Image 4">
        <img src="pub/res/img/diapo/5.jpg" alt="Image 5">
        <img src="pub/res/img/diapo/6.jpg" alt="Image 6">
      </div>
    </div>
  </div>
<?php
$content = ob_get_contents();
ob_clean();

ob_start();
$modal = ob_get_contents();
ob_clean();

ob_start();
echo '<script src="/pub/res/js/jaccueil.js"></script>';
$jscript = ob_get_contents();
ob_end_clean();
require_once $Route->_layout;
