<div class="container-fluid">
  <?php if ($bo_user): ?>
    <div class="row">
      <div class="col text-end">
        <?php if ($bo_user['id']>0): ?>
          Utilistaeur n°<b><?=$bo_user['id'];?></b>
        <?php else: ?>
          Nouvel utilistaeur
        <?php endif; ?>
      </div>
    </div>
    <div class="row">
      <div class="col p-3">

        <form class="" action="" method="post" onsubmit="javascript:traitForm();return false;">
          <input type="hidden" name="action" id="action" value="save">
          <input type="hidden" name="id" id="id" value="<?=$bo_user['id'];?>">
          <div class="row">
            <div class="col">
              <button type="button" class="btn btn-sm btn-secondary mb-3" onclick="javascript:liste();">Retour à la liste</button>
              <button type="submit" class="btn btn-sm btn-primary mb-3">Enregistrer les modifications</button>
            </div>
          </div>
          <div class="">
            <label for="nom" class="form-label">Nom</label>
            <input type="text" name="nom" id="nom" class="form-control form-control-sm" value="<?=$bo_user['nom'];?>">
          </div>
          <div class="">
            <label for="prenom" class="form-label">Préprenom</label>
            <input type="text" name="prenom" id="prenom" class="form-control form-control-sm" value="<?=$bo_user['prenom'];?>">
          </div>
          <div class="">
            <label for="adresse" class="form-label">Adresse</label>
            <input type="text" name="adresse" id="adresse" class="form-control form-control-sm" value="<?=$bo_user['adresse'];?>">
          </div>
          <div class="">
            <label for="complement" class="form-label">Complément</label>
            <input type="text" name="complement" id="complement" class="form-control form-control-sm" value="<?=$bo_user['complement'];?>">
          </div>
          <div class="">
            <label for="cp" class="form-label">Code postal</label>
            <input type="text" name="cp" id="cp" class="form-control form-control-sm" value="<?=$bo_user['cp'];?>" onkeyup="javascript:listeVille();">
          </div>

          <div class="" id="div_ville"> <input type="hidden" name="id_ville" id="id_ville" value="<?=intval($bo_user['id_ville']);?>"> </div>

          <div class="">
            <label for="pseudo" class="form-label">Pseudo</label>
            <input type="text" name="pseudo" id="pseudo" class="form-control form-control-sm" value="<?=$bo_user['pseudo'];?>">
          </div>
          <div class="">
            <label for="email" class="form-label">Email</label>
            <input type="text" name="email" id="email" class="form-control form-control-sm" value="<?=$bo_user['email'];?>">
          </div>
          <div class="">
            <label for="tel" class="form-label">Téléphone</label>
            <input type="text" name="tel" id="tel" class="form-control form-control-sm" value="<?=$bo_user['tel'];?>">
          </div>
          <div class="">
            <label for="mdp" class="form-label">Mot de passe</label>
            <input type="password" name="mdp" id="mdp" class="form-control form-control-sm" value="<?=$bo_user['mdp'];?>">
          </div>
          <div class="form-check form-switch">
            <input class="form-check-input" type="checkbox" role="switch" name="admin" id="admin"<?=(($bo_user['admin']>0)?" checked":"");?>>
            <label class="form-check-label" for="admin">Droits administrateur</label>
          </div>
          <div class="">
            <label for="couleur" class="form-label">Code couleur</label>
            <input type="text" name="couleur" id="couleur" class="form-control form-control-sm" value="<?=$bo_user['couleur'];?>">
          </div>
        </form>

      </div>
    </div>
  <?php else: ?>
    <div class="row">
      <div class="col">
        <p>Aucun utilisateur...</p>
      </div>
    </div>
  <?php endif; ?>

</div>
