<?php
ob_start();
?>
<!-- Debut code message erreur -->
<div class="container">
<div class="row justify-content-center my-5">
<?php if($code)

>
<div class="col-10 text-center h5 alert mt-3 <?= $messageCode[$code]['type'] ?>">
<?= $messageCode[$code]['msg'] ?>
</div>
<?php endif ?>
</div>
</div>
<!-- Fin code message erreur -->
<!-- Fiche inscrit -->
<div class="container">
<div class="row justify-content-center">
<div class="col-10">
<div class="mt-3">
<h1>Modification de la fiche</h1>
</div>
</div>
</div>
</div>
<div class="middleSite mt-3">
<div class="container my-3">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-10">
<input type="hidden" name="id" value="<?= htmlentities($result->pseudo ?? '', ENT_QUOTES, 'UTF-8')?>">
<form action="<?=htmlspecialchars($_SERVER['PHP_SELF'])?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?= htmlentities($result->id ?? '', ENT_QUOTES, 'UTF-8')?>">';
<!-- Photo -->
<div class="text-center mb-3">
<img class="picture aurore" src="<?= $finalPic ?>" alt="Photo de profil">
</div>
<!-- MAil -->
<div class="col-8 input-group">
<div class="input-group-text iconesConnexionInscription">
<svg xmlns="
http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
<path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383-4.758 2.855L15 11.114v-5.73zm-.034 6.878L9.271 8.82 8 9.583 6.728 8.82l-5.694 3.44A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.739zM1 11.114l4.758-2.876L1 5.383v5.73z"/>
</svg>
</div>
<input type="email"
class="persoConnexionInscription form-control"
placeholder="Mail"
name="mail"
id="mail"
value="<?= htmlentities($result->mail ?? '', ENT_QUOTES, 'UTF-8')?>"
required>
</div>
<div class="error mb-3"><?= htmlentities($error['mail'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Pseudo -->
<div class="col-8 input-group">
<div class="input-group-text iconesConnexionInscription">
<svg xmlns="
http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"/>
</svg>
</div>
<input type="text"
class="persoConnexionInscription form-control"
placeholder="Pseudo (chiffre et lettre)"
minlength="2"
maxlength="20"
name="pseudo"
id="pseudo"
value="<?= htmlentities($result->pseudo ?? '', ENT_QUOTES, 'UTF-8')?>"
required>
</div>
<div class="error mb-3"><?= htmlentities($error['pseudo'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Status -->
<div class="col-8 input-group">
<select class="form-select" aria-label="Default select example" name="status" id="status" value="<?= htmlentities($result->status ?? '', ENT_QUOTES, 'UTF-8')?>">
<option value="0"<?= $status == '0' ? ' selected' : '' ?>>Activer</option>
<option value="1"<?= $status == '1' ? ' selected' : '' ?>>Désactiver</option>
</select>
</div>
<div class="error mb-3"><?= htmlentities($error['status'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Niveau -->
<div class="col-8 input-group">
<select class="form-select" aria-label="Default select example" name="role" id="role" value="<?= htmlentities($result->role ?? '', ENT_QUOTES, 'UTF-8')?>">
<option value="1"<?= $role == '1' ? ' selected' : '' ?>>Option 1</option>
<option value="2"<?= $role == '2' ? ' selected' : '' ?>>Utilisateur</option>
<option value="3"<?= $role == '3' ? ' selected' : '' ?>>Option 3</option>
<option value="4"<?= $role == '4' ? ' selected' : '' ?>>Option 4</option>
<option value="5"<?= $role == '5' ? ' selected' : '' ?>>Administrateur</option>
</select>
</div>
<div class="error mb-3"><?= htmlentities($error['role'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Avatar -->
<div class="col-8 input-group mb-3">
<div class="input-group-text iconesConnexionInscription">
<svg xmlns="
http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-bounding-box" viewBox="0 0 16 16">
<path d="M1.5 1a.5.5 0 0 0-.5.5v3a.5.5 0 0 1-1 0v-3A1.5 1.5 0 0 1 1.5 0h3a.5.5 0 0 1 0 1h-3zM11 .5a.5.5 0 0 1 .5-.5h3A1.5 1.5 0 0 1 16 1.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 1-.5-.5zM.5 11a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 14.5v-3a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 1 .5-.5z"/>
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm8-9a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
</svg>
</div>
<input type="file"
class="form-control"
name="avatar"
id="avatar"
value="<?= htmlentities($_POST['avatar'] ?? '', ENT_QUOTES, 'UTF-8')?>">
</div>
<div class="error mb-3"><?= htmlentities($error['avatar'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Boutons MAJ SUPPRIMER DESACTIVATION -->
<?php
// Récupération de la valeur de la variable status
//$status = 1; // Remplacez cette ligne par la récupération de la valeur de la variable depuis votre base de données ou autre source
// Condition pour masquer les boutons "Désactiver" et "Réactiver"
if ($status == 1) {
?>
<div class="col-12 text-center">
<button class="btn btn-outline-success my-3" type="submit" name="modifier" value="1">Modifier</button>
<button class="btn btn-outline-warning my-3" type="submit" name="reactiver">Réactiver</button>
<button class="btn btn-outline-danger my-3" type="submit" name="supprimer">Supprimer</button>
</div>
<?php
} else {
?>
<div class="col-12 text-center">
<button class="btn btn-outline-success my-3" type="submit" name="modifier" value="1">Modifier</button>
<button class="btn btn-outline-warning my-3" type="submit" name="desactiver">Désactiver</button>
<button class="btn btn-outline-danger my-3" type="submit" name="supprimer">Supprimer</button>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-10">
<div class="mt-3">
<h1>Modification du mot de passe</h1>
</div>
</div>
</div>
</div>
<!-- Debut code message erreur -->
<div class="container">
<div class="row justify-content-center my-5">
<?php if($code)

>
<div class="col-10 text-center h5 alert mt-3 <?= $messageCode[$code]['type'] ?>">
<?= $messageCode[$code]['msg'] ?>
</div>
<?php endif ?>
</div>
</div>
<!-- Fin code message erreur -->
<div class="middleSite mt-3">
<div class="container my-3">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-10">
<form action="<?=htmlspecialchars($_SERVER['PHP_SELF'])?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?= htmlentities($result->id ?? '', ENT_QUOTES, 'UTF-8')?>">';
<div class="col-8 input-group">
<div class="input-group-text iconesConnexionInscription">
<svg xmlns="
http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock" viewBox="0 0 16 16">
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z"/>
</svg>
</div>
<input type="password"
class="persoConnexionInscription form-control"
placeholder="Mot de passe*"
minlength="6"
maxlength="20"
name="mdpInscription"
id="mdpInscription"
value="<?= htmlentities($_POST['mdpInscription'] ?? '', ENT_QUOTES, 'UTF-8')?>"
required>
</div>
<div class="error mb-3"><?= htmlentities($error['mdpInscription'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<div class="col-8 input-group">
<div class="input-group-text iconesConnexionInscription">
<svg xmlns="
http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock" viewBox="0 0 16 16">
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z"/>
</svg>
</div>
<input type="password"
class="persoConnexionInscription form-control"
placeholder="Confirmation*"
minlength="6"
maxlength="20"
name="mdpConfirmationInscription"
id="mdpConfirmationInscription"
value="<?= htmlentities($_POST['mdpConfirmationInscription'] ?? '', ENT_QUOTES, 'UTF-8')?>"
required>
</div>
<div class="error mb-3"><?= htmlentities($error['mdpConfirmationInscription'] ?? '', ENT_QUOTES, 'UTF-8')?></div>
<!-- Boutons MAJ SUPPRIMER DESACTIVATION -->
<div class="col-12 text-center">
<button class="btn btn-outline-success my-3" type="submit" name="modifier" value="2">Modifier</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Fin fiche inscrit -->
<?php
$content = ob_get_clean();
$titlePage = 'FicheInscrit';
$metaDescription ="";
$metaKeywords ="";
$title = 'FicheInscrit';
include(dirname(__FILE__).'/templates/connecter.php');
?>