function getData($id)
{
    $Mysqli = new mysqli(DBSERVER, DBUSER, DBPWD, DB);
    $query = "SELECT * FROM `" . DB . "`.`mandataires` WHERE `mandataires`.`mandataireid` = " . $id;
    $result = $Mysqli->query($query);
    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
        $_SESSION['values']['chk_status'] = $row['mandatairestatus'];
        $_SESSION['values']['box_Prefix'] = $row['mandataireprefix'];
        $_SESSION['values']['txt_RS'] = $row['mandataireRS'];
        $_SESSION['values']['txt_Nom'] = $row['mandatairenom'];
        $_SESSION['values']['txt_Prenom'] = $row['mandataireprenom'];
        $_SESSION['values']['txt_IDTresor'] = $row['mandataireidtresor'];
        $_SESSION['values']['txt_Email'] = $row['mandataireemail'];
        $_SESSION['values']['txt_Notahiti'] = $row['mandatairenotahiti'];
        $_SESSION['values']['txt_RC'] = $row['mandataireRC'];
        $_SESSION['values']['txt_Telephone'] = $row['mandatairetelephone'];
        $_SESSION['values']['txt_Telephone2'] = $row['mandatairetelephone2'];
        $_SESSION['values']['txt_Fax'] = $row['mandatairefax'];
        $_SESSION['values']['txt_BP'] = $row['mandatairebp'];
        $_SESSION['values']['txt_CP'] = $row['mandatairecp'];
        $_SESSION['values']['txt_Ville'] = $row['mandataireville'];
        $_SESSION['values']['txt_Commune'] = $row['mandatairecommune'];
        $_SESSION['values']['txt_Pays'] = $row['mandatairepays'];
        $_SESSION['values']['txt_Aroa'] = $row['aroa'];
        $_SESSION['values']['txt_Quartier'] = $row['quartier'];
        $_SESSION['values']['txt_RIB'] = $row['mandatairerib'];
        $_SESSION['values']['txt_obs'] = $row['obs'];
    }
    if ($_GET['hideerrors']) {
        reseterrors();
    }
    $Mysqli->close();
}
function getData($id)
{
    $Mysqli = new mysqli(DBSERVER, DBUSER, DBPWD, DB);
    $query = "SELECT * FROM `" . DB . "`.`user` WHERE `user`.`userid` = " . $id;
    $result = $Mysqli->query($query);
    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
        $_SESSION['values']['txt_Nom'] = strtoupper($row['userlastname']);
        $_SESSION['values']['txt_Prenom'] = ucwords(strtolower($row['userfirstname']));
        $_SESSION['values']['txt_Login'] = $row['userlogin'];
        $_SESSION['values']['box_Service'] = $row['userservice'];
        $_SESSION['values']['txt_Password'] = '******';
        $_SESSION['values']['txt_Password2'] = 'existing';
        $_SESSION['values']['chk_isAdmin'] = $row['userisadmin'];
        $_SESSION['values']['chk_isActive'] = $row['userisactive'];
        $_SESSION['values']['chk_isValidator'] = $row['userisvalidator'];
    }
    reseterrors();
    $Mysqli->close();
}
function getData($id)
{
    $Mysqli = new mysqli(DBSERVER, DBUSER, DBPWD, DB);
    $query = "SELECT * FROM `" . DB . "`.`lieux` WHERE `lieux`.`lieuid` = " . $id;
    $result = $Mysqli->query($query);
    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
        $_SESSION['values']['chk_status'] = $row['lieustatus'];
        $_SESSION['values']['chk_principal'] = $row['lieuprincipal'];
        $_SESSION['values']['box_Proprietaire'] = $row['lieuproprietaire'];
        $_SESSION['values']['box_Mandataire'] = $row['lieumandataire'];
        $_SESSION['values']['box_Locataire'] = $row['lieulocataire'];
        $_SESSION['values']['box_Categorie'] = $row['lieucategorie'];
        $_SESSION['values']['txt_Nomlieu'] = $row['lieunomlieu'];
        $_SESSION['values']['txt_Surface'] = $row['lieusurface'] == 0 ? '' : $row['lieusurface'];
        $_SESSION['values']['txt_Nmaison'] = $row['lieunmaison'] == 0 ? '' : $row['lieunmaison'];
        $_SESSION['values']['box_Servitude'] = $row['lieuservitude'];
        $_SESSION['values']['box_Quartier'] = $row['lieuquartier'];
        $_SESSION['values']['txt_Facturer'] = $row['lieufacturer'];
        $_SESSION['values']['txt_EDT'] = $row['lieuedt'] == 0 ? '' : $row['lieuedt'];
        $_SESSION['values']['txt_Compteur'] = $row['lieucompteur'] == 0 ? '' : $row['lieucompteur'];
        $_SESSION['values']['txt_Observations'] = $row['lieuobservations'];
    }
    if ($_GET['hideerrors']) {
        reseterrors();
    }
    $Mysqli->close();
}