Current File : /home/digitaw/Ycof/.history/admin/upd_sante_20230606165650.php
<?php

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $beneficiaire = $_POST['beneficiaire'];
    $nom = $_POST['nom'];
    $prenom = $_POST['prenom'];
    $email = $_POST['email'];
    $tel = $_POST['tel'];
    $taux = $_POST['taux'];
    $id = $_POST['id'];
    $localite = $_POST['localite']; 

    $connection = new mysqli($servername, $username, $password, $databasename);
    if (!empty($beneficiaire) && !empty($nom) && !empty($prenom) && !empty($email) && !empty($tel) && !empty($taux) && !empty($localite)) {
        $query = "update assurancesante set beneficiaire='$beneficiaire',nom='$nom',prenom='$prenom', mail='$email',tel='$tel',taux='$taux',localite='$localite' where id='$id'";

        $connection->query($query);
        $verification = $connection->query($query);
        if ($verification) {
            $msg = "Modification reussie !";
            $_SESSION['msg'] = "<div class='alert alert-success alert-dismissible fade show ' role='alert'>
     <svg xmlns='http://www.w3.org/2000/svg' style='margin-right:10px' width='20' height='20' fill='currentColor' class='bi bi-check2-all' viewBox='0 0 16 16'>
     <path d='M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z'/>
     <path d='m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z'/>
   </svg>
          <strong style='font-size:17px;'>$msg</strong>
          <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>
      </div>";
            header("Location: sante.php");
        }
    }
}

?>