41 lines
2.0 KiB
PHP
Executable File
41 lines
2.0 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// include ("client.formatAddslashes.php");
|
|
include ("client.formatUppercase.php");
|
|
|
|
// ---------------------------------------------------
|
|
// Avoir un mode liv activé par defaut
|
|
// ---------------------------------------------------
|
|
if (isset($_SESSION['idModeLivCli']))
|
|
{$idModeLivCli=$_SESSION['idModeLivCli'];}
|
|
else {
|
|
$reqSelect="SELECT * FROM `modeliv` WHERE activ=1 order by idModeLiv; ";
|
|
$resConn='';
|
|
$resConn=$idPdo->query($reqSelect);
|
|
$m=0;
|
|
$trouve=false;
|
|
While ($tabResult=$resConn->fetch(PDO::FETCH_ASSOC) && $trouve==false) {
|
|
$defautModeliv[$m]=$tabResult['idModeLiv'];
|
|
$m++;
|
|
$trouve=true;
|
|
}
|
|
$idModeLivCli=$defautModeliv[0];
|
|
}
|
|
if (empty($today)) {
|
|
date_default_timezone_set( 'Europe/Paris' );
|
|
$dateTimeObj = new DateTime('now', new DateTimeZone('Europe/Paris'));
|
|
$today = IntlDateFormatter::formatObject( $dateTimeObj, "y-MM-dd_HH-mm", 'fr' );
|
|
}
|
|
|
|
$newHash = password_hash($pwd, PASSWORD_DEFAULT);
|
|
|
|
$reqUpdate="UPDATE `clients` SET pwd='$newHash', civ='$civ', nom='$nom', prenom='$prenom', tel='$tel', dateNaiss='$dateNaiss', adresse='$adresse', adresse2='$adresse2', codePost='$codePost', ville='$ville', idPaysFact=$idPaysFact, adresseLivOui='$adresseLivOui', civLiv='$civLiv', nomLiv='$nomLiv', prenomLiv='$prenomLiv', telLiv='$telLiv',adrLiv='$adrLiv', adrLiv2='$adrLiv2', codePostLiv='$codePostLiv', villeLiv='$villeLiv', idPaysLiv=$idPaysLiv, idModeLiv=$idModeLivCli, idModePaie=$idModePaieCli, dateModif='$today', news='$news', lgCli='$lg' WHERE idMail='$idMail' ;";
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .= monDebug (2,['Erreur reqUpdate client ' => $reqUpdate ],'client.reqUpdate.php');}
|
|
$resConn='';
|
|
$resConn=$idPdo->query($reqUpdate);
|
|
if ($resConn)
|
|
{ if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug (2,['Modif client effectuées' => 'Ok' ],'');}
|
|
else
|
|
{if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= monDebug (2,['Erreur reqUpdate client ' => 'Ko' ],'');}
|
|
?>
|