<div class="container-fluid">
  <div class="row">
    <div class="col">
      <form class="" action="" method="post" onsubmit="javascript:liste();return false;">
        <div class="d-flex flex-row align-items-center mb-2">
          <div class="mx-1">
            <?=count($patients);?> résultat<?=((count($patients)>1)?"s":"");?>
            &nbsp;|&nbsp;
            <a href="javascript:form(0);" class="icon-plus"> ajouter</a>
          </div>
          <div class="mx-1">
            <input type="text" class="form-control" name="rech_mc" id="rech_mc" value="<?=$rech_mc;?>">
          </div>
          <div class="mx-1">
            <button type="submit">rechercher</button>
          </div>
        </div>
      </form>

    </div>
  </div>
  <?php if ($patients): ?>
    <div class="row">
      <div class="col p-0">
        <table class="table table-sm table-striped">
          <thead class="table-dark">
            <tr>
              <th>Nom/Prénom</th>
              <th class="d-none d-sm-table-cell">Date de naissance</th>
              <th class="d-none d-sm-table-cell">cp</th>
              <th class="d-none d-sm-table-cell">&nbsp;</th>
            </tr>
          </thead>
          <tbody>
            <?php foreach ($patients as $key => $user): ?>
              <tr>
                <td>
                  <a href="javascript:form(<?=$user['id'];?>);"><?=$user['nom'];?></a>
                  &nbsp;
                  <a href="javascript:form(<?=$user['id'];?>);"><?=$user['prenom'];?></a>
                </td>
                <td class="d-none d-sm-table-cell"><a href="javascript:form(<?=$user['id'];?>);"><?=$user['dn'];?></a></td>
                <td class="d-none d-sm-table-cell"><a href="javascript:form(<?=$user['id'];?>);"><?=$user['cp'];?></a></td>
                <td class="d-none d-sm-table-cell"> <button type="button" class="btn btn-sm btn-danger" onclick="javascript:supPatient(<?=$user['id'];?>);">suppr</button> </td>
              </tr>
            <?php endforeach; ?>
          </tbody>
        </table>
      </div>
    </div>
  <?php else: ?>
    <div class="row">
      <div class="col">
        <p>Aucun résultat...</p>
      </div>
    </div>
  <?php endif; ?>
</div>
