alpha_full/pages/panier/_recap/recap.reqUpdateComment.php
2026-04-06 22:58:51 +02:00

35 lines
1.5 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
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' );
}
if (empty($idCde) && isset($_SESSION['idCde'])) {$idCde=$_SESSION['idCde'];}
if (isset($_POST['commentaire'])) {$commentaire=$_POST['commentaire'];$_SESSION['commentaire']=$commentaire;}
if (!empty($commentaire)) {
$commentaire=addslashes($commentaire);
$reqUpdate="UPDATE `commande` SET commentaire='" .$commentaire. "'";
$reqUpdate=$reqUpdate. " WHERE etatCde='Pn' and idMail='" .$idMail. "' and idCde='" .$idCde. "';";
$resConn='';
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .='<br><span class="msgOk"><b>reqUpdate commande commentaire= </b>' .$reqUpdate. '<span>';}
try{
$resConn=$idPdo->query($reqUpdate);
if ($resConn) {
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .='<br> <span class="msgOk">Update commande commentaire -> CDE = ok</span>';}
}
else {
if (isset($debug[2]) && $debug[2] == '1' ) { $debugMsg .='<br> <span class="msgKo">Update commande commentaire -> CDE = KO =></span>';}
}
}
catch (PDOException $e) {
if (isset($debug[2]) && $debug[2] == '1' ) {
$usrSiteMsg .='<br><span class="msgOk"><b>reqUpdate commande commentaire= </b>' .$reqUpdate. '<span>';
$usrSiteMsg .='<br>PDOException = ' .$e->getMessage(). '';
}
}
}
?>